aboutsummaryrefslogtreecommitdiffstats
path: root/qdict.h
AgeCommit message (Collapse)AuthorFilesLines
2010-07-01QDict: Introduce qdict_get_try_bool()Luiz Capitulino1-0/+1
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-07-01QDict: Introduce new iteration APILuiz Capitulino1-0/+2
It's composed of functions qdict_first() and qdict_next(), plus functions to access QDictEntry values. This API was suggested by Markus Armbruster <armbru@redhat.com> and it offers full control over the iteration process. The usage is simple, the following example prints all keys in 'qdict' (it's hopefully better than any English description): QDict *qdict; const QDictEntry *ent; [...] for (ent = qdict_first(qdict); ent; ent = qdict_next(qdict, ent)) { printf("%s ", qdict_entry_key(ent)); } Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-07-01QDict: Introduce functions to retrieve QDictEntry valuesLuiz Capitulino1-0/+2
Next commit will introduce a new QDict iteration API which returns QDictEntry entries, but we don't want users to directly access its members since QDictEntry should be private to QDict. In the near future this kind of data type will be turned into a forward reference. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-07-01QDict: Small terminology changeLuiz Capitulino1-2/+2
Let's call a 'hash' only what is returned by our hash function, anything else is a 'bucket'. This helps avoiding confusion with regard to how we traverse our table. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-07-01QDict: Rename 'err_value'Luiz Capitulino1-1/+1
A missing key is not an error. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-05-19Fix qtypes' licensesLuiz Capitulino1-0/+12
- Change from GPL to LGPL - Add license text when missing - Minor cosmetic changes to make all headers look the same Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-02-03QDict: New qdict_get_double()Markus Armbruster1-0/+1
Helper function just like qdict_get_int(), just for QFloat/double. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26QDict: Introduce qdict_get_qdict()Luiz Capitulino1-0/+1
A helper to retrieve a QDict from a QDict. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12QDict: Introduce qdict_get_qlist()Luiz Capitulino1-0/+2
A helper function to get a QList from a QDict. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12QDict: Introduce qdict_get_qbool()Luiz Capitulino1-0/+1
This is a helper function that does type checking before retrieving a QBool from the dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17QDict: Introduce qdict_iter()Luiz Capitulino1-0/+3
This adds iterator support to QDict, it will be used by the (to be introduced) QError module. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-12Fix sys-queue.h conflict for goodBlue Swirl1-3/+3
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-04Introduce QDictLuiz Capitulino1-0/+42
QDict is a high-level dictionary data type that can be used to store a collection of QObjects. A unique key is associated with only one QObject. The following functions are available: - qdict_new() Create a new QDict - qdict_put() Add a new 'key:object' pair - qdict_get() Get the QObject of a given key - qdict_del() Delete a 'key:object' pair - qdict_size() Return the size of the dictionary - qdict_haskey() Check if a given 'key' exists Some high-level helpers to operate on QStrings and QInts objects are also provided. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>