]> Savannah Git Hosting - gnulib.git/commitdiff
Rename module hash-triple-simple to hashcode-named-file.
authorBruno Haible <bruno@clisp.org>
Tue, 29 Apr 2025 22:24:55 +0000 (00:24 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 29 Apr 2025 22:51:32 +0000 (00:51 +0200)
* lib/hashcode-named-file.c: Renamed from lib/hash-triple-simple.c.
* modules/hashcode-named-file: Renamed from modules/hash-triple-simple.
* lib/hash-triple.h: Update.
* modules/canonicalize (Depends-on): Update.
* modules/file-set (Depends-on): Update.
* modules/hash-triple (Depends-on): Update.
* NEWS: Mention the change.

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

index 6fee9a0a5c0d4085dde9471963ca7206efc88b5d..a8112663f06f07e1e2e4653f6339841e26776312 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-04-29  Bruno Haible  <bruno@clisp.org>
+
+       Rename module hash-triple-simple to hashcode-named-file.
+       * lib/hashcode-named-file.c: Renamed from lib/hash-triple-simple.c.
+       * modules/hashcode-named-file: Renamed from modules/hash-triple-simple.
+       * lib/hash-triple.h: Update.
+       * modules/canonicalize (Depends-on): Update.
+       * modules/file-set (Depends-on): Update.
+       * modules/hash-triple (Depends-on): Update.
+       * NEWS: Mention the change.
+
 2025-04-29  Bruno Haible  <bruno@clisp.org>
 
        Rename module hash-pjw to hashcode-string.
diff --git a/NEWS b/NEWS
index d009455429732674697b8c0333232f294dd21921..57249ffc026e4dd3d34e9d9cd8f332f3dd5df376 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,8 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2025-04-29  hash-triple-simple  This module is renamed to hashcode-named-file.
+
 2025-01-02  string-desc     The function prefix is changed from string_desc_
             xstring-desc    to sd_, and from xstring_desc_ to xsd_.
             string-desc-quotearg
diff --git a/lib/hash-triple-simple.c b/lib/hash-triple-simple.c
deleted file mode 100644 (file)
index 4bb7137..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Hash functions for file-related triples: name, device, inode.
-   Copyright (C) 2007, 2009-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 */
-
-#include <config.h>
-
-/* Specification.  */
-#include "hash-triple.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "hashcode-string.h"
-#include "same-inode.h"
-
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
-/* Hash an F_triple, and *do* consider the file name.  */
-size_t
-triple_hash (void const *x, size_t table_size)
-{
-  struct F_triple const *p = x;
-  size_t tmp = hash_pjw (p->name, table_size);
-
-  /* Ignoring the device number here should be fine.  */
-  return (tmp ^ p->st_ino) % table_size;
-}
-
-/* Compare two F_triple structs.  */
-bool
-triple_compare_ino_str (void const *x, void const *y)
-{
-  struct F_triple const *a = x;
-  struct F_triple const *b = y;
-  return PSAME_INODE (a, b) && STREQ (a->name, b->name);
-}
-
-/* Free an F_triple.  */
-void
-triple_free (void *x)
-{
-  struct F_triple *a = x;
-  free (a->name);
-  free (a);
-}
index 63819ae3e9c151f0265959be8d8fb9f54234d291..1e59be64baf00f440048cb0ac3145231c835e7a5 100644 (file)
@@ -40,7 +40,7 @@ struct F_triple
   dev_t st_dev;
 };
 
-/* Defined in module 'hash-triple-simple'.  */
+/* 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)
diff --git a/lib/hashcode-named-file.c b/lib/hashcode-named-file.c
new file mode 100644 (file)
index 0000000..4bb7137
--- /dev/null
@@ -0,0 +1,59 @@
+/* Hash functions for file-related triples: name, device, inode.
+   Copyright (C) 2007, 2009-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 */
+
+#include <config.h>
+
+/* Specification.  */
+#include "hash-triple.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "hashcode-string.h"
+#include "same-inode.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Hash an F_triple, and *do* consider the file name.  */
+size_t
+triple_hash (void const *x, size_t table_size)
+{
+  struct F_triple const *p = x;
+  size_t tmp = hash_pjw (p->name, table_size);
+
+  /* Ignoring the device number here should be fine.  */
+  return (tmp ^ p->st_ino) % table_size;
+}
+
+/* Compare two F_triple structs.  */
+bool
+triple_compare_ino_str (void const *x, void const *y)
+{
+  struct F_triple const *a = x;
+  struct F_triple const *b = y;
+  return PSAME_INODE (a, b) && STREQ (a->name, b->name);
+}
+
+/* Free an F_triple.  */
+void
+triple_free (void *x)
+{
+  struct F_triple *a = x;
+  free (a->name);
+  free (a);
+}
index 300705c130a23c0a4f617b799c8dab53ddc47be0..70861a6164fa4b73d89c6ca9ccf1dc1c98490bc8 100644 (file)
@@ -16,7 +16,7 @@ fcntl-h
 file-set
 filename
 getcwd
-hash-triple-simple
+hashcode-named-file
 idx
 intprops
 memmove
index 23efdfbb9d47434770cbfe4eb508dcbcdba88833..d3b3a107f4e4c063cc81b2765eb829142d4f15ff 100644 (file)
@@ -7,7 +7,7 @@ lib/file-set.h
 
 Depends-on:
 hash
-hash-triple-simple
+hashcode-named-file
 bool
 xalloc
 xalloc-die
index b726192a8d493774cefdcb8b0cc0400b9ad37ad1..f908f109495ab021d4f08d51df594b8746e71d28 100644 (file)
@@ -5,7 +5,7 @@ Files:
 lib/hash-triple.c
 
 Depends-on:
-hash-triple-simple
+hashcode-named-file
 same
 same-inode
 
diff --git a/modules/hash-triple-simple b/modules/hash-triple-simple
deleted file mode 100644 (file)
index a78c019..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Description:
-Hash functions for file-related triples: name, device, inode.
-
-Files:
-lib/hash-triple-simple.c
-lib/hash-triple.h
-
-Depends-on:
-hashcode-string
-same-inode
-bool
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += hash-triple-simple.c
-
-Include:
-"hash-triple.h"
-
-License:
-GPL
-
-Maintainer:
-Jim Meyering
diff --git a/modules/hashcode-named-file b/modules/hashcode-named-file
new file mode 100644 (file)
index 0000000..6215604
--- /dev/null
@@ -0,0 +1,25 @@
+Description:
+Hash functions for file-related triples: name, device, inode.
+
+Files:
+lib/hashcode-named-file.c
+lib/hash-triple.h
+
+Depends-on:
+hashcode-string
+same-inode
+bool
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += hashcode-named-file.c
+
+Include:
+"hash-triple.h"
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering