]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
New include file "basename.h".
authorBruno Haible <bruno@clisp.org>
Fri, 28 Sep 2001 20:20:05 +0000 (20:20 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 28 Sep 2001 20:20:05 +0000 (20:20 +0000)
27 files changed:
lib/ChangeLog
lib/Makefile.am
lib/basename.c
lib/basename.h [new file with mode: 0644]
lib/system.h
src/ChangeLog
src/gettext.c
src/msgattrib.c
src/msgcat.c
src/msgcmp.c
src/msgcomm.c
src/msgconv.c
src/msgen.c
src/msgexec.c
src/msgfmt.c
src/msggrep.c
src/msgl-cat.c
src/msgl-charset.c
src/msgl-iconv.c
src/msgmerge.c
src/msgunfmt.c
src/msguniq.c
src/ngettext.c
src/po-charset.c
src/xgettext.c
tests/ChangeLog
tests/tstngettext.c

index 04a1cd749d03feed1294bd9ea5f798b36e4b03c5..73b737ed049bf525b3cdd147700d68574203fd80 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 3adfb832e1422b1a8407b741d50fe16195c2469c..c7cc946caf8d90d9e0f29ab170f0bd503db093fc 100644 (file)
@@ -29,10 +29,10 @@ linebreak.c localcharset.c mbswidth.c obstack.c pipe-bidi.c pipe-in.c \
 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.
 
index d3b81aa28a7d54552a5b3361a986a2d4e57762e6..ca0b589f4785bad47c97672322d2dc06fb1bc92c 100644 (file)
 # include <config.h>
 #endif
 
+/* Specification.  */
+#include "basename.h"
+
+#ifndef __GNU_LIBRARY__
+
 #include <stdio.h>
 #include <assert.h>
 
@@ -70,3 +75,5 @@ basename (name)
 
   return (char *) base;
 }
+
+#endif
diff --git a/lib/basename.h b/lib/basename.h
new file mode 100644 (file)
index 0000000..6093e38
--- /dev/null
@@ -0,0 +1,32 @@
+/* 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 */
index 20bae4a10254ea7e21c72becf6b223931d17c1e9..5d822e91a3c1285f33096a6d4754a48ff7e76fc3 100644 (file)
@@ -154,13 +154,6 @@ extern char *concatenated_pathname PARAMS ((const char *directory,
                                            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.
index ffa5cead9b55cdb4894edaae86fe6c29af4c0956..4e8bcad25d22b90697fbb9c3bcba18637a1be2db 100644 (file)
@@ -1,3 +1,25 @@
+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
index f89725ce2339bc808b78b85bb60c57451370361f..dc365eaebe1d5773b0d0eec55583218d54257651 100644 (file)
@@ -27,6 +27,7 @@
 #include <locale.h>
 
 #include "error.h"
+#include "basename.h"
 #include "xmalloc.h"
 #include "system.h"
 
index c823ced9823c91848987c90924cc1c01a6a4d916..a4e2a26f8e46cd3b443fa8510dd781cd98d048dc 100644 (file)
@@ -30,6 +30,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index c1d7a1629621d15f10b1a39cf01197c1df323a91..d92ae9b107c6afb68c640242c59d91e4d13c10bc 100644 (file)
@@ -32,6 +32,7 @@
 #include "file-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 390786b7bed465ddd77473a649ebe79e622de258..275c366b8514c857416353105ffcfe3528940845 100644 (file)
@@ -29,6 +29,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "system.h"
 #include "libgettext.h"
index 9382f1538be42079f6666b7b77e187445e1a4f27..91fbef8e3f7513998e9f4a91617125b556d874cf 100644 (file)
@@ -32,6 +32,7 @@
 #include "file-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 4ec75162fd8efa6b24764ac4f907f517a5c0514d..1c8dc87c84983527eca926683d122331bfb7fa46 100644 (file)
@@ -29,6 +29,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 1dc7f0a94f6620778be9979dff68996a401a8090..05df1cfca7da1b73bd59266544d1c17bd2e1e633 100644 (file)
@@ -29,6 +29,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 86f476fceb4af5d32c63bbbb6c3890ad4f1bec2f..1b54f5514d3d84679d7b5daf8bbfec1dde3d9f29 100644 (file)
@@ -39,6 +39,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 3e2da47b0b235bbce12a9d7d4540f212199c245c..8ec790494be2d4f9dfb4d561c3a3eb3c67939b4f 100644 (file)
@@ -31,6 +31,7 @@
 #include "error.h"
 #include "hash.h"
 #include "progname.h"
+#include "basename.h"
 #include "xerror.h"
 #include "getline.h"
 #include "format.h"
index 85688ea3a642cc046c5f0ad30b43db200c2e860f..de1c07b26548da804e725b4a87c116adc62a5abf 100644 (file)
@@ -37,6 +37,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index a8809a5b1a396a8822c59e67a1f79318b4c77340..44622e834d9a1490c4a43ee5c61ef0ad18797131 100644 (file)
@@ -36,6 +36,7 @@
 #include "msgl-iconv.h"
 #include "xmalloc.h"
 #include "strstr.h"
+#include "basename.h"
 #include "system.h"
 #include "libgettext.h"
 
index b803bbbbb15b9ace9d0d3beee63af6c474772e7c..6f800bea90ed0509532ae3a20cedd5a58990748b 100644 (file)
@@ -30,6 +30,7 @@
 #include "po-charset.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "xerror.h"
 #include "message.h"
 #include "strstr.h"
index b5fe4087f4a2d837a021ff1bf9fea3c919d567e1..3538cc7861316eeb6716f255b60e09c64a9fd117 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "po-charset.h"
 #include "msgl-ascii.h"
index da5003ac71653e481db4e2f341a11fde7241c645..ca9f547b8e5f342329714cb7e5d616812d4ac872 100644 (file)
@@ -29,6 +29,7 @@
 #include "dir-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 69de4318b281471c70968e270a43b6c58aedac3d..7b500676e2a3eba07ce205c394801db629d74eba 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "system.h"
 #include "message.h"
 #include "msgunfmt.h"
index ebaae5f27e8579030414072387429ed1c4b886ad..fe0c77ef2ffaacb103cac307ca7a58a6ef5fe819 100644 (file)
@@ -31,6 +31,7 @@
 #include "str-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
index 9f3bc4ba2fadeb080e3c6fd96472bd1fd6e15ef1..210de0d76cc39b40a2994b0e7676d3df787ed7b5 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 
 #include "error.h"
+#include "basename.h"
 #include "xmalloc.h"
 #include "system.h"
 
index d01da19345c10e159db2491609acb9650c702bc4..9a00be0e8d940ccf95a8a5ec78505748a8a9510c 100644 (file)
 /* 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"
index 1e1051a195f02f760582b694e3d429e15b366b7e..0f9fc1200c2a715945a2c2a1f7f4f703a9521de5 100644 (file)
@@ -41,6 +41,7 @@
 #include "file-list.h"
 #include "error.h"
 #include "progname.h"
+#include "basename.h"
 #include "xerror.h"
 #include "getline.h"
 #include "xmalloc.h"
index fdd0d7dbee0362f994b79ffd07f64a8d1dab2580..d11d772b149e590e4a443f2f13439687fec785e3 100644 (file)
@@ -1,3 +1,7 @@
+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.
index aa54662a54fff7dfce9594954319a042fea34020..526b346e75344399822cae7f46dfcc67862b7e84 100644 (file)
@@ -26,6 +26,7 @@
 #include <errno.h>
 
 #include "error.h"
+#include "basename.h"
 #include "system.h"
 
 #define HAVE_SETLOCALE 1