+/**
+ * Free a complete list.
+ *
+ * @param head List head.
+ */
+GLOBAL void
+Lists_Free(struct list_head *head)
+{
+ struct list_elem *e, *victim;
+
+ assert(head != NULL);
+
+ e = head->first;
+ head->first = NULL;
+ while (e) {
+ LogDebug("Deleted \"%s\" from list" , e->mask);
+ victim = e;
+ e = e->next;
+ if (victim->reason)
+ free(victim->reason);
+ free(victim);
+ }
+}
+
+/**
+ * Check if an IRC mask is already contained in a list.
+ *
+ * @param h List head.
+ * @param Mask IRC mask to test.
+ * @return true if mask is already stored in the list, false otherwise.
+ */
+GLOBAL struct list_elem *
+Lists_CheckDupeMask(const struct list_head *h, const char *Mask )
+{
+ struct list_elem *e;
+ e = h->first;
+ while (e) {
+ if (strcasecmp(e->mask, Mask) == 0)
+ return e;
+ e = e->next;
+ }
+ return NULL;
+}