Add new json_object_array_sort function

- uses libc's qsort to sort the arraylist
 - add test in test1.c
This commit is contained in:
Frederik Deweerdt
2011-10-07 21:07:18 +02:00
parent a8ffbe97b0
commit c43871c866
6 changed files with 83 additions and 0 deletions

View File

@@ -534,6 +534,11 @@ struct array_list* json_object_get_array(struct json_object *jso)
}
}
void json_object_array_sort(struct json_object *jso, int(*sort_fn)(const void *, const void *))
{
array_list_sort(jso->o.c_array, sort_fn);
}
int json_object_array_length(struct json_object *jso)
{
return array_list_length(jso->o.c_array);