summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/hash.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-11 19:01:31 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-11 19:01:31 +0000
commit0b9e388f7f10dac01d5134ed6c1b24695810874e (patch)
treef01b4f05e8d074a8dba14a96b93803fd6797c105 /pjlib/src/pj/hash.c
parent0bc0f9112ac6319d7ce8662de86d6c076bd4b1e3 (diff)
First clean compile of pjsip
git-svn-id: http://svn.pjsip.org/repos/pjproject/main@43 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/hash.c')
-rw-r--r--pjlib/src/pj/hash.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c
index 0fa95e1b..195c8817 100644
--- a/pjlib/src/pj/hash.c
+++ b/pjlib/src/pj/hash.c
@@ -50,6 +50,20 @@ PJ_DEF(pj_uint32_t) pj_hash_calc(pj_uint32_t hash, const void *key, unsigned key
}
return hash;
}
+
+PJ_DEF(pj_uint32_t) pj_hash_calc_tolower( pj_uint32_t hval,
+ char *result,
+ const pj_str_t *key)
+{
+ long i;
+
+ for (i=0; i<key->slen; ++i) {
+ result[i] = (char)pj_tolower(key->ptr[i]);
+ hval = hval * PJ_HASH_MULTIPLIER + result[i];
+ }
+
+ return hval;
+}
PJ_DEF(pj_hash_table_t*) pj_hash_create(pj_pool_t *pool, unsigned size)