Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
unordered_multimap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020 Bailey Thompson
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  */
22 
23 #ifndef BKTHOMPS_CONTAINERS_UNORDERED_MULTIMAP_H
24 #define BKTHOMPS_CONTAINERS_UNORDERED_MULTIMAP_H
25 
26 #include "_bk_defines.h"
27 
32 typedef struct internal_unordered_multimap *unordered_multimap;
33 
34 /* Starting */
36 unordered_multimap_init(size_t key_size,
37  size_t value_size,
38  unsigned long (*hash)(const void *const key),
39  int (*key_comparator)(const void *const one,
40  const void *const two),
41  int (*value_comparator)(const void *const one,
42  const void *const two));
43 
44 /* Utility */
48 
49 /* Accessing */
50 bk_err unordered_multimap_put(unordered_multimap me, void *key, void *value);
53 size_t unordered_multimap_count(unordered_multimap me, void *key);
56  void *key, void *value);
58 
59 /* Ending */
62 
63 #endif /* BKTHOMPS_CONTAINERS_UNORDERED_MULTIMAP_H */
bk_bool unordered_multimap_remove(unordered_multimap me, void *key, void *value)
Definition: unordered_multimap.c:460
bk_err unordered_multimap_put(unordered_multimap me, void *key, void *value)
Definition: unordered_multimap.c:288
bk_bool unordered_multimap_is_empty(unordered_multimap me)
Definition: unordered_multimap.c:207
bk_bool unordered_multimap_get_next(void *value, unordered_multimap me)
Definition: unordered_multimap.c:368
bk_err unordered_multimap_rehash(unordered_multimap me)
Definition: unordered_multimap.c:163
unordered_multimap unordered_multimap_destroy(unordered_multimap me)
Definition: unordered_multimap.c:587
void unordered_multimap_get_start(unordered_multimap me, void *key)
Definition: unordered_multimap.c:337
int bk_bool
Definition: containers.h:49
bk_bool unordered_multimap_contains(unordered_multimap me, void *key)
Definition: unordered_multimap.c:432
size_t unordered_multimap_size(unordered_multimap me)
Definition: unordered_multimap.c:195
unordered_multimap unordered_multimap_init(size_t key_size, size_t value_size, unsigned long(*hash)(const void *const key), int(*key_comparator)(const void *const one, const void *const two), int(*value_comparator)(const void *const one, const void *const two))
struct internal_unordered_multimap * unordered_multimap
Definition: containers.h:514
bk_err unordered_multimap_clear(unordered_multimap me)
Definition: unordered_multimap.c:555
int bk_err
Definition: containers.h:48
size_t unordered_multimap_count(unordered_multimap me, void *key)
Definition: unordered_multimap.c:405
bk_bool unordered_multimap_remove_all(unordered_multimap me, void *key)
Definition: unordered_multimap.c:510
struct internal_unordered_multimap * unordered_multimap
Definition: unordered_multimap.h:32