From: Bruno Haible Date: Tue, 29 Apr 2025 22:46:21 +0000 (+0200) Subject: Rename include file hash-triple.h to hashcode-file.h. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3748256978cd900c0404c09ab22c3b5a2f35e031;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 44e143f459..6a39c93bda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2025-04-29 Bruno Haible + 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. diff --git a/lib/canonicalize.c b/lib/canonicalize.c index 88472cc927..10d85efb1a 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -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. */ diff --git a/lib/file-set.c b/lib/file-set.c index 0d9e9206f7..6d4f02554a 100644 --- a/lib/file-set.c +++ b/lib/file-set.c @@ -19,7 +19,7 @@ #include #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. diff --git a/lib/hash-triple.h b/lib/hash-triple.h index 26ef7a1f05..708835f22f 100644 --- a/lib/hash-triple.h +++ b/lib/hash-triple.h @@ -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 . */ -/* 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 -#include - -#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 diff --git a/lib/hashcode-file-inode.c b/lib/hashcode-file-inode.c index 5d47e58fb4..f635804190 100644 --- a/lib/hashcode-file-inode.c +++ b/lib/hashcode-file-inode.c @@ -19,7 +19,7 @@ #include /* 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 index 0000000000..004359bce6 --- /dev/null +++ b/lib/hashcode-file.h @@ -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 . */ + +/* 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 +#include + +#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 diff --git a/lib/hashcode-named-file.c b/lib/hashcode-named-file.c index 4bb71375f4..a488147edd 100644 --- a/lib/hashcode-named-file.c +++ b/lib/hashcode-named-file.c @@ -19,7 +19,7 @@ #include /* Specification. */ -#include "hash-triple.h" +#include "hashcode-file.h" #include #include diff --git a/modules/hash-triple b/modules/hash-triple index 5c446cbe34..1f1cfc37a6 100644 --- a/modules/hash-triple +++ b/modules/hash-triple @@ -17,7 +17,7 @@ configure.ac: Makefile.am: Include: -"hash-triple.h" +"hashcode-file.h" License: GPL diff --git a/modules/hashcode-file-inode b/modules/hashcode-file-inode index 87d2d41486..2e2b0ad51a 100644 --- a/modules/hashcode-file-inode +++ b/modules/hashcode-file-inode @@ -15,7 +15,7 @@ Makefile.am: lib_SOURCES += hashcode-file-inode.c Include: -"hash-triple.h" +"hashcode-file.h" License: GPL diff --git a/modules/hashcode-named-file b/modules/hashcode-named-file index 621560430d..bdc68502f8 100644 --- a/modules/hashcode-named-file +++ b/modules/hashcode-named-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