68 type(iihash_t),
intent(out) :: h
71 subroutine iihash_map_init(map)
75 type(c_ptr),
intent(inout) :: map
76 end subroutine iihash_map_init
82 call iihash_map_init(h%map)
91 type(iihash_t),
intent(inout) :: h
94 subroutine iihash_map_end(map)
98 type(c_ptr),
intent(inout) :: map
99 end subroutine iihash_map_end
104 call iihash_map_end(h%map)
113 type(iihash_t),
intent(inout) :: h
114 integer,
intent(in) :: key
115 integer,
intent(in) :: val
118 subroutine iihash_map_insert(map, key, val)
122 type(c_ptr),
intent(inout) :: map
123 integer,
intent(in) :: key
124 integer,
intent(in) :: val
125 end subroutine iihash_map_insert
128 call iihash_map_insert(h%map, key, val)
138 type(iihash_t),
intent(in) :: h
139 integer,
intent(in) :: key
140 logical,
optional,
intent(out) :: found
143 subroutine iihash_map_lookup(map, key, ifound, val)
147 type(c_ptr),
intent(in) :: map
148 integer,
intent(in) :: key
149 integer,
intent(out) :: ifound
150 integer,
intent(out) :: val
151 end subroutine iihash_map_lookup
154 integer :: ifound, val
157 call iihash_map_lookup(h%map, key, ifound, val)
159 found_ = (ifound == 1)
160 if (
present(found)) found = found_
173 subroutine lihash_map_init(map)
177 type(c_ptr),
intent(inout) :: map
178 end subroutine lihash_map_init
184 call lihash_map_init(h%map)
196 subroutine lihash_map_end(map)
200 type(c_ptr),
intent(inout) :: map
201 end subroutine lihash_map_end
206 call lihash_map_end(h%map)
216 integer(int64),
intent(in) :: key
217 integer,
intent(in) :: val
220 subroutine lihash_map_insert(map, key, val)
222 use,
intrinsic :: iso_fortran_env
225 type(c_ptr),
intent(inout) :: map
226 integer(int64),
intent(in) :: key
227 integer,
intent(in) :: val
228 end subroutine lihash_map_insert
231 call lihash_map_insert(h%map, key, val)
242 integer(int64),
intent(in) :: key
243 logical,
optional,
intent(out) :: found
246 subroutine lihash_map_lookup(map, key, ifound, val)
248 use,
intrinsic :: iso_fortran_env
251 type(c_ptr),
intent(in) :: map
252 integer(int64),
intent(in) :: key
253 integer,
intent(out) :: ifound
254 integer,
intent(out) :: val
255 end subroutine lihash_map_lookup
258 integer :: ifound, val
261 call lihash_map_lookup(h%map, key, ifound, val)
263 found_ = (ifound == 1)
264 if (
present(found)) found = found_
This module implements a simple hash table for non-negative integer keys and integer values.
integer function, public lihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
subroutine, public lihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
subroutine, public iihash_end(h)
Free a hash table.
subroutine, public lihash_end(h)
Free a hash table.
subroutine, public lihash_init(h)
Initialize a hash table h.
subroutine, public iihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
integer function, public iihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
subroutine, public iihash_init(h)
Initialize a hash table h.