/** * kline.h: Data structures for account information. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005-2006 Atheme Development Group * Rights to this code are as documented in doc/pod/license.pod. * * $Id: kline.h,v 1.6 2007/09/22 14:27:26 pippijn Exp $ */ #ifndef ACCOUNT_KLINE_H #define ACCOUNT_KLINE_H #include #include /* kline list struct */ struct kline_t : object, zero_initialised { unsigned index; char *user; char *host; char *reason; char *setby; unsigned int number; long duration; time_t settime; time_t expires; static kline_t *create (char const * const user, char const * const host, char const * const reason, long duration); static void destroy (char const * const user, char const * const host); static kline_t *find (char const * const user, char const * const host); static kline_t *find (unsigned int number); static kline_t *find (user_t *u); static void expire (void *arg); /* node.c */ typedef indexing_vector list_type; static list_type list; void destroy () { list.erase (this); refcnt_dec (); cnt.kline--; } private: virtual void _destroy () { sfree (user); sfree (host); sfree (reason); sfree (setby); delete this; } }; #endif