+2001-09-17 Bruno Haible <haible@clisp.cons.org>
+
+ * basename.h: New file.
+ * basename.c: Include it. Don't compile the function if already
+ present in the GNU C library.
+ * Makefile.am (libnlsut_a_HEADER): Add basename.h.
+ * system.h (gnu_basename, basename): Remove.
+
2001-09-09 Bruno Haible <haible@clisp.cons.org>
* xmalloc.h: New file.
pipe-out.c progname.c sh-quote.c tmpdir.c wait-process.c xerror.c xgetcwd.c \
xmalloc.c xstrdup.c
-libnlsut_a_HEADER = c-ctype.h execute.h findprog.h fstrcmp.h full-write.h \
-gcd.h getopt.h hash.h javacomp.h javaexec.h lbrkprop.h linebreak.h mbswidth.h \
-obstack.h pathmax.h pipe.h progname.h sh-quote.h system.h tmpdir.h \
-utf8-ucs4.h utf16-ucs4.h wait-process.h xerror.h xmalloc.h
+libnlsut_a_HEADER = basename.h c-ctype.h execute.h findprog.h fstrcmp.h \
+full-write.h gcd.h getopt.h hash.h javacomp.h javaexec.h lbrkprop.h \
+linebreak.h mbswidth.h obstack.h pathmax.h pipe.h progname.h sh-quote.h \
+system.h tmpdir.h utf8-ucs4.h utf16-ucs4.h wait-process.h xerror.h xmalloc.h
# Sources that are compiled only on platforms that lack the functions.
# include <config.h>
#endif
+/* Specification. */
+#include "basename.h"
+
+#ifndef __GNU_LIBRARY__
+
#include <stdio.h>
#include <assert.h>
return (char *) base;
}
+
+#endif
--- /dev/null
+/* Pathname hacking.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _BASENAME_H
+#define _BASENAME_H
+
+/* This is where basename() is declared. */
+#include <string.h>
+
+#ifndef __GNU_LIBRARY__
+/* When not using the GNU libc we use the basename implementation we
+ provide here. */
+extern char *gnu_basename PARAMS ((const char *));
+#define basename(Arg) gnu_basename (Arg)
+#endif
+
+#endif /* _BASENAME_H */
const char *filename,
const char *suffix));
-/* When not using the GNU libc we use the basename implementation we
- provide here. */
-#ifndef __GNU_LIBRARY__
-extern char *gnu_basename PARAMS ((const char *));
-# define basename(Arg) gnu_basename (Arg)
-#endif
-
#include <fcntl.h>
/* For systems that distinguish between text and binary I/O.
+2001-09-17 Bruno Haible <haible@clisp.cons.org>
+
+ * gettext.c: Include basename.h.
+ * ngettext.c: Likewise.
+ * msgattrib.c: Likewise.
+ * msgcat.c: Likewise.
+ * msgcmp.c: Likewise.
+ * msgcomm.c: Likewise.
+ * msgconv.c: Likewise.
+ * msgen.c: Likewise.
+ * msgexec.c: Likewise.
+ * msgfmt.c: Likewise.
+ * msggrep.c: Likewise.
+ * msgl-cat.c: Likewise.
+ * msgl-charset.c: Likewise.
+ * msgl-iconv.c: Likewise.
+ * msgmerge.c: Likewise.
+ * msgunfmt.c: Likewise.
+ * msguniq.c: Likewise.
+ * xgettext.c: Likewise.
+ * po-charset.c: Include <stdlib.h> and basename.h.
+
2001-09-16 Bruno Haible <haible@clisp.cons.org>
* x-c.c (phase4_getc): Rename local variable 'state' to
#include <locale.h>
#include "error.h"
+#include "basename.h"
#include "xmalloc.h"
#include "system.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "file-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "system.h"
#include "libgettext.h"
#include "file-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "error.h"
#include "hash.h"
#include "progname.h"
+#include "basename.h"
#include "xerror.h"
#include "getline.h"
#include "format.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "msgl-iconv.h"
#include "xmalloc.h"
#include "strstr.h"
+#include "basename.h"
#include "system.h"
#include "libgettext.h"
#include "po-charset.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "xerror.h"
#include "message.h"
#include "strstr.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "po-charset.h"
#include "msgl-ascii.h"
#include "dir-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "system.h"
#include "message.h"
#include "msgunfmt.h"
#include "str-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "message.h"
#include "read-po.h"
#include "write-po.h"
#include <errno.h>
#include "error.h"
+#include "basename.h"
#include "xmalloc.h"
#include "system.h"
/* Specification. */
#include "po-charset.h"
+#include <stdlib.h>
+
#include "error.h"
#include "xerror.h"
+#include "basename.h"
#include "strstr.h"
#include "system.h"
#include "libgettext.h"
#include "file-list.h"
#include "error.h"
#include "progname.h"
+#include "basename.h"
#include "xerror.h"
#include "getline.h"
#include "xmalloc.h"
+2001-09-17 Bruno Haible <haible@clisp.cons.org>
+
+ * tstngettext.c: Include basename.h.
+
2001-09-22 Bruno Haible <haible@clisp.cons.org>
* Makefile.am (TESTS): Add xgettext-12, xgettext-13, xgettext-14.
#include <errno.h>
#include "error.h"
+#include "basename.h"
#include "system.h"
#define HAVE_SETLOCALE 1