Home | History | Annotate | Download | only in main

Lines Matching refs:entry

50  * An entry in the hash table.  
53 GLuint Key; /**< the entry's key */
54 void *Data; /**< the entry's data */
55 struct HashEntry *Next; /**< pointer to next entry */
92 * Frees each entry on the hash table and then the hash table structure itself.
104 struct HashEntry *entry = table->Table[pos];
105 while (entry) {
106 struct HashEntry *next = entry->Next;
107 if (entry->Data) {
111 free(entry);
112 entry = next;
123 * Lookup an entry in the hash table, without locking.
130 const struct HashEntry *entry;
136 entry = table->Table[pos];
137 while (entry) {
138 if (entry->Key == key) {
139 return entry->Data;
141 entry = entry->Next;
148 * Lookup an entry in the hash table.
169 * If an entry with this key already exists we'll replace the existing entry.
178 /* search for existing entry with this key */
180 struct HashEntry *entry;
192 /* check if replacing an existing entry with same key */
193 for (entry = table->Table[pos]; entry; entry = entry->Next) {
194 if (entry->Key == key) {
195 /* replace entry's data */
197 if (entry->Data) {
201 entry->Data = data;
207 /* alloc and insert new table entry */
208 entry = MALLOC_STRUCT(HashEntry);
209 if (entry) {
210 entry->Key = key;
211 entry->Data = data;
212 entry->Next = table->Table[pos];
213 table->Table[pos] = entry;
222 * Remove an entry from the hash table.
225 * \param key key of entry to remove.
227 * While holding the hash table's lock, searches the entry with the matching
234 struct HashEntry *entry, *prev;
250 entry = table->Table[pos];
251 while (entry) {
252 if (entry->Key == key) {
255 prev->Next = entry->Next;
258 table->Table[pos] = entry->Next;
260 free(entry);
264 prev = entry;
265 entry = entry->Next;
275 * Invoke the given callback function for each table entry.
293 struct HashEntry *entry, *next;
294 for (entry = table->Table[pos]; entry; entry = next) {
295 callback(entry->Key, entry->Data, userData);
296 next = entry->Next;
297 free(entry);
330 struct HashEntry *entry, *next;
331 for (entry = table->Table[pos]; entry; entry = next) {
332 /* save 'next' pointer now in case the callback deletes the entry */
333 next = entry->Next;
334 callback(entry->Key, entry->Data, userData);
342 * Return the key of the "first" entry in the hash table.
344 * the first entry of the first non-empty one.
347 * \return key for the "first" entry in the hash table.
375 const struct HashEntry *entry;
381 /* Find the entry with given key */
383 for (entry = table->Table[pos]; entry ; entry = entry->Next) {
384 if (entry->Key == key) {
389 if (!entry) {
390 /* the given key was not found, so we can't find the next entry */
394 if (entry->Next) {
396 return entry->Next->Key;
423 const struct HashEntry *entry = table->Table[pos];
424 while (entry) {
425 _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data);
426 entry = entry->Next;
492 const struct HashEntry *entry;
493 for (entry = table->Table[pos]; entry; entry = entry->Next) {