* @return true if client is listed, false if not.
*/
bool
-Lists_Check( struct list_head *h, CLIENT *Client)
+Lists_Check(struct list_head *h, CLIENT *Client)
+{
+ return Lists_CheckReason(h, Client) != NULL;
+}
+
+/**
+ * Check if a client is listed in a list and return the "reason".
+ *
+ * @param h List head.
+ * @param Client Client to check.
+ * @return true if client is listed, false if not.
+ */
+char *
+Lists_CheckReason(struct list_head *h, CLIENT *Client)
{
struct list_elem *e, *last, *next;
e->mask);
Lists_Unlink(h, last, e);
}
- return true;
+ return e->reason ? e->reason : "";
}
last = e;
e = next;
}
- return false;
+ return NULL;
}
/**
GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *));
GLOBAL bool Lists_Check PARAMS((struct list_head *head, CLIENT *client));
+GLOBAL char *Lists_CheckReason PARAMS((struct list_head *head, CLIENT *client));
GLOBAL struct list_elem *Lists_CheckDupeMask PARAMS((const struct list_head *head,
const char *mask));