Debian Codegraph @

lib/hash-triple.h

raw
1 /* Hash functions for file-related (name, device, inode) triples.
2 Copyright (C) 2007-2024 Free Software Foundation, Inc.
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17 /* Written by Jim Meyering, 2007. */
18
19 #ifndef HASH_TRIPLE_H
20 #define HASH_TRIPLE_H
21
22 /* This file uses _GL_ATTRIBUTE_PURE. */
23 #if !_GL_CONFIG_H_INCLUDED
24 #error "Please include config.h first."
25 #endif
26
27 #include <sys/types.h>
28 #include <sys/stat.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34
35 /* Describe a just-created or just-renamed destination file. */
36 struct F_triple
37 {
38 char *name;
39 ino_t st_ino;
40 dev_t st_dev;
41 };
42
43 /* Defined in module 'hash-triple-simple'. */
44
45 extern size_t triple_hash (void const *x, size_t table_size) _GL_ATTRIBUTE_PURE;
46 extern bool triple_compare_ino_str (void const *x, void const *y)
47 _GL_ATTRIBUTE_PURE;
48 extern void triple_free (void *x);
49
50 /* Defined in module 'hash-triple'. */
51 extern size_t triple_hash_no_name (void const *x, size_t table_size)
52 _GL_ATTRIBUTE_PURE;
53 extern bool triple_compare (void const *x, void const *y);
54
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif