]> Savannah Git Hosting - gnulib.git/commitdiff
Rename include file hash-triple.h to hashcode-file.h.
authorBruno Haible <bruno@clisp.org>
Tue, 29 Apr 2025 22:46:21 +0000 (00:46 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 29 Apr 2025 22:51:32 +0000 (00:51 +0200)
* lib/hashcode-file.h: Renamed from lib/hash-triple.h.
* lib/hash-triple.h: New file.
* lib/hashcode-named-file.c: Update.
* lib/hashcode-file-inode.c: Update.
* lib/canonicalize.c: Update.
* lib/file-set.c: Update.
* modules/hashcode-named-file (Files, Include): Update.
* modules/hashcode-file-inode (Include): Update.
* modules/hash-triple (Include): Update.

ChangeLog
lib/canonicalize.c
lib/file-set.c
lib/hash-triple.h
lib/hashcode-file-inode.c
lib/hashcode-file.h [new file with mode: 0644]
lib/hashcode-named-file.c
modules/hash-triple
modules/hashcode-file-inode
modules/hashcode-named-file

index 44e143f459cbf2cffc665e34a2406ce35e5d29fd..6a39c93bdac8fcf51426593e28f829c6a22a682f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2025-04-29  Bruno Haible  <bruno@clisp.org>
 
+       Rename include file hash-triple.h to hashcode-file.h.
+       * lib/hashcode-file.h: Renamed from lib/hash-triple.h.
+       * lib/hash-triple.h: New file.
+       * lib/hashcode-named-file.c: Update.
+       * lib/hashcode-file-inode.c: Update.
+       * lib/canonicalize.c: Update.
+       * lib/file-set.c: Update.
+       * modules/hashcode-named-file (Files, Include): Update.
+       * modules/hashcode-file-inode (Include): Update.
+       * modules/hash-triple (Include): Update.
+
        Rename module hash-triple to hashcode-file-inode.
        * lib/hashcode-file-inode.c: Renamed from lib/hash-triple.c.
        * modules/hashcode-file-inode: Renamed from modules/hash-triple.
index 88472cc927c3f35f5cd49b16a7859bd661cd957b..10d85efb1af9e89cb069fb988f3c70efa4f448e2 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "attribute.h"
 #include "file-set.h"
-#include "hash-triple.h"
+#include "hashcode-file.h"
 #include "xalloc.h"
 
 /* Suppress bogus GCC -Wmaybe-uninitialized warnings.  */
index 0d9e9206f7619240167bc1564e129080b29dd6f1..6d4f02554a7c8662c3795a62c790a93c7aafc643 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 #include "file-set.h"
 
-#include "hash-triple.h"
+#include "hashcode-file.h"
 #include "xalloc.h"
 
 /* Record file, FILE, and dev/ino from *STATS, in the hash table, HT.
index 26ef7a1f050fc9c5028fb3cf96d91001062b3fd6..708835f22fb9810f24b4d20359684726a80263fe 100644 (file)
@@ -1,60 +1,21 @@
-/* Hash functions for file-related (name, device, inode) triples.
-   Copyright (C) 2007-2025 Free Software Foundation, Inc.
+/* hash-triple.h -- declaration for a simple hash function
+   Copyright (C) 2025 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 file 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,
+   This file 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.
+   GNU Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-/* Written by Jim Meyering, 2007.  */
-
-#ifndef HASH_TRIPLE_H
-#define HASH_TRIPLE_H
-
-/* This file uses _GL_ATTRIBUTE_PURE.  */
-#if !_GL_CONFIG_H_INCLUDED
- #error "Please include config.h first."
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Describe a just-created or just-renamed destination file.  */
-struct F_triple
-{
-  char *name;
-  ino_t st_ino;
-  dev_t st_dev;
-};
-
-/* Defined in module 'hashcode-named-file'.  */
-
-extern size_t triple_hash (void const *x, size_t table_size) _GL_ATTRIBUTE_PURE;
-extern bool triple_compare_ino_str (void const *x, void const *y)
-  _GL_ATTRIBUTE_PURE;
-extern void triple_free (void *x);
-
-/* Defined in module 'hashcode-file-inode'.  */
-extern size_t triple_hash_no_name (void const *x, size_t table_size)
-  _GL_ATTRIBUTE_PURE;
-extern bool triple_compare (void const *x, void const *y);
-
-
-#ifdef __cplusplus
-}
-#endif
+#include "hashcode-string.h"
 
+#if __GNUC__ || (__clang_major__ >= 4)
+# warning "The include file hash-triple.h is deprecated. Use hashcode-file.h instead."
 #endif
index 5d47e58fb41a1edfb48a02fa4350dea8791265b5..f635804190c5ae3cc4bb7ce97e836e956158d20c 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "hash-triple.h"
+#include "hashcode-file.h"
 
 #include "same.h"
 #include "same-inode.h"
diff --git a/lib/hashcode-file.h b/lib/hashcode-file.h
new file mode 100644 (file)
index 0000000..004359b
--- /dev/null
@@ -0,0 +1,60 @@
+/* Hash functions for file-related (name, device, inode) triples.
+   Copyright (C) 2007-2025 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 <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering, 2007.  */
+
+#ifndef HASHCODE_FILE_H
+#define HASHCODE_FILE_H
+
+/* This file uses _GL_ATTRIBUTE_PURE.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Describe a just-created or just-renamed destination file.  */
+struct F_triple
+{
+  char *name;
+  ino_t st_ino;
+  dev_t st_dev;
+};
+
+/* Defined in module 'hashcode-named-file'.  */
+
+extern size_t triple_hash (void const *x, size_t table_size) _GL_ATTRIBUTE_PURE;
+extern bool triple_compare_ino_str (void const *x, void const *y)
+  _GL_ATTRIBUTE_PURE;
+extern void triple_free (void *x);
+
+/* Defined in module 'hashcode-file-inode'.  */
+extern size_t triple_hash_no_name (void const *x, size_t table_size)
+  _GL_ATTRIBUTE_PURE;
+extern bool triple_compare (void const *x, void const *y);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 4bb71375f4e56a1b3e1778bc77bab60a450111a3..a488147eddb85673b010171835a8f84d00d362b0 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "hash-triple.h"
+#include "hashcode-file.h"
 
 #include <stdlib.h>
 #include <string.h>
index 5c446cbe34a615d49d3febac440cd3321888909f..1f1cfc37a687589689d481fe76cf322d544dce2a 100644 (file)
@@ -17,7 +17,7 @@ configure.ac:
 Makefile.am:
 
 Include:
-"hash-triple.h"
+"hashcode-file.h"
 
 License:
 GPL
index 87d2d41486c2125d109a721292d2631aac5ae82d..2e2b0ad51a287b6b54987400a46d6259a5cb8375 100644 (file)
@@ -15,7 +15,7 @@ Makefile.am:
 lib_SOURCES += hashcode-file-inode.c
 
 Include:
-"hash-triple.h"
+"hashcode-file.h"
 
 License:
 GPL
index 621560430dbfa2053f4efed46faf5b594484f51a..bdc68502f82fede3c4653ecb2c7cb0574c342553 100644 (file)
@@ -3,6 +3,7 @@ Hash functions for file-related triples: name, device, inode.
 
 Files:
 lib/hashcode-named-file.c
+lib/hashcode-file.h
 lib/hash-triple.h
 
 Depends-on:
@@ -16,7 +17,7 @@ Makefile.am:
 lib_SOURCES += hashcode-named-file.c
 
 Include:
-"hash-triple.h"
+"hashcode-file.h"
 
 License:
 GPL