Lines Matching refs:entry
76 QDictEntry *entry;
78 entry = qemu_mallocz(sizeof(*entry));
79 entry->key = qemu_strdup(key);
80 entry->value = value;
82 return entry;
86 * qdict_entry_value(): Return qdict entry value
90 QObject *qdict_entry_value(const QDictEntry *entry)
92 return entry->value;
96 * qdict_entry_key(): Return qdict entry key
101 const char *qdict_entry_key(const QDictEntry *entry)
103 return entry->key;
112 QDictEntry *entry;
114 QLIST_FOREACH(entry, &qdict->table[bucket], next)
115 if (!strcmp(entry->key, key))
116 return entry;
128 * storing the new one in the same entry.
135 QDictEntry *entry;
138 entry = qdict_find(qdict, key, bucket);
139 if (entry) {
141 qobject_decref(entry->value);
142 entry->value = value;
144 /* allocate a new entry */
145 entry = alloc_entry(key, value);
146 QLIST_INSERT_HEAD(&qdict->table[bucket], entry, next);
159 QDictEntry *entry;
161 entry = qdict_find(qdict, key, tdb_hash(key) % QDICT_BUCKET_MAX);
162 return (entry == NULL ? NULL : entry->value);
358 QDictEntry *entry;
361 QLIST_FOREACH(entry, &qdict->table[i], next)
362 iter(entry->key, entry->value, opaque);
380 * qdict_first(): Return first qdict entry for iteration.
388 * qdict_next(): Return next qdict entry in an iteration.
390 const QDictEntry *qdict_next(const QDict *qdict, const QDictEntry *entry)
394 ret = QLIST_NEXT(entry, next);
396 unsigned int bucket = tdb_hash(entry->key) % QDICT_BUCKET_MAX;
420 * This will destroy all data allocated by this entry.
424 QDictEntry *entry;
426 entry = qdict_find(qdict, key, tdb_hash(key) % QDICT_BUCKET_MAX);
427 if (entry) {
428 QLIST_REMOVE(entry, next);
429 qentry_destroy(entry);
446 QDictEntry *entry = QLIST_FIRST(&qdict->table[i]);
447 while (entry) {
448 QDictEntry *tmp = QLIST_NEXT(entry, next);
449 QLIST_REMOVE(entry, next);
450 qentry_destroy(entry);
451 entry = tmp;