ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/whowas.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/whowas.c (file contents):
Revision 7442 by michael, Thu Mar 10 20:27:23 2016 UTC vs.
Revision 7449 by michael, Fri Mar 11 17:22:15 2016 UTC

# Line 39 | Line 39
39   static mp_pool_t *whowas_pool;
40  
41   static dlink_list whowas_list;  /*! Chain of struct Whowas pointers */
42 < dlink_list WHOWASHASH[HASHSIZE];
42 > static dlink_list whowas_hash[HASHSIZE];
43  
44  
45   /*! \brief Initializes the whowas memory pool.
# Line 50 | Line 50 | whowas_init(void)
50    whowas_pool = mp_pool_new(sizeof(struct Whowas), MP_CHUNK_SIZE_WHOWAS);
51   }
52  
53 + /*! \brief Returns a slot of the whowas_hash by the hash value associated with it.
54 + * \param hashv Hash value.
55 + */
56 + const dlink_list *
57 + whowas_get_hash(unsigned int hashv)
58 + {
59 +  if (hashv >= HASHSIZE)
60 +    return NULL;
61 +
62 +  return &whowas_hash[hashv];
63 + }
64 +
65   /*! \brief Unlinks a Whowas struct from its associated lists.
66   * \param whowas Pointer to Whowas struct to be unlinked.
67   */
# Line 62 | Line 74 | whowas_unlink(struct Whowas *whowas)
74    if (whowas->online)
75      dlinkDelete(&whowas->cnode, &whowas->online->whowas);
76  
77 <  dlinkDelete(&whowas->tnode, &WHOWASHASH[whowas->hashv]);
77 >  dlinkDelete(&whowas->hnode, &whowas_hash[whowas->hashv]);
78    dlinkDelete(&whowas->lnode, &whowas_list);
79  
80    return whowas;
# Line 148 | Line 160 | whowas_add_history(struct Client *client
160    else
161      whowas->online = NULL;
162  
163 <  dlinkAdd(whowas, &whowas->tnode, &WHOWASHASH[whowas->hashv]);
163 >  dlinkAdd(whowas, &whowas->hnode, &whowas_hash[whowas->hashv]);
164    dlinkAdd(whowas, &whowas->lnode, &whowas_list);
165   }
166  
# Line 182 | Line 194 | whowas_get_history(const char *name, uin
194  
195    timelimit = CurrentTime - timelimit;
196  
197 <  DLINK_FOREACH(node, WHOWASHASH[strhash(name)].head)
197 >  DLINK_FOREACH(node, whowas_hash[strhash(name)].head)
198    {
199      struct Whowas *whowas = node->data;
200  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)