ngircd-tor/src/ngircd/channel.h

129 lines
4.7 KiB
C
Raw Normal View History

2001-12-14 09:13:43 +01:00
/*
* ngIRCd -- The Next Generation IRC Daemon
2002-01-02 03:42:58 +01:00
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
2001-12-14 09:13:43 +01:00
*
2002-12-12 13:23:43 +01:00
* 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.
2001-12-14 09:13:43 +01:00
*
* $Id: channel.h,v 1.35 2008/02/05 16:31:35 fw Exp $
2001-12-14 09:13:43 +01:00
*
2002-12-12 13:23:43 +01:00
* Channel management (header)
2001-12-14 09:13:43 +01:00
*/
#ifndef __channel_h__
#define __channel_h__
#if defined(__channel_c__) | defined(S_SPLINT_S)
#include "lists.h"
#include "defines.h"
#include "array.h"
typedef struct _CHANNEL
{
struct _CHANNEL *next;
char name[CHANNEL_NAME_LEN]; /* Name of the channel */
UINT32 hash; /* Hash of the (lowecase!) name */
char modes[CHANNEL_MODE_LEN]; /* Channel modes */
array topic; /* Topic of the channel */
#ifndef STRICT_RFC
time_t topic_time; /* Time when topic was set */
char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */
#endif
char key[CLIENT_PASS_LEN]; /* Channel key ("password", mode "k" ) */
2006-10-06 23:32:58 +02:00
unsigned long maxusers; /* Maximum number of members (mode "l") */
struct list_head list_bans; /* list head of banned users */
struct list_head list_invites; /* list head of invited users */
} CHANNEL;
typedef struct _CLIENT2CHAN
{
struct _CLIENT2CHAN *next;
CLIENT *client;
CHANNEL *channel;
char modes[CHANNEL_MODE_LEN]; /* User-Modes in dem Channel */
} CL2CHAN;
#else
typedef POINTER CHANNEL;
typedef POINTER CL2CHAN;
#endif
GLOBAL struct list_head *Channel_GetListBans PARAMS((CHANNEL *c));
GLOBAL struct list_head *Channel_GetListInvites PARAMS((CHANNEL *c));
GLOBAL void Channel_Init PARAMS(( void ));
GLOBAL void Channel_InitPredefined PARAMS(( void ));
GLOBAL void Channel_Exit PARAMS(( void ));
2001-12-14 09:13:43 +01:00
GLOBAL bool Channel_Join PARAMS(( CLIENT *Client, char *Name ));
GLOBAL bool Channel_Part PARAMS(( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason ));
GLOBAL void Channel_Quit PARAMS(( CLIENT *Client, char *Reason ));
GLOBAL void Channel_Kick PARAMS(( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason ));
2006-10-06 23:32:58 +02:00
GLOBAL unsigned long Channel_Count PARAMS(( void ));
GLOBAL unsigned long Channel_MemberCount PARAMS(( CHANNEL *Chan ));
GLOBAL int Channel_CountForUser PARAMS(( CLIENT *Client ));
2002-01-16 23:09:07 +01:00
2006-10-06 23:32:58 +02:00
GLOBAL const char *Channel_Name PARAMS(( const CHANNEL *Chan ));
GLOBAL char *Channel_Modes PARAMS(( CHANNEL *Chan ));
GLOBAL char *Channel_Topic PARAMS(( CHANNEL *Chan ));
GLOBAL char *Channel_Key PARAMS(( CHANNEL *Chan ));
2006-10-06 23:32:58 +02:00
GLOBAL unsigned long Channel_MaxUsers PARAMS(( CHANNEL *Chan ));
GLOBAL void Channel_SetTopic PARAMS(( CHANNEL *Chan, CLIENT *Client, char *Topic ));
GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, char *Modes ));
GLOBAL void Channel_SetKey PARAMS(( CHANNEL *Chan, char *Key ));
2006-10-06 23:32:58 +02:00
GLOBAL void Channel_SetMaxUsers PARAMS(( CHANNEL *Chan, unsigned long Count ));
GLOBAL CHANNEL *Channel_Search PARAMS(( const char *Name ));
GLOBAL CHANNEL *Channel_First PARAMS(( void ));
2002-12-13 18:22:57 +01:00
GLOBAL CHANNEL *Channel_Next PARAMS(( CHANNEL *Chan ));
2002-12-13 18:22:57 +01:00
GLOBAL CL2CHAN *Channel_FirstMember PARAMS(( CHANNEL *Chan ));
GLOBAL CL2CHAN *Channel_NextMember PARAMS(( CHANNEL *Chan, CL2CHAN *Cl2Chan ));
GLOBAL CL2CHAN *Channel_FirstChannelOf PARAMS(( CLIENT *Client ));
GLOBAL CL2CHAN *Channel_NextChannelOf PARAMS(( CLIENT *Client, CL2CHAN *Cl2Chan ));
2002-12-13 18:22:57 +01:00
GLOBAL CLIENT *Channel_GetClient PARAMS(( CL2CHAN *Cl2Chan ));
GLOBAL CHANNEL *Channel_GetChannel PARAMS(( CL2CHAN *Cl2Chan ));
GLOBAL bool Channel_IsValidName PARAMS(( const char *Name ));
GLOBAL bool Channel_ModeAdd PARAMS(( CHANNEL *Chan, char Mode ));
GLOBAL bool Channel_ModeDel PARAMS(( CHANNEL *Chan, char Mode ));
GLOBAL bool Channel_UserModeAdd PARAMS(( CHANNEL *Chan, CLIENT *Client, char Mode ));
GLOBAL bool Channel_UserModeDel PARAMS(( CHANNEL *Chan, CLIENT *Client, char Mode ));
GLOBAL char *Channel_UserModes PARAMS(( CHANNEL *Chan, CLIENT *Client ));
GLOBAL bool Channel_IsMemberOf PARAMS(( CHANNEL *Chan, CLIENT *Client ));
GLOBAL bool Channel_Write PARAMS(( CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Text ));
GLOBAL bool Channel_Notice PARAMS(( CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Text));
GLOBAL CHANNEL *Channel_Create PARAMS(( char *Name ));
#ifndef STRICT_RFC
GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan ));
GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan ));
#endif
GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce ));
GLOBAL bool Channel_AddBan PARAMS((CHANNEL *c, const char *Mask ));
2001-12-14 09:13:43 +01:00
GLOBAL bool Channel_ShowBans PARAMS((CLIENT *client, CHANNEL *c));
GLOBAL bool Channel_ShowInvites PARAMS((CLIENT *client, CHANNEL *c));
2001-12-14 09:13:43 +01:00
#endif
/* -eof- */