pike.git / src / hashtable.c

version» Context lines:

pike.git/src/hashtable.c:3:   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      #include "global.h"   #include "hashtable.h"   #include "stralloc.h"   #include "stuff.h"   #include "pike_error.h"    - static size_t gobble(struct pike_string *s) + static size_t gobble(const struct pike_string *s)   {    size_t i;    i=my_hash_string(s);    i+=i >> 3;    i+=i >> 7;    i+=i >> 12;    return i;   }      /*    * Search hash for a specific string.    */ - struct hash_entry *hash_lookup(struct hash_table *h, struct pike_string *s) + struct hash_entry *hash_lookup(const struct hash_table *h, +  const struct pike_string *s)   {    struct hash_entry *e, **prev, **base;       if(!h) return 0;    base = prev = h->htable + (gobble(s) & h->mask);    for( ;(e = *prev); prev= &e->next)    {    if(s == e->s)    {    /* Teleport entry to beginning of line */