From: Bruno Haible Date: Tue, 29 Apr 2025 22:03:14 +0000 (+0200) Subject: Rename module hash-pjw-bare to hashcode-mem. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdb41cdfe4aff298197210df907c829b8048b51a;p=thirdparty%2Fgnulib.git Rename module hash-pjw-bare to hashcode-mem. * lib/hashcode-mem.h: Renamed from lib/hash-pjw-bare.h. * lib/hashcode-mem.c: Renamed from lib/hash-pjw-bare.c. * lib/hash-pjw-bare.h: New file. * modules/hashcode-mem: Renamed from modules/hash-pjw-bare. * modules/hash-pjw-bare: New file. * MODULES.html.sh: Update. --- diff --git a/ChangeLog b/ChangeLog index 55c570f68b..85c9d767bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2025-04-29 Bruno Haible + + Rename module hash-pjw-bare to hashcode-mem. + * lib/hashcode-mem.h: Renamed from lib/hash-pjw-bare.h. + * lib/hashcode-mem.c: Renamed from lib/hash-pjw-bare.c. + * lib/hash-pjw-bare.h: New file. + * modules/hashcode-mem: Renamed from modules/hash-pjw-bare. + * modules/hash-pjw-bare: New file. + * MODULES.html.sh: Update. + 2025-04-29 Bruno Haible hash: Remove deprecated function 'hash_delete'. diff --git a/MODULES.html.sh b/MODULES.html.sh index 1deb6e55a5..9aab40c27f 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2096,7 +2096,7 @@ func_all_modules () func_module obstack-printf func_module obstack-printf-posix func_module hash-pjw - func_module hash-pjw-bare + func_module hashcode-mem func_module hash func_module hamt func_module readline diff --git a/lib/hash-pjw-bare.h b/lib/hash-pjw-bare.h index 7ea1a8886a..70d36db1ce 100644 --- a/lib/hash-pjw-bare.h +++ b/lib/hash-pjw-bare.h @@ -1,5 +1,5 @@ /* hash-pjw-bare.h -- declaration for a simple hash function - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -14,26 +14,8 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -/* This file uses _GL_ATTRIBUTE_PURE. */ -#if !_GL_CONFIG_H_INCLUDED - #error "Please include config.h first." -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Compute a hash code for a buffer starting at X and of size N, - and return the hash code. Note that unlike hash_pjw(), it does not - return it modulo a table size. - The result is platform dependent: it depends on the size of the 'size_t' - type. */ -extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; - +#include "hashcode-mem.h" -#ifdef __cplusplus -} +#if __GNUC__ || (__clang_major__ >= 4) +# warning "The include file hash-pjw-bare.h is deprecated. Use hashcode-mem.h instead." #endif diff --git a/lib/hash-pjw-bare.c b/lib/hashcode-mem.c similarity index 91% rename from lib/hash-pjw-bare.c rename to lib/hashcode-mem.c index a6a66cb93b..cf086b0b16 100644 --- a/lib/hash-pjw-bare.c +++ b/lib/hashcode-mem.c @@ -1,4 +1,4 @@ -/* hash-pjw-bare.c -- compute a hash value from a provided buffer. +/* hashcode-mem.c -- compute a hash value from a provided buffer. Copyright (C) 2012-2025 Free Software Foundation, Inc. @@ -17,7 +17,8 @@ #include -#include "hash-pjw-bare.h" +/* Specification. */ +#include "hashcode-mem.h" #include diff --git a/lib/hashcode-mem.h b/lib/hashcode-mem.h new file mode 100644 index 0000000000..4f5adefb52 --- /dev/null +++ b/lib/hashcode-mem.h @@ -0,0 +1,39 @@ +/* hashcode-mem.h -- declaration for a simple hash function + Copyright (C) 2012-2025 Free Software Foundation, Inc. + + 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 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +/* This file uses _GL_ATTRIBUTE_PURE. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Compute a hash code for a buffer starting at X and of size N, + and return the hash code. Note that unlike hash_pjw(), it does not + return it modulo a table size. + The result is platform dependent: it depends on the size of the 'size_t' + type. */ +extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} +#endif diff --git a/modules/hash-pjw-bare b/modules/hash-pjw-bare index 4dc94e3a32..05786a3763 100644 --- a/modules/hash-pjw-bare +++ b/modules/hash-pjw-bare @@ -1,22 +1,25 @@ Description: Compute a hash value for a buffer of known size. +Status: +deprecated + +Notice: +This module is deprecated. Use the module 'hashcode-mem' instead. + Files: -lib/hash-pjw-bare.h -lib/hash-pjw-bare.c Depends-on: +hashcode-mem configure.ac: Makefile.am: -lib_SOURCES += hash-pjw-bare.h hash-pjw-bare.c Include: -"hash-pjw-bare.h" +"hashcode-mem.h" License: LGPLv2+ Maintainer: -Jim Meyering diff --git a/modules/hashcode-mem b/modules/hashcode-mem new file mode 100644 index 0000000000..1c6431a531 --- /dev/null +++ b/modules/hashcode-mem @@ -0,0 +1,23 @@ +Description: +Compute a hash value for a buffer of known size. + +Files: +lib/hashcode-mem.h +lib/hashcode-mem.c +lib/hash-pjw-bare.h + +Depends-on: + +configure.ac: + +Makefile.am: +lib_SOURCES += hashcode-mem.h hashcode-mem.c + +Include: +"hashcode-mem.h" + +License: +LGPLv2+ + +Maintainer: +Jim Meyering