Home | History | Annotate | Download | only in libcutils

Lines Matching defs:Entry

26 typedef struct Entry Entry;
27 struct Entry {
31 Entry* next;
35 Entry** buckets;
61 map->buckets = calloc(map->bucketCount, sizeof(Entry*));
109 Entry** newBuckets = calloc(newBucketCount, sizeof(Entry*));
118 Entry* entry = map->buckets[i];
119 while (entry != NULL) {
120 Entry* next = entry->next;
121 size_t index = calculateIndex(newBucketCount, entry->hash);
122 entry->next = newBuckets[index];
123 newBuckets[index] = entry;
124 entry = next;
146 Entry* entry = map->buckets[i];
147 while (entry != NULL) {
148 Entry* next = entry->next;
149 free(entry);
150 entry = next;
173 static Entry* createEntry(void* key, int hash, void* value) {
174 Entry* entry = malloc(sizeof(Entry));
175 if (entry == NULL) {
178 entry->key = key;
179 entry->hash = hash;
180 entry->value = value;
181 entry->next = NULL;
182 return entry;
200 Entry** p = &(map->buckets[index]);
202 Entry* current = *p;
204 // Add a new entry.
216 // Replace existing entry.
223 // Move to next entry.
232 Entry* entry = map->buckets[index];
233 while (entry != NULL) {
234 if (equalKeys(entry->key, entry->hash, key, hash, map->equals)) {
235 return entry->value;
237 entry = entry->next;
247 Entry* entry = map->buckets[index];
248 while (entry != NULL) {
249 if (equalKeys(entry->key, entry->hash, key, hash, map->equals)) {
252 entry = entry->next;
263 Entry** p = &(map->buckets[index]);
265 Entry* current = *p;
267 // Add a new entry.
286 // Move to next entry.
295 // Pointer to the current entry.
296 Entry** p = &(map->buckets[index]);
297 Entry* current;
318 Entry* entry = map->buckets[i];
319 while (entry != NULL) {
320 Entry *next = entry->next;
321 if (!callback(entry->key, entry->value, context)) {
324 entry = next;
338 Entry* entry = map->buckets[i];
339 while (entry != NULL) {
340 if (entry->next != NULL) {
343 entry = entry->next;