~ubuntu-branches/ubuntu/oneiric/jabberd2/oneiric-security

« back to all changes in this revision

Viewing changes to util/xhash.c

  • Committer: Bazaar Package Importer
  • Author(s): Nicolai Spohrer
  • Date: 2008-08-12 16:13:43 UTC
  • mfrom: (1.1.3 upstream) (0.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20080812161343-6trz3r97dtevxd17
Tags: 2.2.1-1ubuntu1
* Merge with Debian unstable (LP: #257130), remaining changes:
  - debian/control:
    + Modify Maintainer field as per spec
    + Depend on libdb4.6-dev instead of libdb4.4-dev
    + Added Conflicts and Replaces: ..., jabber for jabberd2
  - debian/rules: Added libtoolize call (jabberd2 ships with
     an older ltmain.sh version that conflicts with the
     current libtool version)
  - debian/init: create /var/run/jabber directory with correct
     permissions
* Dropped changes:
  - Debian already depends on libpq-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
19
19
 */
20
20
 
 
21
#include "xhash.h"
21
22
#include "util.h"
22
23
 
23
24
 
25
26
 * This function uses the ELF hashing algorithm as reprinted in 
26
27
 * Andrew Binstock, "Hashing Rehashed," Dr. Dobb's Journal, April 1996.
27
28
 */
28
 
int _xhasher(const char *s, int len)
 
29
static int _xhasher(const char *s, int len)
29
30
{
30
31
    /* ELF hash uses unsigned chars and unsigned arithmetic for portability */
31
32
    const unsigned char *name = (const unsigned char *)s;
45
46
}
46
47
 
47
48
 
48
 
xhn _xhash_node_new(xht h, int index)
 
49
static xhn _xhash_node_new(xht h, int index)
49
50
{
50
51
    xhn n;
51
52
    int i = index % h->prime;
66
67
}
67
68
 
68
69
 
69
 
xhn _xhash_node_get(xht h, const char *key, int len, int index)
 
70
static xhn _xhash_node_get(xht h, const char *key, int len, int index)
70
71
{
71
72
    xhn n;
72
73
    int i = index % h->prime;
80
81
xht xhash_new(int prime)
81
82
{
82
83
    xht xnew;
83
 
    pool p;
 
84
    pool_t p;
84
85
 
85
86
/*    log_debug(ZONE,"creating new hash table of size %d",prime); */
86
87
 
229
230
}
230
231
 
231
232
/** get our pool */
232
 
pool xhash_pool(xht h)
 
233
pool_t xhash_pool(xht h)
233
234
{
234
235
    return h->p;
235
236
}