[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: subversion/subversion/libsvn_wc wc.h

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2000-10-13 20:07:44 CEST

Jim Blandy <jimb@savonarola.red-bean.com> writes:
> To be fair --- apr hash tables *do* support empty keys. You just need
> to check for them every time you get/set hash table entries.

Actually, now that I look more carefully, I don't think we need to do
anything special at all. The only weirdness is that APR, internally,
will interpret the 0 length as meaning it should do a strlen on the
key. But that's fine -- strlen on the empty string will be 0, APR
will add 1, and it will have a key consisting of the null byte. That
works.

/**
 * Associate a value with a key in a hash table.
 * @param ht The hash table
 * @param key Pointer to the key
 * @param klen Length of the key
 * If the length is 0 it is assumed to be strlen(key)+1
 * @param val Value to associate with the key
 * @tip If the value is NULL the hash entry is deleted.
 * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val)
 */
APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key,
                              apr_size_t klen, const void *val);
Received on Sat Oct 21 14:36:11 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.