mirror of
https://github.com/osmarks/ngircd.git
synced 2025-07-21 10:22:50 +00:00
Lists_CheckDupeMask(): return pointer to already existing item
The old behavior of returning true/false is compatible to this change, so there are no other code changes required.
This commit is contained in:
parent
338758799d
commit
1e4a00f94f
@ -240,17 +240,17 @@ Lists_Free(struct list_head *head)
|
|||||||
* @param Mask IRC mask to test.
|
* @param Mask IRC mask to test.
|
||||||
* @return true if mask is already stored in the list, false otherwise.
|
* @return true if mask is already stored in the list, false otherwise.
|
||||||
*/
|
*/
|
||||||
GLOBAL bool
|
GLOBAL struct list_elem *
|
||||||
Lists_CheckDupeMask(const struct list_head *h, const char *Mask )
|
Lists_CheckDupeMask(const struct list_head *h, const char *Mask )
|
||||||
{
|
{
|
||||||
struct list_elem *e;
|
struct list_elem *e;
|
||||||
e = h->first;
|
e = h->first;
|
||||||
while (e) {
|
while (e) {
|
||||||
if (strcasecmp(e->mask, Mask) == 0)
|
if (strcasecmp(e->mask, Mask) == 0)
|
||||||
return true;
|
return e;
|
||||||
e = e->next;
|
e = e->next;
|
||||||
}
|
}
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ GLOBAL struct list_elem *Lists_GetFirst PARAMS((const struct list_head *));
|
|||||||
GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *));
|
GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *));
|
||||||
|
|
||||||
GLOBAL bool Lists_Check PARAMS((struct list_head *head, CLIENT *client));
|
GLOBAL bool Lists_Check PARAMS((struct list_head *head, CLIENT *client));
|
||||||
GLOBAL bool Lists_CheckDupeMask PARAMS((const struct list_head *head,
|
GLOBAL struct list_elem *Lists_CheckDupeMask PARAMS((const struct list_head *head,
|
||||||
const char *mask));
|
const char *mask));
|
||||||
|
|
||||||
GLOBAL bool Lists_Add PARAMS((struct list_head *h, const char *Mask,
|
GLOBAL bool Lists_Add PARAMS((struct list_head *h, const char *Mask,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user