apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyrum K. Wright" <hyrum_wri...@mail.utexas.edu>
Subject Re: [PATCH] apr_hash_this_{key,klen,val}
Date Tue, 09 Mar 2010 21:45:06 GMT

On Mar 9, 2010, at 2:42 PM, Bojan Smojver wrote:

> On Tue, 2010-03-09 at 12:48 -0500, Jeff Trawick wrote:
>> IMO these functions are a natural addition; any concerns from the
>> crowd?
> Didn't SVN folks also have some hash sorting functions we could "borrow"
> as well? May as well get those, while we're at it :-)

Gladly.  The API looks something like:

svn_sort__hash(apr_hash_t *ht,
               int (*comparison_func)(const svn_sort__item_t *,
                                      cosnt svn_sort__item_t *),
               apr_pool_t *pool);

Where a svn_sort__item_t is simply the key/klen/val tuple.  I'm sure these could be easily
re-worked into APR variants (there is even a large "(Should this be a permanent part of APR?)"
comment at the top of this set of code. :)

We also have a couple of hash- and array-based iteration functions which might be handy. 
I can post those if there is interest.

View raw message