ReactOS  0.4.14-dev-384-g5b37caa
fthash.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* fthash.h */
4 /* */
5 /* Hashing functions (specification). */
6 /* */
7 /***************************************************************************/
8 
9 /*
10  * Copyright 2000 Computing Research Labs, New Mexico State University
11  * Copyright 2001-2015
12  * Francesco Zappa Nardelli
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining a
15  * copy of this software and associated documentation files (the "Software"),
16  * to deal in the Software without restriction, including without limitation
17  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18  * and/or sell copies of the Software, and to permit persons to whom the
19  * Software is furnished to do so, subject to the following conditions:
20  *
21  * The above copyright notice and this permission notice shall be included in
22  * all copies or substantial portions of the Software.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27  * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
28  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
29  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
30  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31  */
32 
33  /*************************************************************************/
34  /* */
35  /* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
36  /* */
37  /* taken from Mark Leisher's xmbdfed package */
38  /* */
39  /*************************************************************************/
40 
41 
42 #ifndef FTHASH_H_
43 #define FTHASH_H_
44 
45 
46 #include <ft2build.h>
47 #include FT_FREETYPE_H
48 
49 
51 
52 
53  typedef union FT_Hashkey_
54  {
56  const char* str;
57 
58  } FT_Hashkey;
59 
60 
61  typedef struct FT_HashnodeRec_
62  {
64  size_t data;
65 
67 
68  typedef struct FT_HashnodeRec_ *FT_Hashnode;
69 
70 
71  typedef FT_ULong
73 
74  typedef FT_Bool
76  FT_Hashkey* b );
77 
78 
79  typedef struct FT_HashRec_
80  {
84 
87 
89 
90  } FT_HashRec;
91 
92  typedef struct FT_HashRec_ *FT_Hash;
93 
94 
95  FT_Error
97  FT_Memory memory );
98 
99  FT_Error
101  FT_Memory memory );
102 
103  void
105  FT_Memory memory );
106 
107 #define ft_hash_num_free ft_hash_str_free
108 
109  FT_Error
110  ft_hash_str_insert( const char* key,
111  size_t data,
112  FT_Hash hash,
113  FT_Memory memory );
114 
115  FT_Error
117  size_t data,
118  FT_Hash hash,
119  FT_Memory memory );
120 
121  size_t*
122  ft_hash_str_lookup( const char* key,
123  FT_Hash hash );
124 
125  size_t*
127  FT_Hash hash );
128 
129 
131 
132 
133 #endif /* FTHASH_H_ */
134 
135 
136 /* END */
int FT_Error
Definition: fttypes.h:300
FT_Hashnode * table
Definition: fthash.h:88
unsigned long FT_ULong
Definition: fttypes.h:253
FT_Hash_CompareFunc compare
Definition: fthash.h:86
#define FT_END_HEADER
Definition: ftheader.h:54
void ft_hash_str_free(FT_Hash hash, FT_Memory memory)
Definition: fthash.c:212
signed int FT_Int
Definition: fttypes.h:220
const char * str
Definition: fthash.h:56
FT_ULong(* FT_Hash_LookupFunc)(FT_Hashkey *key)
Definition: fthash.h:72
FT_Bool(* FT_Hash_CompareFunc)(FT_Hashkey *a, FT_Hashkey *b)
Definition: fthash.h:75
size_t * ft_hash_num_lookup(FT_Int num, FT_Hash hash)
Definition: fthash.c:327
size_t * ft_hash_str_lookup(const char *key, FT_Hash hash)
Definition: fthash.c:314
static char memory[1024 *256]
Definition: process.c:116
FT_Hash_LookupFunc lookup
Definition: fthash.h:85
FT_Error ft_hash_str_init(FT_Hash hash, FT_Memory memory)
Definition: fthash.c:196
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
struct FT_HashRec_ FT_HashRec
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
FT_UInt limit
Definition: fthash.h:81
GLuint GLuint num
Definition: glext.h:9618
FT_Error ft_hash_num_insert(FT_Int num, size_t data, FT_Hash hash, FT_Memory memory)
Definition: fthash.c:287
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
FT_Error ft_hash_num_init(FT_Hash hash, FT_Memory memory)
Definition: fthash.c:204
FT_UInt size
Definition: fthash.h:82
struct FT_HashnodeRec_ * FT_Hashnode
Definition: fthash.h:68
HKEY key
Definition: reg.c:42
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
size_t data
Definition: fthash.h:64
struct FT_HashnodeRec_ FT_HashnodeRec
unsigned int FT_UInt
Definition: fttypes.h:231
FT_Hashkey key
Definition: fthash.h:63
FT_BEGIN_HEADER union FT_Hashkey_ FT_Hashkey
struct FT_HashRec_ * FT_Hash
Definition: fthash.h:92
FT_UInt used
Definition: fthash.h:83
FT_Error ft_hash_str_insert(const char *key, size_t data, FT_Hash hash, FT_Memory memory)
Definition: fthash.c:272
FT_Int num
Definition: fthash.h:55
Definition: _hash_fun.h:40
Definition: path.c:42