-
-/*
- * find_userhost - find a user@host (server or user).
- * inputs - user name to look for
- * - host name to look for
- * - pointer to count of number of matches found
- * outputs - pointer to client if found
- * - count is updated
- * side effects - none
- *
- */
-static struct Client *
-find_userhost(const char *user, const char *host, int *count)
-{
- struct Client *c2ptr;
- struct Client *res = NULL;
- char *u = LOCAL_COPY(user);
- rb_dlink_node *ptr;
- *count = 0;
- if(collapse(u) != NULL)
- {
- RB_DLINK_FOREACH(ptr, global_client_list.head)
- {
- c2ptr = ptr->data;
- if(!MyClient(c2ptr)) /* implies mine and an user */
- continue;
- if((!host || match(host, c2ptr->host)) && irccmp(u, c2ptr->username) == 0)
- {
- (*count)++;
- res = c2ptr;
- }
- }
- }
- return (res);
-}