* 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.
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.
#include "attribute.h"
#include "file-set.h"
-#include "hash-triple.h"
+#include "hashcode-file.h"
#include "xalloc.h"
/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */
#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.
-/* 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
#include <config.h>
/* Specification. */
-#include "hash-triple.h"
+#include "hashcode-file.h"
#include "same.h"
#include "same-inode.h"
--- /dev/null
+/* 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
#include <config.h>
/* Specification. */
-#include "hash-triple.h"
+#include "hashcode-file.h"
#include <stdlib.h>
#include <string.h>
Makefile.am:
Include:
-"hash-triple.h"
+"hashcode-file.h"
License:
GPL
lib_SOURCES += hashcode-file-inode.c
Include:
-"hash-triple.h"
+"hashcode-file.h"
License:
GPL
Files:
lib/hashcode-named-file.c
+lib/hashcode-file.h
lib/hash-triple.h
Depends-on:
lib_SOURCES += hashcode-named-file.c
Include:
-"hash-triple.h"
+"hashcode-file.h"
License:
GPL