GNU PROLOG with UTF8 support
hash_fct.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog engine *
5  * File : hash_fct.c *
6  * Descr.: hash function *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 #ifndef _HASH_FCT_H
40 #define _HASH_FCT_H
41 
42 #include <stdint.h>
43 
44 
45 /*---------------------------------*
46  * Constants *
47  *---------------------------------*/
48 
49 /*---------------------------------*
50  * Type Definitions *
51  *---------------------------------*/
52 
53 typedef struct
54 {
55  int len;
56  uint32_t hash;
57 } HashIncrInfo;
58 
59 
60 
61 /*---------------------------------*
62  * Function Prototypes *
63  *---------------------------------*/
64 
65 uint32_t Pl_Hash_Buffer(const void *data, int len);
66 
68 
69 void Pl_Hash_Incr_Buffer(HashIncrInfo *hi, const void *data, int len);
70 
71 void Pl_Hash_Incr_Int32(HashIncrInfo *hi, uint32_t x);
72 
73 void Pl_Hash_Incr_Int64(HashIncrInfo *hi, uint64_t x);
74 
75 void Pl_Hash_Incr_Double(HashIncrInfo *hi, double x);
76 
77 uint32_t Pl_Hash_Incr_Term(HashIncrInfo *hi);
78 
79 #endif
void Pl_Hash_Incr_Buffer(HashIncrInfo *hi, const void *data, int len)
Definition: hash_fct.c:306
void Pl_Hash_Incr_Init(HashIncrInfo *hi)
Definition: hash_fct.c:292
void Pl_Hash_Incr_Double(HashIncrInfo *hi, double x)
Definition: hash_fct.c:349
int len
Definition: hash_fct.h:55
void Pl_Hash_Incr_Int64(HashIncrInfo *hi, uint64_t x)
Definition: hash_fct.c:334
Definition: hash_fct.h:53
void Pl_Hash_Incr_Int32(HashIncrInfo *hi, uint32_t x)
Definition: hash_fct.c:320
uint32_t Pl_Hash_Buffer(const void *data, int len)
Definition: hash_fct.c:276
PlLong x
Definition: chkma.c:99
uint32_t Pl_Hash_Incr_Term(HashIncrInfo *hi)
Definition: hash_fct.c:456
uint32_t hash
Definition: hash_fct.h:56