Add DohSortedKeys function
Returns a list of sorted keys in a DOH Hash.
This commit is contained in:
parent
216b47320b
commit
77b08daca7
4 changed files with 29 additions and 26 deletions
|
|
@ -374,6 +374,18 @@ DOH *DohKeys(DOH *obj) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohSortedKeys()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
DOH *DohSortedKeys(DOH *obj, int (*cmp) (const DOH *, const DOH *)) {
|
||||
DOHList *keys = DohKeys(obj);
|
||||
if (keys) {
|
||||
DohSortList(keys, cmp);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohGetInt()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue