Lines Matching refs:qdict
36 QDict *qdict; in qdict_new() local
38 qdict = g_malloc0(sizeof(*qdict)); in qdict_new()
39 QOBJECT_INIT(qdict, &qdict_type); in qdict_new()
41 return qdict; in qdict_new()
109 static QDictEntry *qdict_find(const QDict *qdict, in qdict_find() argument
114 QLIST_FOREACH(entry, &qdict->table[bucket], next) in qdict_find()
132 void qdict_put_obj(QDict *qdict, const char *key, QObject *value) in qdict_put_obj() argument
138 entry = qdict_find(qdict, key, bucket); in qdict_put_obj()
146 QLIST_INSERT_HEAD(&qdict->table[bucket], entry, next); in qdict_put_obj()
147 qdict->size++; in qdict_put_obj()
157 QObject *qdict_get(const QDict *qdict, const char *key) in qdict_get() argument
161 entry = qdict_find(qdict, key, tdb_hash(key) % QDICT_BUCKET_MAX); in qdict_get()
170 int qdict_haskey(const QDict *qdict, const char *key) in qdict_haskey() argument
173 return (qdict_find(qdict, key, bucket) == NULL ? 0 : 1); in qdict_haskey()
179 size_t qdict_size(const QDict *qdict) in qdict_size() argument
181 return qdict->size; in qdict_size()
187 static QObject *qdict_get_obj(const QDict *qdict, const char *key, in qdict_get_obj() argument
192 obj = qdict_get(qdict, key); in qdict_get_obj()
207 double qdict_get_double(const QDict *qdict, const char *key) in qdict_get_double() argument
209 QObject *obj = qdict_get(qdict, key); in qdict_get_double()
230 int64_t qdict_get_int(const QDict *qdict, const char *key) in qdict_get_int() argument
232 QObject *obj = qdict_get_obj(qdict, key, QTYPE_QINT); in qdict_get_int()
244 int qdict_get_bool(const QDict *qdict, const char *key) in qdict_get_bool() argument
246 QObject *obj = qdict_get_obj(qdict, key, QTYPE_QBOOL); in qdict_get_bool()
258 QList *qdict_get_qlist(const QDict *qdict, const char *key) in qdict_get_qlist() argument
260 return qobject_to_qlist(qdict_get_obj(qdict, key, QTYPE_QLIST)); in qdict_get_qlist()
271 QDict *qdict_get_qdict(const QDict *qdict, const char *key) in qdict_get_qdict() argument
273 return qobject_to_qdict(qdict_get_obj(qdict, key, QTYPE_QDICT)); in qdict_get_qdict()
285 const char *qdict_get_str(const QDict *qdict, const char *key) in qdict_get_str() argument
287 QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING); in qdict_get_str()
298 int64_t qdict_get_try_int(const QDict *qdict, const char *key, in qdict_get_try_int() argument
303 obj = qdict_get(qdict, key); in qdict_get_try_int()
317 int qdict_get_try_bool(const QDict *qdict, const char *key, int def_value) in qdict_get_try_bool() argument
321 obj = qdict_get(qdict, key); in qdict_get_try_bool()
336 const char *qdict_get_try_str(const QDict *qdict, const char *key) in qdict_get_try_str() argument
340 obj = qdict_get(qdict, key); in qdict_get_try_str()
353 void qdict_iter(const QDict *qdict, in qdict_iter() argument
361 QLIST_FOREACH(entry, &qdict->table[i], next) in qdict_iter()
366 static QDictEntry *qdict_next_entry(const QDict *qdict, int first_bucket) in qdict_next_entry() argument
371 if (!QLIST_EMPTY(&qdict->table[i])) { in qdict_next_entry()
372 return QLIST_FIRST(&qdict->table[i]); in qdict_next_entry()
382 const QDictEntry *qdict_first(const QDict *qdict) in qdict_first() argument
384 return qdict_next_entry(qdict, 0); in qdict_first()
390 const QDictEntry *qdict_next(const QDict *qdict, const QDictEntry *entry) in qdict_next() argument
397 ret = qdict_next_entry(qdict, bucket + 1); in qdict_next()
444 void qdict_del(QDict *qdict, const char *key) in qdict_del() argument
448 entry = qdict_find(qdict, key, tdb_hash(key) % QDICT_BUCKET_MAX); in qdict_del()
452 qdict->size--; in qdict_del()
462 QDict *qdict; in qdict_destroy_obj() local
465 qdict = qobject_to_qdict(obj); in qdict_destroy_obj()
468 QDictEntry *entry = QLIST_FIRST(&qdict->table[i]); in qdict_destroy_obj()
477 g_free(qdict); in qdict_destroy_obj()
480 static void qdict_do_flatten(QDict *qdict, QDict *target, const char *prefix) in qdict_do_flatten() argument
487 entry = qdict_first(qdict); in qdict_do_flatten()
491 next = qdict_next(qdict, entry); in qdict_do_flatten()
516 qdict_del(qdict, entry->key); in qdict_do_flatten()
519 entry = qdict_first(qdict); in qdict_do_flatten()
532 void qdict_flatten(QDict *qdict) in qdict_flatten() argument
534 qdict_do_flatten(qdict, qdict, NULL); in qdict_flatten()