offbrand
A collection of generic, reference counted datastructures in C for C
 All Classes Files Functions Variables Typedefs Macros Groups
obmap_private.h
Go to the documentation of this file.
1 
7 #ifndef OBMAP_PRIVATE_H
8 #define OBMAP_PRIVATE_H
9 
10 #include "../obmap.h"
11 #include "../obvector.h"
12 #include "../obdeque.h"
13 
14 /* obmap PRIVATE CONSTANTS */
15 
20 extern const uint32_t MAP_CAPACITIES[];
24 extern const uint32_t NUM_CAPACITIES;
28 extern const double MAX_LOAD_FACTOR;
29 
30 
31 /* obmap_pair DATA */
32 
37 typedef struct obmap_pair_struct{
39  obj *key;
41 } obmap_pair;
42 
43 /* obmap_pair PRIVATE METHODS */
44 
58 obmap_pair * obmap_new_pair(obj *key, obj *value);
59 
70 
77 void obmap_replace_pair_value(obmap_pair *mp, obj *value);
78 
86 ob_hash_t obmap_hash_pair(const obj *to_hash);
87 
93 void obmap_display_pair(const obj *to_print);
94 
104 void obmap_destroy_pair(obj *to_dealloc);
105 
106 
107 /* obmap DATA */
108 
115  uint8_t cap_idx;
120  uint32_t collisions;
122 };
123 
124 /* obmap PRIVATE METHODS */
125 
135 
143 ob_hash_t obmap_hash(const obj *to_hash);
144 
155 int8_t obmap_compare(const obj *a, const obj *b);
156 /* Arguments are obj * so that a function pointer can be used for container
157  * class sorting/search */
158 
164 void obmap_display(const obj *to_print);
165 
175 void obmap_destroy(obj *to_dealloc);
176 
183 void obmap_increase_size(obmap *to_size);
184 
192 
202 ob_hash_t obmap_find_key(const obmap *m, const obj *key);
203 
213 
214 #endif
215