X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flists.h;h=db0f11a9603691f9eb64f5fcf90b638c007a0876;hp=5a9740cd31cf0759f31c406fc3d085ade68304f1;hb=b5faf3055b61afaef73ac49a448cac1a5b063127;hpb=8adff5922376676c2eeb49de1cbab86cc345b887 diff --git a/src/ngircd/lists.h b/src/ngircd/lists.h index 5a9740cd..db0f11a9 100644 --- a/src/ngircd/lists.h +++ b/src/ngircd/lists.h @@ -1,46 +1,54 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * $Id: lists.h,v 1.12 2005/03/19 18:43:49 fw Exp $ - * - * Management of IRC lists: ban, invite, ... (header) */ - #ifndef __lists_h__ #define __lists_h__ +/** + * @file + * Management of IRC lists (header) + */ + +#include "portab.h" +#include "client.h" -GLOBAL void Lists_Init PARAMS(( void )); -GLOBAL void Lists_Exit PARAMS(( void )); +struct list_elem; -GLOBAL bool Lists_CheckInvited PARAMS(( CLIENT *Client, CHANNEL *Chan )); -GLOBAL bool Lists_AddInvited PARAMS(( char *Mask, CHANNEL *Chan, bool OnlyOnce )); -GLOBAL void Lists_DelInvited PARAMS(( char *Mask, CHANNEL *Chan )); -GLOBAL bool Lists_ShowInvites PARAMS(( CLIENT *Client, CHANNEL *Channel )); -GLOBAL bool Lists_SendInvites PARAMS(( CLIENT *Client )); -GLOBAL bool Lists_IsInviteEntry PARAMS(( char *Mask, CHANNEL *Chan )); +struct list_head { + struct list_elem *first; +}; -GLOBAL bool Lists_CheckBanned PARAMS(( CLIENT *Client, CHANNEL *Chan )); -GLOBAL bool Lists_AddBanned PARAMS(( char *Mask, CHANNEL *Chan )); -GLOBAL void Lists_DelBanned PARAMS(( char *Mask, CHANNEL *Chan )); -GLOBAL bool Lists_ShowBans PARAMS(( CLIENT *Client, CHANNEL *Channel )); -GLOBAL bool Lists_SendBans PARAMS(( CLIENT *Client )); -GLOBAL bool Lists_IsBanEntry PARAMS(( char *Mask, CHANNEL *Chan )); +GLOBAL struct list_elem *Lists_GetFirst PARAMS((const struct list_head *)); +GLOBAL struct list_elem *Lists_GetNext PARAMS((const struct list_elem *)); -GLOBAL void Lists_DeleteChannel PARAMS(( CHANNEL *Chan )); +GLOBAL bool Lists_Check PARAMS((struct list_head *head, CLIENT *client)); +GLOBAL bool Lists_CheckReason PARAMS((struct list_head *head, CLIENT *client, + char *reason, size_t len)); +GLOBAL struct list_elem *Lists_CheckDupeMask PARAMS((const struct list_head *head, + const char *mask)); -GLOBAL char *Lists_MakeMask PARAMS(( char *Pattern )); +GLOBAL bool Lists_Add PARAMS((struct list_head *h, const char *Mask, + time_t ValidUntil, const char *Reason)); +GLOBAL void Lists_Del PARAMS((struct list_head *head, const char *Mask)); +GLOBAL unsigned long Lists_Count PARAMS((struct list_head *h)); +GLOBAL void Lists_Free PARAMS((struct list_head *head)); -#endif +GLOBAL void Lists_MakeMask PARAMS((const char *Pattern, char *mask, size_t len)); +GLOBAL const char *Lists_GetMask PARAMS((const struct list_elem *e)); +GLOBAL const char *Lists_GetReason PARAMS((const struct list_elem *e)); +GLOBAL time_t Lists_GetValidity PARAMS((const struct list_elem *e)); +GLOBAL void Lists_Expire PARAMS((struct list_head *h, const char *ListName)); + +#endif /* -eof- */