Lines Matching refs:Key
8 * \note key=0 is illegal.
53 GLuint Key; /**< the entry's key */
64 GLuint MaxKey; /**< highest key inserted so far */
127 _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
133 assert(key);
135 pos = HASH_FUNC(key);
138 if (entry->Key == key) {
151 * \param key the key.
153 * \return pointer to user's data or NULL if key not in table
156 _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
161 res = _mesa_HashLookup_unlocked(table, key);
168 * Insert a key/pointer pair into the hash table.
169 * If an entry with this key already exists we'll replace the existing entry.
172 * \param key the key (not zero).
176 _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
178 /* search for existing entry with this key */
183 assert(key);
187 if (key > table->MaxKey)
188 table->MaxKey = key;
190 pos = HASH_FUNC(key);
192 /* check if replacing an existing entry with same key */
194 if (entry->Key == key) {
210 entry->Key = key;
225 * \param key key of entry to remove.
228 * key and unlinks it.
231 _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
237 assert(key);
248 pos = HASH_FUNC(key);
252 if (entry->Key == key) {
284 void (*callback)(GLuint key, void *data, void *userData),
295 callback(entry->Key, entry->Data, userData);
320 void (*callback)(GLuint key, void *data, void *userData),
334 callback(entry->Key, entry->Data, userData);
342 * Return the key of the "first" entry in the hash table.
347 * \return key for the "first" entry in the hash table.
358 return table->Table[pos]->Key;
367 * Given a hash table key, return the next key. This is used to walk
370 * \return next hash key or 0 if end of table.
373 _mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key)
379 assert(key);
381 /* Find the entry with given key */
382 pos = HASH_FUNC(key);
384 if (entry->Key == key) {
390 /* the given key was not found, so we can't find the next entry */
396 return entry->Next->Key;
403 return table->Table[pos]->Key;
425 _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data);
439 * \return Starting key of free block or 0 if failure.
441 * If there are enough free keys between the maximum key existing in the table
442 * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return
443 * the adjacent key. Otherwise do a full search for a free key block in the
444 * allowable key range.
460 GLuint key;
461 for (key = 1; key != maxKey; key++) {
462 if (_mesa_HashLookup_unlocked(table, key)) {
463 /* darn, this key is already in use */
465 freeStart = key+1;
468 /* this key not in use, check if we've found enough */