2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
16 * User class management.
33 struct list_head My_Classes[CLASS_COUNT];
38 memset(My_Classes, 0, sizeof(My_Classes));
46 for (i = 0; i < CLASS_COUNT; Lists_Free(&My_Classes[i++]));
50 Class_IsMember(const int Class, CLIENT *Client)
52 assert(Class < CLASS_COUNT);
53 assert(Client != NULL);
55 return Lists_Check(&My_Classes[Class], Client);
59 Class_AddMask(const int Class, const char *Mask, time_t ValidUntil,
62 assert(Class < CLASS_COUNT);
64 assert(Reason != NULL);
66 return Lists_Add(&My_Classes[Class], Mask, ValidUntil, Reason);
70 Class_DeleteMask(const int Class, const char *Mask)
72 assert(Class < CLASS_COUNT);
75 Lists_Del(&My_Classes[Class], Mask);
78 GLOBAL struct list_head *
79 Class_GetList(const int Class)
81 assert(Class < CLASS_COUNT);
83 return &My_Classes[Class];
89 Lists_Expire(&My_Classes[CLASS_GLINE], "G-Line");
90 Lists_Expire(&My_Classes[CLASS_KLINE], "K-Line");