1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

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.
This commit is contained in:
Bruno Haible
2025-04-30 00:46:21 +02:00
parent 53cea75d3d
commit 3748256978
10 changed files with 91 additions and 58 deletions

View File

@@ -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.

View 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. */

View 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.

View 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

View File

@@ -19,7 +19,7 @@
#include <config.h>
/* Specification. */
#include "hash-triple.h"
#include "hashcode-file.h"
#include "same.h"
#include "same-inode.h"

60
lib/hashcode-file.h Normal file
View File

@@ -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

View File

@@ -19,7 +19,7 @@
#include <config.h>
/* Specification. */
#include "hash-triple.h"
#include "hashcode-file.h"
#include <stdlib.h>
#include <string.h>

View File

@@ -17,7 +17,7 @@ configure.ac:
Makefile.am:
Include:
"hash-triple.h"
"hashcode-file.h"
License:
GPL

View File

@@ -15,7 +15,7 @@ Makefile.am:
lib_SOURCES += hashcode-file-inode.c
Include:
"hash-triple.h"
"hashcode-file.h"
License:
GPL

View 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