commit - be7683c79b143221538b866bb08eadd37ec6b254
commit + c2f60abe55b5a8d320a27df0ce41790fa1141081
blob - c4231dc9ebf70cb31840cde0b87adb82357e1452
blob + 54acdcfa3957234bb13a19896b3cb360963d3cf4
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: channel.c,v 1.22 2002/05/21 00:10:16 alex Exp $
+ * $Id: channel.c,v 1.23 2002/05/27 13:09:26 alex Exp $
*
* channel.c: Management der Channels
*/
#include <stdlib.h>
#include <string.h>
+#include "conn.h"
#include "client.h"
+
+#include "exp.h"
+#include "channel.h"
+
+#include "imp.h"
+#include "irc-write.h"
+#include "resolve.h"
#include "conf.h"
#include "hash.h"
-#include "irc-write.h"
#include "log.h"
#include "messages.h"
#include "exp.h"
-#include "channel.h"
LOCAL CHANNEL *My_Channels;
LOCAL CL2CHAN *My_Cl2Chan;
-LOCAL CHANNEL *New_Chan( CHAR *Name );
-LOCAL CL2CHAN *Get_Cl2Chan( CHANNEL *Chan, CLIENT *Client );
-LOCAL CL2CHAN *Add_Client( CHANNEL *Chan, CLIENT *Client );
-LOCAL BOOLEAN Remove_Client( CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, CHAR *Reason, BOOLEAN ServerPART );
-LOCAL CL2CHAN *Get_First_Cl2Chan( CLIENT *Client, CHANNEL *Chan );
-LOCAL CL2CHAN *Get_Next_Cl2Chan( CL2CHAN *Start, CLIENT *Client, CHANNEL *Chan );
-LOCAL BOOLEAN Delete_Channel( CHANNEL *Chan );
+LOCAL CHANNEL *New_Chan PARAMS(( CHAR *Name ));
+LOCAL CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client ));
+LOCAL CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client ));
+LOCAL BOOLEAN Remove_Client PARAMS(( CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, CHAR *Reason, BOOLEAN ServerPART ));
+LOCAL CL2CHAN *Get_First_Cl2Chan PARAMS(( CLIENT *Client, CHANNEL *Chan ));
+LOCAL CL2CHAN *Get_Next_Cl2Chan PARAMS(( CL2CHAN *Start, CLIENT *Client, CHANNEL *Chan ));
+LOCAL BOOLEAN Delete_Channel PARAMS(( CHANNEL *Chan ));
-GLOBAL VOID Channel_Init( VOID )
+GLOBAL VOID
+Channel_Init( VOID )
{
CHANNEL *chan;
CHAR *c;
} /* Channel_Init */
-GLOBAL VOID Channel_Exit( VOID )
+GLOBAL VOID
+Channel_Exit( VOID )
{
CHANNEL *c, *c_next;
CL2CHAN *cl2chan, *cl2chan_next;
} /* Channel_Exit */
-GLOBAL BOOLEAN Channel_Join( CLIENT *Client, CHAR *Name )
+GLOBAL BOOLEAN
+Channel_Join( CLIENT *Client, CHAR *Name )
{
CHANNEL *chan;
} /* Channel_Join */
-GLOBAL BOOLEAN Channel_Part( CLIENT *Client, CLIENT *Origin, CHAR *Name, CHAR *Reason )
+GLOBAL BOOLEAN
+Channel_Part( CLIENT *Client, CLIENT *Origin, CHAR *Name, CHAR *Reason )
{
CHANNEL *chan;
} /* Channel_Part */
-GLOBAL VOID Channel_RemoveClient( CLIENT *Client, CHAR *Reason )
+GLOBAL VOID
+Channel_RemoveClient( CLIENT *Client, CHAR *Reason )
{
CHANNEL *c, *next_c;
} /* Channel_RemoveClient */
-GLOBAL INT Channel_Count( VOID )
+GLOBAL INT
+Channel_Count( VOID )
{
CHANNEL *c;
INT count;
} /* Channel_Count */
-GLOBAL INT Channel_MemberCount( CHANNEL *Chan )
+GLOBAL INT
+Channel_MemberCount( CHANNEL *Chan )
{
CL2CHAN *cl2chan;
INT count;
} /* Channel_MemberCount */
-GLOBAL CHAR *Channel_Name( CHANNEL *Chan )
+GLOBAL CHAR *
+Channel_Name( CHANNEL *Chan )
{
assert( Chan != NULL );
return Chan->name;
} /* Channel_Name */
-GLOBAL CHAR *Channel_Modes( CHANNEL *Chan )
+GLOBAL CHAR *
+Channel_Modes( CHANNEL *Chan )
{
assert( Chan != NULL );
return Chan->modes;
} /* Channel_Modes */
-GLOBAL CHANNEL *Channel_First( VOID )
+GLOBAL CHANNEL *
+Channel_First( VOID )
{
return My_Channels;
} /* Channel_First */
-GLOBAL CHANNEL *Channel_Next( CHANNEL *Chan )
+GLOBAL CHANNEL *
+Channel_Next( CHANNEL *Chan )
{
assert( Chan != NULL );
return Chan->next;
} /* Channel_Next */
-GLOBAL CHANNEL *Channel_Search( CHAR *Name )
+GLOBAL CHANNEL *
+Channel_Search( CHAR *Name )
{
/* Channel-Struktur suchen */
} /* Channel_Search */
-GLOBAL CL2CHAN *Channel_FirstMember( CHANNEL *Chan )
+GLOBAL CL2CHAN *
+Channel_FirstMember( CHANNEL *Chan )
{
assert( Chan != NULL );
return Get_First_Cl2Chan( NULL, Chan );
} /* Channel_FirstMember */
-GLOBAL CL2CHAN *Channel_NextMember( CHANNEL *Chan, CL2CHAN *Cl2Chan )
+GLOBAL CL2CHAN *
+Channel_NextMember( CHANNEL *Chan, CL2CHAN *Cl2Chan )
{
assert( Chan != NULL );
assert( Cl2Chan != NULL );
} /* Channel_NextMember */
-GLOBAL CL2CHAN *Channel_FirstChannelOf( CLIENT *Client )
+GLOBAL CL2CHAN *
+Channel_FirstChannelOf( CLIENT *Client )
{
assert( Client != NULL );
return Get_First_Cl2Chan( Client, NULL );
} /* Channel_FirstChannelOf */
-GLOBAL CL2CHAN *Channel_NextChannelOf( CLIENT *Client, CL2CHAN *Cl2Chan )
+GLOBAL CL2CHAN *
+Channel_NextChannelOf( CLIENT *Client, CL2CHAN *Cl2Chan )
{
assert( Client != NULL );
assert( Cl2Chan != NULL );
} /* Channel_NextChannelOf */
-GLOBAL CLIENT *Channel_GetClient( CL2CHAN *Cl2Chan )
+GLOBAL CLIENT *
+Channel_GetClient( CL2CHAN *Cl2Chan )
{
assert( Cl2Chan != NULL );
return Cl2Chan->client;
} /* Channel_GetClient */
-GLOBAL CHANNEL *Channel_GetChannel( CL2CHAN *Cl2Chan )
+GLOBAL CHANNEL *
+Channel_GetChannel( CL2CHAN *Cl2Chan )
{
assert( Cl2Chan != NULL );
return Cl2Chan->channel;
} /* Channel_GetChannel */
-GLOBAL BOOLEAN Channel_IsValidName( CHAR *Name )
+GLOBAL BOOLEAN
+Channel_IsValidName( CHAR *Name )
{
/* PrŸfen, ob Name als Channelname gueltig */
} /* Channel_IsValidName */
-GLOBAL BOOLEAN Channel_ModeAdd( CHANNEL *Chan, CHAR Mode )
+GLOBAL BOOLEAN
+Channel_ModeAdd( CHANNEL *Chan, CHAR Mode )
{
/* Mode soll gesetzt werden. TRUE wird geliefert, wenn der
* Mode neu gesetzt wurde, FALSE, wenn der Channel den Mode
} /* Channel_ModeAdd */
-GLOBAL BOOLEAN Channel_ModeDel( CHANNEL *Chan, CHAR Mode )
+GLOBAL BOOLEAN
+Channel_ModeDel( CHANNEL *Chan, CHAR Mode )
{
/* Mode soll geloescht werden. TRUE wird geliefert, wenn der
* Mode entfernt wurde, FALSE, wenn der Channel den Mode
} /* Channel_ModeDel */
-GLOBAL BOOLEAN Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CHAR Mode )
+GLOBAL BOOLEAN
+Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CHAR Mode )
{
/* Channel-User-Mode soll gesetzt werden. TRUE wird geliefert,
* wenn der Mode neu gesetzt wurde, FALSE, wenn der User den
} /* Channel_UserModeAdd */
-GLOBAL BOOLEAN Channel_UserModeDel( CHANNEL *Chan, CLIENT *Client, CHAR Mode )
+GLOBAL BOOLEAN
+Channel_UserModeDel( CHANNEL *Chan, CLIENT *Client, CHAR Mode )
{
/* Channel-User-Mode soll geloescht werden. TRUE wird geliefert,
* wenn der Mode entfernt wurde, FALSE, wenn der User den Channel-Mode
} /* Channel_UserModeDel */
-GLOBAL CHAR *Channel_UserModes( CHANNEL *Chan, CLIENT *Client )
+GLOBAL CHAR *
+Channel_UserModes( CHANNEL *Chan, CLIENT *Client )
{
/* Channel-Modes eines Users liefern */
} /* Channel_UserModes */
-GLOBAL BOOLEAN Channel_IsMemberOf( CHANNEL *Chan, CLIENT *Client )
+GLOBAL BOOLEAN
+Channel_IsMemberOf( CHANNEL *Chan, CLIENT *Client )
{
/* Pruefen, ob Client Mitglied in Channel ist */
} /* Channel_IsMemberOf */
-GLOBAL CHAR *Channel_Topic( CHANNEL *Chan )
+GLOBAL CHAR *
+Channel_Topic( CHANNEL *Chan )
{
assert( Chan != NULL );
return Chan->topic;
} /* Channel_Topic */
-GLOBAL VOID Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
+GLOBAL VOID
+Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
{
assert( Chan != NULL );
assert( Topic != NULL );
} /* Channel_SetTopic */
-GLOBAL BOOLEAN Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
+GLOBAL BOOLEAN
+Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
{
BOOLEAN is_member, has_voice, is_op, ok;
-LOCAL CHANNEL *New_Chan( CHAR *Name )
+LOCAL CHANNEL *
+New_Chan( CHAR *Name )
{
/* Neue Channel-Struktur anlegen */
} /* New_Chan */
-LOCAL CL2CHAN *Get_Cl2Chan( CHANNEL *Chan, CLIENT *Client )
+LOCAL CL2CHAN *
+Get_Cl2Chan( CHANNEL *Chan, CLIENT *Client )
{
CL2CHAN *cl2chan;
} /* Get_Cl2Chan */
-LOCAL CL2CHAN *Add_Client( CHANNEL *Chan, CLIENT *Client )
+LOCAL CL2CHAN *
+Add_Client( CHANNEL *Chan, CLIENT *Client )
{
CL2CHAN *cl2chan;
} /* Add_Client */
-LOCAL BOOLEAN Remove_Client( CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, CHAR *Reason, BOOLEAN ServerPART )
+LOCAL BOOLEAN
+Remove_Client( CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, CHAR *Reason, BOOLEAN ServerPART )
{
CL2CHAN *cl2chan, *last_cl2chan;
CHANNEL *c;
} /* Remove_Client */
-LOCAL CL2CHAN *Get_First_Cl2Chan( CLIENT *Client, CHANNEL *Chan )
+LOCAL CL2CHAN *
+Get_First_Cl2Chan( CLIENT *Client, CHANNEL *Chan )
{
return Get_Next_Cl2Chan( My_Cl2Chan, Client, Chan );
} /* Get_First_Cl2Chan */
-LOCAL CL2CHAN *Get_Next_Cl2Chan( CL2CHAN *Start, CLIENT *Client, CHANNEL *Channel )
+LOCAL CL2CHAN *
+Get_Next_Cl2Chan( CL2CHAN *Start, CLIENT *Client, CHANNEL *Channel )
{
CL2CHAN *cl2chan;
} /* Get_Next_Cl2Chan */
-LOCAL BOOLEAN Delete_Channel( CHANNEL *Chan )
+LOCAL BOOLEAN
+Delete_Channel( CHANNEL *Chan )
{
/* Channel-Struktur loeschen */
blob - d0752bcab9627451aae622b6ac8c25d2696cdd8d
blob + 1bab307ed689edf77fe214bbd8395a7a02eb4fbe
--- src/ngircd/channel.h
+++ src/ngircd/channel.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: channel.h,v 1.17 2002/04/23 19:51:31 alex Exp $
+ * $Id: channel.h,v 1.18 2002/05/27 13:09:26 alex Exp $
*
* channel.h: Management der Channels (Header)
*/
#ifndef __channel_h__
#define __channel_h__
-#include "client.h"
-
#if defined(__channel_c__) | defined(S_SPLINT_S)
#include "defines.h"
#endif
-GLOBAL VOID Channel_Init( VOID );
-GLOBAL VOID Channel_Exit( VOID );
+GLOBAL VOID Channel_Init PARAMS((VOID ));
+GLOBAL VOID Channel_Exit PARAMS((VOID ));
-GLOBAL BOOLEAN Channel_Join( CLIENT *Client, CHAR *Name );
-GLOBAL BOOLEAN Channel_Part( CLIENT *Client, CLIENT *Origin, CHAR *Name, CHAR *Reason );
+GLOBAL BOOLEAN Channel_Join PARAMS((CLIENT *Client, CHAR *Name ));
+GLOBAL BOOLEAN Channel_Part PARAMS((CLIENT *Client, CLIENT *Origin, CHAR *Name, CHAR *Reason ));
-GLOBAL VOID Channel_RemoveClient( CLIENT *Client, CHAR *Reason );
+GLOBAL VOID Channel_RemoveClient PARAMS((CLIENT *Client, CHAR *Reason ));
-GLOBAL INT Channel_Count( VOID );
-GLOBAL INT Channel_MemberCount( CHANNEL *Chan );
+GLOBAL INT Channel_Count PARAMS((VOID ));
+GLOBAL INT Channel_MemberCount PARAMS((CHANNEL *Chan ));
-GLOBAL CHAR *Channel_Name( CHANNEL *Chan );
-GLOBAL CHAR *Channel_Modes( CHANNEL *Chan );
-GLOBAL CHAR *Channel_Topic( CHANNEL *Chan );
+GLOBAL CHAR *Channel_Name PARAMS((CHANNEL *Chan ));
+GLOBAL CHAR *Channel_Modes PARAMS((CHANNEL *Chan ));
+GLOBAL CHAR *Channel_Topic PARAMS((CHANNEL *Chan ));
-GLOBAL VOID Channel_SetTopic( CHANNEL *Chan, CHAR *Topic );
+GLOBAL VOID Channel_SetTopic PARAMS((CHANNEL *Chan, CHAR *Topic ));
-GLOBAL CHANNEL *Channel_Search( CHAR *Name );
+GLOBAL CHANNEL *Channel_Search PARAMS((CHAR *Name ));
-GLOBAL CHANNEL *Channel_First( VOID );
-GLOBAL CHANNEL *Channel_Next( CHANNEL *Chan );
+GLOBAL CHANNEL *Channel_First PARAMS((VOID ));
+GLOBAL CHANNEL *Channel_Next PARAMS((CHANNEL *Chan ));
-GLOBAL CL2CHAN *Channel_FirstMember( CHANNEL *Chan );
-GLOBAL CL2CHAN *Channel_NextMember( CHANNEL *Chan, CL2CHAN *Cl2Chan );
-GLOBAL CL2CHAN *Channel_FirstChannelOf( CLIENT *Client );
-GLOBAL CL2CHAN *Channel_NextChannelOf( CLIENT *Client, CL2CHAN *Cl2Chan );
+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 ));
-GLOBAL CLIENT *Channel_GetClient( CL2CHAN *Cl2Chan );
-GLOBAL CHANNEL *Channel_GetChannel( CL2CHAN *Cl2Chan );
+GLOBAL CLIENT *Channel_GetClient PARAMS((CL2CHAN *Cl2Chan ));
+GLOBAL CHANNEL *Channel_GetChannel PARAMS((CL2CHAN *Cl2Chan ));
-GLOBAL BOOLEAN Channel_IsValidName( CHAR *Name );
+GLOBAL BOOLEAN Channel_IsValidName PARAMS((CHAR *Name ));
-GLOBAL BOOLEAN Channel_ModeAdd( CHANNEL *Chan, CHAR Mode );
-GLOBAL BOOLEAN Channel_ModeDel( CHANNEL *Chan, CHAR Mode );
+GLOBAL BOOLEAN Channel_ModeAdd PARAMS((CHANNEL *Chan, CHAR Mode ));
+GLOBAL BOOLEAN Channel_ModeDel PARAMS((CHANNEL *Chan, CHAR Mode ));
-GLOBAL BOOLEAN Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CHAR Mode );
-GLOBAL BOOLEAN Channel_UserModeDel( CHANNEL *Chan, CLIENT *Client, CHAR Mode );
-GLOBAL CHAR *Channel_UserModes( CHANNEL *Chan, CLIENT *Client );
+GLOBAL BOOLEAN Channel_UserModeAdd PARAMS((CHANNEL *Chan, CLIENT *Client, CHAR Mode ));
+GLOBAL BOOLEAN Channel_UserModeDel PARAMS((CHANNEL *Chan, CLIENT *Client, CHAR Mode ));
+GLOBAL CHAR *Channel_UserModes PARAMS((CHANNEL *Chan, CLIENT *Client ));
-GLOBAL BOOLEAN Channel_IsMemberOf( CHANNEL *Chan, CLIENT *Client );
+GLOBAL BOOLEAN Channel_IsMemberOf PARAMS((CHANNEL *Chan, CLIENT *Client ));
-GLOBAL BOOLEAN Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text );
+GLOBAL BOOLEAN Channel_Write PARAMS((CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ));
#endif
blob - b3b6118172f6bdcaf3906c9b41890f179354740d
blob + 3c6d3aebfbc596cd7a38cfe202a15c354e9bec6f
--- src/ngircd/client.c
+++ src/ngircd/client.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: client.c,v 1.54 2002/04/14 13:54:51 alex Exp $
+ * $Id: client.c,v 1.55 2002/05/27 13:09:26 alex Exp $
*
* client.c: Management aller Clients
*
#include <string.h>
#include <netdb.h>
+#include "conn.h"
+
#include "exp.h"
#include "client.h"
#include <imp.h>
#include "ngircd.h"
#include "channel.h"
+#include "resolve.h"
#include "conf.h"
-#include "conn.h"
#include "hash.h"
#include "irc-write.h"
#include "log.h"
LOCAL CHAR GetID_Buffer[CLIENT_ID_LEN];
-LOCAL INT Count( CLIENT_TYPE Type );
-LOCAL INT MyCount( CLIENT_TYPE Type );
+LOCAL INT Count PARAMS(( CLIENT_TYPE Type ));
+LOCAL INT MyCount PARAMS(( CLIENT_TYPE Type ));
-LOCAL CLIENT *New_Client_Struct( VOID );
-LOCAL VOID Generate_MyToken( CLIENT *Client );
+LOCAL CLIENT *New_Client_Struct PARAMS(( VOID ));
+LOCAL VOID Generate_MyToken PARAMS(( CLIENT *Client ));
-GLOBAL VOID Client_Init( VOID )
+GLOBAL VOID
+Client_Init( VOID )
{
struct hostent *h;
} /* Client_Init */
-GLOBAL VOID Client_Exit( VOID )
+GLOBAL VOID
+Client_Exit( VOID )
{
CLIENT *c, *next;
INT cnt;
} /* Client_Exit */
-GLOBAL CLIENT *Client_ThisServer( VOID )
+GLOBAL CLIENT *
+Client_ThisServer( VOID )
{
return This_Server;
} /* Client_ThisServer */
-GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented )
+GLOBAL CLIENT *
+Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented )
{
/* Neuen lokalen Client erzeugen: Wrapper-Funktion fuer Client_New(). */
return Client_New( Idx, This_Server, NULL, Type, NULL, NULL, Hostname, NULL, 0, 0, NULL, Idented );
} /* Client_NewLocal */
-GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented )
+GLOBAL CLIENT *
+Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented )
{
/* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
return Client_New( NONE, Introducer, TopServer, CLIENT_SERVER, Hostname, NULL, Hostname, Info, Hops, Token, NULL, Idented );
} /* Client_NewRemoteServer */
-GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented )
+GLOBAL CLIENT *
+Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented )
{
/* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
return Client_New( NONE, Introducer, NULL, CLIENT_USER, Nick, User, Hostname, Info, Hops, Token, Modes, Idented );
} /* Client_NewRemoteUser */
-GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented )
+GLOBAL CLIENT *
+Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented )
{
CLIENT *client;
} /* Client_New */
-GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
+GLOBAL VOID
+Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
{
/* Client entfernen. */
} /* Client_Destroy */
-GLOBAL VOID Client_SetHostname( CLIENT *Client, CHAR *Hostname )
+GLOBAL VOID
+Client_SetHostname( CLIENT *Client, CHAR *Hostname )
{
/* Hostname eines Clients setzen */
} /* Client_SetHostname */
-GLOBAL VOID Client_SetID( CLIENT *Client, CHAR *ID )
+GLOBAL VOID
+Client_SetID( CLIENT *Client, CHAR *ID )
{
/* Hostname eines Clients setzen, Hash-Wert berechnen */
} /* Client_SetID */
-GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented )
+GLOBAL VOID
+Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented )
{
/* Username eines Clients setzen */
} /* Client_SetUser */
-GLOBAL VOID Client_SetInfo( CLIENT *Client, CHAR *Info )
+GLOBAL VOID
+Client_SetInfo( CLIENT *Client, CHAR *Info )
{
/* Hostname eines Clients setzen */
} /* Client_SetInfo */
-GLOBAL VOID Client_SetModes( CLIENT *Client, CHAR *Modes )
+GLOBAL VOID
+Client_SetModes( CLIENT *Client, CHAR *Modes )
{
/* Hostname eines Clients setzen */
} /* Client_SetModes */
-GLOBAL VOID Client_SetPassword( CLIENT *Client, CHAR *Pwd )
+GLOBAL VOID
+Client_SetPassword( CLIENT *Client, CHAR *Pwd )
{
/* Von einem Client geliefertes Passwort */
} /* Client_SetPassword */
-GLOBAL VOID Client_SetAway( CLIENT *Client, CHAR *Txt )
+GLOBAL VOID
+Client_SetAway( CLIENT *Client, CHAR *Txt )
{
/* Von einem Client gelieferte AWAY-Nachricht */
} /* Client_SetAway */
-GLOBAL VOID Client_SetType( CLIENT *Client, INT Type )
+GLOBAL VOID
+Client_SetType( CLIENT *Client, INT Type )
{
assert( Client != NULL );
Client->type = Type;
} /* Client_SetType */
-GLOBAL VOID Client_SetHops( CLIENT *Client, INT Hops )
+GLOBAL VOID
+Client_SetHops( CLIENT *Client, INT Hops )
{
assert( Client != NULL );
Client->hops = Hops;
} /* Client_SetHops */
-GLOBAL VOID Client_SetToken( CLIENT *Client, INT Token )
+GLOBAL VOID
+Client_SetToken( CLIENT *Client, INT Token )
{
assert( Client != NULL );
Client->token = Token;
} /* Client_SetToken */
-GLOBAL VOID Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer )
+GLOBAL VOID
+Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer )
{
assert( Client != NULL );
assert( Introducer != NULL );
} /* Client_SetIntroducer */
-GLOBAL VOID Client_SetOperByMe( CLIENT *Client, BOOLEAN OperByMe )
+GLOBAL VOID
+Client_SetOperByMe( CLIENT *Client, BOOLEAN OperByMe )
{
assert( Client != NULL );
Client->oper_by_me = OperByMe;
} /* Client_SetOperByMe */
-GLOBAL BOOLEAN Client_ModeAdd( CLIENT *Client, CHAR Mode )
+GLOBAL BOOLEAN
+Client_ModeAdd( CLIENT *Client, CHAR Mode )
{
/* Mode soll gesetzt werden. TRUE wird geliefert, wenn der
* Mode neu gesetzt wurde, FALSE, wenn der Client den Mode
} /* Client_ModeAdd */
-GLOBAL BOOLEAN Client_ModeDel( CLIENT *Client, CHAR Mode )
+GLOBAL BOOLEAN
+Client_ModeDel( CLIENT *Client, CHAR Mode )
{
/* Mode soll geloescht werden. TRUE wird geliefert, wenn der
* Mode entfernt wurde, FALSE, wenn der Client den Mode
} /* Client_ModeDel */
-GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx )
+GLOBAL CLIENT *
+Client_GetFromConn( CONN_ID Idx )
{
/* Client-Struktur, die zur lokalen Verbindung Idx gehoert,
* liefern. Wird keine gefunden, so wird NULL geliefert. */
} /* Client_GetFromConn */
-GLOBAL CLIENT *Client_Search( CHAR *Nick )
+GLOBAL CLIENT *
+Client_Search( CHAR *Nick )
{
/* Client-Struktur, die den entsprechenden Nick hat, liefern.
* Wird keine gefunden, so wird NULL geliefert. */
} /* Client_Search */
-GLOBAL CLIENT *Client_GetFromToken( CLIENT *Client, INT Token )
+GLOBAL CLIENT *
+Client_GetFromToken( CLIENT *Client, INT Token )
{
/* Client-Struktur, die den entsprechenden Introducer (=Client)
* und das gegebene Token hat, liefern. Wird keine gefunden,
} /* Client_GetFromToken */
-GLOBAL INT Client_Type( CLIENT *Client )
+GLOBAL INT
+Client_Type( CLIENT *Client )
{
assert( Client != NULL );
return Client->type;
} /* Client_Type */
-GLOBAL CONN_ID Client_Conn( CLIENT *Client )
+GLOBAL CONN_ID
+Client_Conn( CLIENT *Client )
{
assert( Client != NULL );
return Client->conn_id;
} /* Client_Conn */
-GLOBAL CHAR *Client_ID( CLIENT *Client )
+GLOBAL CHAR *
+Client_ID( CLIENT *Client )
{
assert( Client != NULL );
} /* Client_ID */
-GLOBAL CHAR *Client_Info( CLIENT *Client )
+GLOBAL CHAR *
+Client_Info( CLIENT *Client )
{
assert( Client != NULL );
return Client->info;
} /* Client_Info */
-GLOBAL CHAR *Client_User( CLIENT *Client )
+GLOBAL CHAR *
+Client_User( CLIENT *Client )
{
assert( Client != NULL );
if( Client->user[0] ) return Client->user;
} /* Client_User */
-GLOBAL CHAR *Client_Hostname( CLIENT *Client )
+GLOBAL CHAR *
+Client_Hostname( CLIENT *Client )
{
assert( Client != NULL );
return Client->host;
} /* Client_Hostname */
-GLOBAL CHAR *Client_Password( CLIENT *Client )
+GLOBAL CHAR *
+Client_Password( CLIENT *Client )
{
assert( Client != NULL );
return Client->pwd;
} /* Client_Password */
-GLOBAL CHAR *Client_Modes( CLIENT *Client )
+GLOBAL CHAR *
+Client_Modes( CLIENT *Client )
{
assert( Client != NULL );
return Client->modes;
} /* Client_Modes */
-GLOBAL BOOLEAN Client_OperByMe( CLIENT *Client )
+GLOBAL BOOLEAN
+Client_OperByMe( CLIENT *Client )
{
assert( Client != NULL );
return Client->oper_by_me;
} /* Client_OperByMe */
-GLOBAL INT Client_Hops( CLIENT *Client )
+GLOBAL INT
+Client_Hops( CLIENT *Client )
{
assert( Client != NULL );
return Client->hops;
} /* Client_Hops */
-GLOBAL INT Client_Token( CLIENT *Client )
+GLOBAL INT
+Client_Token( CLIENT *Client )
{
assert( Client != NULL );
return Client->token;
} /* Client_Token */
-GLOBAL INT Client_MyToken( CLIENT *Client )
+GLOBAL INT
+Client_MyToken( CLIENT *Client )
{
assert( Client != NULL );
return Client->mytoken;
} /* Client_MyToken */
-GLOBAL CLIENT *Client_NextHop( CLIENT *Client )
+GLOBAL CLIENT *
+Client_NextHop( CLIENT *Client )
{
CLIENT *c;
} /* Client_NextHop */
-GLOBAL CHAR *Client_Mask( CLIENT *Client )
+GLOBAL CHAR *
+Client_Mask( CLIENT *Client )
{
/* Client-"ID" liefern, wie sie z.B. fuer
* Prefixe benoetigt wird. */
} /* Client_Mask */
-GLOBAL CLIENT *Client_Introducer( CLIENT *Client )
+GLOBAL CLIENT *
+Client_Introducer( CLIENT *Client )
{
assert( Client != NULL );
return Client->introducer;
} /* Client_Introducer */
-GLOBAL CLIENT *Client_TopServer( CLIENT *Client )
+GLOBAL CLIENT *
+Client_TopServer( CLIENT *Client )
{
assert( Client != NULL );
return Client->topserver;
} /* Client_TopServer */
-GLOBAL BOOLEAN Client_HasMode( CLIENT *Client, CHAR Mode )
+GLOBAL BOOLEAN
+Client_HasMode( CLIENT *Client, CHAR Mode )
{
assert( Client != NULL );
return strchr( Client->modes, Mode ) != NULL;
} /* Client_HasMode */
-GLOBAL CHAR *Client_Away( CLIENT *Client )
+GLOBAL CHAR *
+Client_Away( CLIENT *Client )
{
/* AWAY-Text liefern */
} /* Client_Away */
-GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick )
+GLOBAL BOOLEAN
+Client_CheckNick( CLIENT *Client, CHAR *Nick )
{
/* Nick ueberpruefen */
} /* Client_CheckNick */
-GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID )
+GLOBAL BOOLEAN
+Client_CheckID( CLIENT *Client, CHAR *ID )
{
/* Nick ueberpruefen */
} /* Client_CheckID */
-GLOBAL CLIENT *Client_First( VOID )
+GLOBAL CLIENT *
+Client_First( VOID )
{
/* Ersten Client liefern. */
} /* Client_First */
-GLOBAL CLIENT *Client_Next( CLIENT *c )
+GLOBAL CLIENT *
+Client_Next( CLIENT *c )
{
/* Naechsten Client liefern. Existiert keiner,
* so wird NULL geliefert. */
} /* Client_Next */
-GLOBAL INT Client_UserCount( VOID )
+GLOBAL INT
+Client_UserCount( VOID )
{
return Count( CLIENT_USER );
} /* Client_UserCount */
-GLOBAL INT Client_ServiceCount( VOID )
+GLOBAL INT
+Client_ServiceCount( VOID )
{
return Count( CLIENT_SERVICE );;
} /* Client_ServiceCount */
-GLOBAL INT Client_ServerCount( VOID )
+GLOBAL INT
+Client_ServerCount( VOID )
{
return Count( CLIENT_SERVER );
} /* Client_ServerCount */
-GLOBAL INT Client_MyUserCount( VOID )
+GLOBAL INT
+Client_MyUserCount( VOID )
{
return MyCount( CLIENT_USER );
} /* Client_MyUserCount */
-GLOBAL INT Client_MyServiceCount( VOID )
+GLOBAL INT
+Client_MyServiceCount( VOID )
{
return MyCount( CLIENT_SERVICE );
} /* Client_MyServiceCount */
-GLOBAL INT Client_MyServerCount( VOID )
+GLOBAL INT
+Client_MyServerCount( VOID )
{
CLIENT *c;
INT cnt;
} /* Client_MyServerCount */
-GLOBAL INT Client_OperCount( VOID )
+GLOBAL INT
+Client_OperCount( VOID )
{
CLIENT *c;
INT cnt;
} /* Client_OperCount */
-GLOBAL INT Client_UnknownCount( VOID )
+GLOBAL INT
+Client_UnknownCount( VOID )
{
CLIENT *c;
INT cnt;
} /* Client_UnknownCount */
-GLOBAL BOOLEAN Client_IsValidNick( CHAR *Nick )
+GLOBAL BOOLEAN
+Client_IsValidNick( CHAR *Nick )
{
/* Ist der Nick gueltig? */
} /* Client_IsValidNick */
-LOCAL INT Count( CLIENT_TYPE Type )
+LOCAL INT
+Count( CLIENT_TYPE Type )
{
CLIENT *c;
INT cnt;
} /* Count */
-LOCAL INT MyCount( CLIENT_TYPE Type )
+LOCAL INT
+MyCount( CLIENT_TYPE Type )
{
CLIENT *c;
INT cnt;
} /* MyCount */
-LOCAL CLIENT *New_Client_Struct( VOID )
+LOCAL CLIENT *
+New_Client_Struct( VOID )
{
/* Neue CLIENT-Struktur pre-initialisieren */
} /* New_Client */
-LOCAL VOID Generate_MyToken( CLIENT *Client )
+LOCAL VOID
+Generate_MyToken( CLIENT *Client )
{
CLIENT *c;
INT token;
blob - 853ac31362080811138a161df594d38cdd8ecb24
blob + e7178d74f00215e5feeb256a11f5053784fea363
--- src/ngircd/client.h
+++ src/ngircd/client.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: client.h,v 1.27 2002/03/25 19:11:01 alex Exp $
+ * $Id: client.h,v 1.28 2002/05/27 13:09:26 alex Exp $
*
* client.h: Konfiguration des ngircd (Header)
*/
#ifndef __client_h__
#define __client_h__
-#include "conn.h"
-
typedef enum
{
CLIENT_UNKNOWN, /* Verbindung mit (noch) unbekanntem Typ */
#endif
-GLOBAL VOID Client_Init( VOID );
-GLOBAL VOID Client_Exit( VOID );
+GLOBAL VOID Client_Init PARAMS((VOID ));
+GLOBAL VOID Client_Exit PARAMS((VOID ));
-GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented );
-GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented );
-GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented );
-GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented );
+GLOBAL CLIENT *Client_NewLocal PARAMS((CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented ));
+GLOBAL CLIENT *Client_NewRemoteServer PARAMS((CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented ));
+GLOBAL CLIENT *Client_NewRemoteUser PARAMS((CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented ));
+GLOBAL CLIENT *Client_New PARAMS((CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented ));
-GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit );
+GLOBAL VOID Client_Destroy PARAMS((CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit ));
-GLOBAL CLIENT *Client_ThisServer( VOID );
+GLOBAL CLIENT *Client_ThisServer PARAMS((VOID ));
-GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx );
-GLOBAL CLIENT *Client_GetFromToken( CLIENT *Client, INT Token );
+GLOBAL CLIENT *Client_GetFromConn PARAMS((CONN_ID Idx ));
+GLOBAL CLIENT *Client_GetFromToken PARAMS((CLIENT *Client, INT Token ));
-GLOBAL CLIENT *Client_Search( CHAR *ID );
-GLOBAL CLIENT *Client_First( VOID );
-GLOBAL CLIENT *Client_Next( CLIENT *c );
+GLOBAL CLIENT *Client_Search PARAMS((CHAR *ID ));
+GLOBAL CLIENT *Client_First PARAMS((VOID ));
+GLOBAL CLIENT *Client_Next PARAMS((CLIENT *c ));
-GLOBAL INT Client_Type( CLIENT *Client );
-GLOBAL CONN_ID Client_Conn( CLIENT *Client );
-GLOBAL CHAR *Client_ID( CLIENT *Client );
-GLOBAL CHAR *Client_Mask( CLIENT *Client );
-GLOBAL CHAR *Client_Info( CLIENT *Client );
-GLOBAL CHAR *Client_User( CLIENT *Client );
-GLOBAL CHAR *Client_Hostname( CLIENT *Client );
-GLOBAL CHAR *Client_Password( CLIENT *Client );
-GLOBAL CHAR *Client_Modes( CLIENT *Client );
-GLOBAL CLIENT *Client_Introducer( CLIENT *Client );
-GLOBAL BOOLEAN Client_OperByMe( CLIENT *Client );
-GLOBAL INT Client_Hops( CLIENT *Client );
-GLOBAL INT Client_Token( CLIENT *Client );
-GLOBAL INT Client_MyToken( CLIENT *Client );
-GLOBAL CLIENT *Client_TopServer( CLIENT *Client );
-GLOBAL CLIENT *Client_NextHop( CLIENT *Client );
-GLOBAL CHAR *Client_Away( CLIENT *Client );
+GLOBAL INT Client_Type PARAMS((CLIENT *Client ));
+GLOBAL CONN_ID Client_Conn PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_ID PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Mask PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Info PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_User PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Hostname PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Password PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Modes PARAMS((CLIENT *Client ));
+GLOBAL CLIENT *Client_Introducer PARAMS((CLIENT *Client ));
+GLOBAL BOOLEAN Client_OperByMe PARAMS((CLIENT *Client ));
+GLOBAL INT Client_Hops PARAMS((CLIENT *Client ));
+GLOBAL INT Client_Token PARAMS((CLIENT *Client ));
+GLOBAL INT Client_MyToken PARAMS((CLIENT *Client ));
+GLOBAL CLIENT *Client_TopServer PARAMS((CLIENT *Client ));
+GLOBAL CLIENT *Client_NextHop PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Away PARAMS((CLIENT *Client ));
-GLOBAL BOOLEAN Client_HasMode( CLIENT *Client, CHAR Mode );
+GLOBAL BOOLEAN Client_HasMode PARAMS((CLIENT *Client, CHAR Mode ));
-GLOBAL VOID Client_SetHostname( CLIENT *Client, CHAR *Hostname );
-GLOBAL VOID Client_SetID( CLIENT *Client, CHAR *Nick );
-GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented );
-GLOBAL VOID Client_SetInfo( CLIENT *Client, CHAR *Info );
-GLOBAL VOID Client_SetPassword( CLIENT *Client, CHAR *Pwd );
-GLOBAL VOID Client_SetType( CLIENT *Client, INT Type );
-GLOBAL VOID Client_SetHops( CLIENT *Client, INT Hops );
-GLOBAL VOID Client_SetToken( CLIENT *Client, INT Token );
-GLOBAL VOID Client_SetOperByMe( CLIENT *Client, BOOLEAN OperByMe );
-GLOBAL VOID Client_SetModes( CLIENT *Client, CHAR *Modes );
-GLOBAL VOID Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer );
-GLOBAL VOID Client_SetAway( CLIENT *Client, CHAR *Txt );
+GLOBAL VOID Client_SetHostname PARAMS((CLIENT *Client, CHAR *Hostname ));
+GLOBAL VOID Client_SetID PARAMS((CLIENT *Client, CHAR *Nick ));
+GLOBAL VOID Client_SetUser PARAMS((CLIENT *Client, CHAR *User, BOOLEAN Idented ));
+GLOBAL VOID Client_SetInfo PARAMS((CLIENT *Client, CHAR *Info ));
+GLOBAL VOID Client_SetPassword PARAMS((CLIENT *Client, CHAR *Pwd ));
+GLOBAL VOID Client_SetType PARAMS((CLIENT *Client, INT Type ));
+GLOBAL VOID Client_SetHops PARAMS((CLIENT *Client, INT Hops ));
+GLOBAL VOID Client_SetToken PARAMS((CLIENT *Client, INT Token ));
+GLOBAL VOID Client_SetOperByMe PARAMS((CLIENT *Client, BOOLEAN OperByMe ));
+GLOBAL VOID Client_SetModes PARAMS((CLIENT *Client, CHAR *Modes ));
+GLOBAL VOID Client_SetIntroducer PARAMS((CLIENT *Client, CLIENT *Introducer ));
+GLOBAL VOID Client_SetAway PARAMS((CLIENT *Client, CHAR *Txt ));
-GLOBAL BOOLEAN Client_ModeAdd( CLIENT *Client, CHAR Mode );
-GLOBAL BOOLEAN Client_ModeDel( CLIENT *Client, CHAR Mode );
+GLOBAL BOOLEAN Client_ModeAdd PARAMS((CLIENT *Client, CHAR Mode ));
+GLOBAL BOOLEAN Client_ModeDel PARAMS((CLIENT *Client, CHAR Mode ));
-GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick );
-GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID );
+GLOBAL BOOLEAN Client_CheckNick PARAMS((CLIENT *Client, CHAR *Nick ));
+GLOBAL BOOLEAN Client_CheckID PARAMS((CLIENT *Client, CHAR *ID ));
-GLOBAL INT Client_UserCount( VOID );
-GLOBAL INT Client_ServiceCount( VOID );
-GLOBAL INT Client_ServerCount( VOID );
-GLOBAL INT Client_OperCount( VOID );
-GLOBAL INT Client_UnknownCount( VOID );
-GLOBAL INT Client_MyUserCount( VOID );
-GLOBAL INT Client_MyServiceCount( VOID );
-GLOBAL INT Client_MyServerCount( VOID );
+GLOBAL INT Client_UserCount PARAMS((VOID ));
+GLOBAL INT Client_ServiceCount PARAMS((VOID ));
+GLOBAL INT Client_ServerCount PARAMS((VOID ));
+GLOBAL INT Client_OperCount PARAMS((VOID ));
+GLOBAL INT Client_UnknownCount PARAMS((VOID ));
+GLOBAL INT Client_MyUserCount PARAMS((VOID ));
+GLOBAL INT Client_MyServiceCount PARAMS((VOID ));
+GLOBAL INT Client_MyServerCount PARAMS((VOID ));
-GLOBAL BOOLEAN Client_IsValidNick( CHAR *Nick );
+GLOBAL BOOLEAN Client_IsValidNick PARAMS((CHAR *Nick ));
#endif
blob - aab8f068b11168fac0aaff7d582c9b9c491fdae2
blob + 4a4fe216c6e365128b91335b4871fd5f4a4089fd
--- src/ngircd/conf.c
+++ src/ngircd/conf.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: conf.c,v 1.25 2002/05/22 11:14:36 alex Exp $
+ * $Id: conf.c,v 1.26 2002/05/27 13:09:26 alex Exp $
*
* conf.h: Konfiguration des ngircd
*/
#include <unistd.h>
#include "ngircd.h"
+#include "conn.h"
#include "client.h"
#include "defines.h"
#include "log.h"
+#include "resolve.h"
#include "tool.h"
#include "exp.h"
LOCAL BOOLEAN Use_Log = TRUE;
-LOCAL VOID Set_Defaults( VOID );
-LOCAL VOID Read_Config( VOID );
-LOCAL VOID Validate_Config( VOID );
+LOCAL VOID Set_Defaults PARAMS(( VOID ));
+LOCAL VOID Read_Config PARAMS(( VOID ));
+LOCAL VOID Validate_Config PARAMS(( VOID ));
-GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg );
-GLOBAL VOID Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg );
-GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg );
-GLOBAL VOID Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg );
+LOCAL VOID Handle_GLOBAL PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
+LOCAL VOID Handle_OPERATOR PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
+LOCAL VOID Handle_SERVER PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
+LOCAL VOID Handle_CHANNEL PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
-LOCAL VOID Config_Error( CONST INT Level, CONST CHAR *Format, ... );
+LOCAL VOID Config_Error PARAMS(( CONST INT Level, CONST CHAR *Format, ... ));
-GLOBAL VOID Conf_Init( VOID )
+GLOBAL VOID
+Conf_Init( VOID )
{
Set_Defaults( );
Read_Config( );
} /* Config_Init */
-GLOBAL INT Conf_Test( VOID )
+GLOBAL INT
+Conf_Test( VOID )
{
/* Konfiguration einlesen, ueberpruefen und ausgeben. */
return 0;
} /* Conf_Test */
-
-
-GLOBAL VOID Conf_Exit( VOID )
-{
- /* ... */
-} /* Config_Exit */
-LOCAL VOID Set_Defaults( VOID )
+LOCAL VOID
+Set_Defaults( VOID )
{
/* Konfigurationsvariablen initialisieren, d.h. auf Default-Werte setzen. */
} /* Set_Defaults */
-LOCAL VOID Read_Config( VOID )
+LOCAL VOID
+Read_Config( VOID )
{
/* Konfigurationsdatei einlesen. */
} /* Read_Config */
-GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
+LOCAL VOID
+Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
{
CHAR *ptr;
INT32 port;
} /* Handle_GLOBAL */
-GLOBAL VOID Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
+LOCAL VOID
+Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
{
assert( Line > 0 );
assert( Var != NULL );
} /* Handle_OPERATOR */
-GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
+LOCAL VOID
+Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
{
INT32 port;
} /* Handle_SERVER */
-GLOBAL VOID Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg )
+LOCAL VOID
+Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg )
{
assert( Line > 0 );
assert( Var != NULL );
} /* Handle_CHANNEL */
-LOCAL VOID Validate_Config( VOID )
+LOCAL VOID
+Validate_Config( VOID )
{
/* Konfiguration ueberpruefen */
} /* Validate_Config */
-LOCAL VOID Config_Error( CONST INT Level, CONST CHAR *Format, ... )
+LOCAL VOID
+Config_Error( CONST INT Level, CONST CHAR *Format, ... )
{
/* Fehler! Auf Console und/oder ins Log schreiben */
blob - 74a249937605be43d69fd468ddc09d61db2069b5
blob + 57ae98e48ddc2cf824b8b607493c4c9e24311e29
--- src/ngircd/conf.h
+++ src/ngircd/conf.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: conf.h,v 1.16 2002/05/21 00:10:16 alex Exp $
+ * $Id: conf.h,v 1.17 2002/05/27 13:09:26 alex Exp $
*
* conf.h: Konfiguration des ngircd (Header)
*/
#include <time.h>
-#include "conn.h"
#include "defines.h"
GLOBAL INT Conf_Channel_Count;
-GLOBAL VOID Conf_Init( VOID );
-GLOBAL INT Conf_Test( VOID );
-GLOBAL VOID Conf_Exit( VOID );
+GLOBAL VOID Conf_Init PARAMS((VOID ));
+GLOBAL INT Conf_Test PARAMS((VOID ));
#endif
blob - 25b6230afd1a5726c843ada9db2e4eaaaf0f9f99
blob + d6ceb629f4f4ed7e4c642cf94fe568b54ad6c889
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: conn.c,v 1.64 2002/05/19 13:05:22 alex Exp $
+ * $Id: conn.c,v 1.65 2002/05/27 13:09:26 alex Exp $
*
* connect.h: Verwaltung aller Netz-Verbindungen ("connections")
*/
#include <sys/types.h>
#include <time.h>
#include <netinet/in.h>
-#include <netdb.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#include <stdint.h> /* u.a. fuer Mac OS X */
#endif
+#include "exp.h"
+#include "conn.h"
+
+#include "imp.h"
#include "ngircd.h"
#include "client.h"
+#include "resolve.h"
#include "conf.h"
#include "log.h"
#include "parse.h"
#include "tool.h"
#include "exp.h"
-#include "conn.h"
#define SERVER_WAIT (NONE - 1)
} CONNECTION;
-LOCAL VOID Handle_Read( INT sock );
-LOCAL BOOLEAN Handle_Write( CONN_ID Idx );
-LOCAL VOID New_Connection( INT Sock );
-LOCAL CONN_ID Socket2Index( INT Sock );
-LOCAL VOID Read_Request( CONN_ID Idx );
-LOCAL BOOLEAN Try_Write( CONN_ID Idx );
-LOCAL VOID Handle_Buffer( CONN_ID Idx );
-LOCAL VOID Check_Connections( VOID );
-LOCAL VOID Check_Servers( VOID );
-LOCAL VOID Init_Conn_Struct( INT Idx );
-LOCAL BOOLEAN Init_Socket( INT Sock );
-LOCAL VOID New_Server( INT Server, CONN_ID Idx );
+LOCAL VOID Handle_Read PARAMS(( INT sock ));
+LOCAL BOOLEAN Handle_Write PARAMS(( CONN_ID Idx ));
+LOCAL VOID New_Connection PARAMS(( INT Sock ));
+LOCAL CONN_ID Socket2Index PARAMS(( INT Sock ));
+LOCAL VOID Read_Request PARAMS(( CONN_ID Idx ));
+LOCAL BOOLEAN Try_Write PARAMS(( CONN_ID Idx ));
+LOCAL VOID Handle_Buffer PARAMS(( CONN_ID Idx ));
+LOCAL VOID Check_Connections PARAMS(( VOID ));
+LOCAL VOID Check_Servers PARAMS(( VOID ));
+LOCAL VOID Init_Conn_Struct PARAMS(( INT Idx ));
+LOCAL BOOLEAN Init_Socket PARAMS(( INT Sock ));
+LOCAL VOID New_Server PARAMS(( INT Server, CONN_ID Idx ));
+LOCAL VOID Read_Resolver_Result PARAMS(( INT r_fd ));
-LOCAL RES_STAT *ResolveAddr( struct sockaddr_in *Addr );
-LOCAL RES_STAT *ResolveName( CHAR *Host );
-LOCAL VOID Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd );
-LOCAL VOID Do_ResolveName( CHAR *Host, INT w_fd );
-LOCAL VOID Read_Resolver_Result( INT r_fd );
-#ifdef h_errno
-LOCAL CHAR *Resolv_Error( INT H_Error );
-#endif
-
-
LOCAL fd_set My_Listeners;
LOCAL fd_set My_Sockets;
-LOCAL fd_set My_Resolvers;
LOCAL fd_set My_Connects;
-LOCAL INT My_Max_Fd;
-
LOCAL CONNECTION My_Connections[MAX_CONNECTIONS];
-GLOBAL VOID Conn_Init( VOID )
+GLOBAL VOID
+Conn_Init( VOID )
{
/* Modul initialisieren: statische Strukturen "ausnullen". */
/* zu Beginn haben wir keine Verbindungen */
FD_ZERO( &My_Listeners );
FD_ZERO( &My_Sockets );
- FD_ZERO( &My_Resolvers );
FD_ZERO( &My_Connects );
- My_Max_Fd = 0;
+ Conn_MaxFD = 0;
/* Connection-Struktur initialisieren */
for( i = 0; i < MAX_CONNECTIONS; i++ ) Init_Conn_Struct( i );
} /* Conn_Init */
-GLOBAL VOID Conn_Exit( VOID )
+GLOBAL VOID
+Conn_Exit( VOID )
{
/* Modul abmelden: alle noch offenen Connections
* schliessen und freigeben. */
/* Sockets schliessen */
Log( LOG_DEBUG, "Shutting down all connections ..." );
- for( i = 0; i < My_Max_Fd + 1; i++ )
+ for( i = 0; i < Conn_MaxFD + 1; i++ )
{
if( FD_ISSET( i, &My_Sockets ))
{
} /* Conn_Exit */
-GLOBAL BOOLEAN Conn_NewListener( CONST UINT Port )
+GLOBAL BOOLEAN
+Conn_NewListener( CONST UINT Port )
{
/* Neuen Listen-Socket erzeugen: der Server wartet dann auf
* dem angegebenen Port auf Verbindungen. Kann der Listen-
FD_SET( sock, &My_Listeners );
FD_SET( sock, &My_Sockets );
- if( sock > My_Max_Fd ) My_Max_Fd = sock;
+ if( sock > Conn_MaxFD ) Conn_MaxFD = sock;
Log( LOG_INFO, "Now listening on port %d (socket %d).", Port, sock );
} /* Conn_NewListener */
-GLOBAL VOID Conn_Handler( INT Timeout )
+GLOBAL VOID
+Conn_Handler( INT Timeout )
{
/* Aktive Verbindungen ueberwachen. Mindestens alle "Timeout"
* Sekunden wird die Funktion verlassen. Folgende Aktionen
FD_CLR( My_Connections[i].sock, &read_sockets );
}
}
- for( i = 0; i < My_Max_Fd + 1; i++ )
+ for( i = 0; i < Conn_MaxFD + 1; i++ )
{
/* Pipes von Resolver Sub-Prozessen aufnehmen */
- if( FD_ISSET( i, &My_Resolvers ))
+ if( FD_ISSET( i, &Resolver_FDs ))
{
FD_SET( i, &read_sockets );
}
}
/* Auf Aktivitaet warten */
- if( select( My_Max_Fd + 1, &read_sockets, &write_sockets, NULL, &tv ) == -1 )
+ if( select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv ) == -1 )
{
if( errno != EINTR )
{
}
/* Koennen Daten geschrieben werden? */
- for( i = 0; i < My_Max_Fd + 1; i++ )
+ for( i = 0; i < Conn_MaxFD + 1; i++ )
{
if( FD_ISSET( i, &write_sockets )) Handle_Write( Socket2Index( i ));
}
/* Daten zum Lesen vorhanden? */
- for( i = 0; i < My_Max_Fd + 1; i++ )
+ for( i = 0; i < Conn_MaxFD + 1; i++ )
{
if( FD_ISSET( i, &read_sockets )) Handle_Read( i );
}
} /* Conn_Handler */
-GLOBAL BOOLEAN Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... )
+GLOBAL BOOLEAN
+Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... )
{
/* String in Socket schreiben. CR+LF wird von dieser Funktion
* automatisch angehaengt. Im Fehlerfall wird dir Verbindung
} /* Conn_WriteStr */
-GLOBAL BOOLEAN Conn_Write( CONN_ID Idx, CHAR *Data, INT Len )
+GLOBAL BOOLEAN
+Conn_Write( CONN_ID Idx, CHAR *Data, INT Len )
{
/* Daten in Socket schreiben. Bei "fatalen" Fehlern wird
* der Client disconnectiert und FALSE geliefert. */
} /* Conn_Write */
-GLOBAL VOID Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
+GLOBAL VOID
+Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
{
/* Verbindung schliessen. Evtl. noch von Resolver
* Sub-Prozessen offene Pipes werden geschlossen. */
if( My_Connections[Idx].res_stat )
{
/* Resolver-Strukturen freigeben, wenn noch nicht geschehen */
- FD_CLR( My_Connections[Idx].res_stat->pipe[0], &My_Resolvers );
+ FD_CLR( My_Connections[Idx].res_stat->pipe[0], &Resolver_FDs );
close( My_Connections[Idx].res_stat->pipe[0] );
close( My_Connections[Idx].res_stat->pipe[1] );
free( My_Connections[Idx].res_stat );
} /* Conn_Close */
-GLOBAL VOID Conn_UpdateIdle( CONN_ID Idx )
+GLOBAL VOID
+Conn_UpdateIdle( CONN_ID Idx )
{
/* Idle-Timer zuruecksetzen */
}
-GLOBAL time_t Conn_GetIdle( CONN_ID Idx )
+GLOBAL time_t
+Conn_GetIdle( CONN_ID Idx )
{
/* Idle-Time einer Verbindung liefern (in Sekunden) */
} /* Conn_GetIdle */
-GLOBAL time_t Conn_LastPing( CONN_ID Idx )
+GLOBAL time_t
+Conn_LastPing( CONN_ID Idx )
{
/* Zeitpunkt des letzten PING liefern */
} /* Conn_LastPing */
-LOCAL BOOLEAN Try_Write( CONN_ID Idx )
+LOCAL BOOLEAN
+Try_Write( CONN_ID Idx )
{
/* Versuchen, Daten aus dem Schreib-Puffer in den
* Socket zu schreiben. */
} /* Try_Write */
-LOCAL VOID Handle_Read( INT Sock )
+LOCAL VOID
+Handle_Read( INT Sock )
{
/* Aktivitaet auf einem Socket verarbeiten:
* - neue Clients annehmen,
New_Connection( Sock );
}
- else if( FD_ISSET( Sock, &My_Resolvers ))
+ else if( FD_ISSET( Sock, &Resolver_FDs ))
{
/* Rueckmeldung von einem Resolver Sub-Prozess */
} /* Handle_Read */
-LOCAL BOOLEAN Handle_Write( CONN_ID Idx )
+LOCAL BOOLEAN
+Handle_Write( CONN_ID Idx )
{
/* Daten aus Schreibpuffer versenden bzw. Connection aufbauen */
} /* Handle_Write */
-LOCAL VOID New_Connection( INT Sock )
+LOCAL VOID
+New_Connection( INT Sock )
{
/* Neue Client-Verbindung von Listen-Socket annehmen und
* CLIENT-Struktur anlegen. */
/* Neuen Socket registrieren */
FD_SET( new_sock, &My_Sockets );
- if( new_sock > My_Max_Fd ) My_Max_Fd = new_sock;
+ if( new_sock > Conn_MaxFD ) Conn_MaxFD = new_sock;
Log( LOG_INFO, "Accepted connection %d from %s:%d on socket %d.", idx, inet_ntoa( new_addr.sin_addr ), ntohs( new_addr.sin_port), Sock );
/* Hostnamen ermitteln */
- s = ResolveAddr( &new_addr );
+ s = Resolve_Addr( &new_addr );
if( s )
{
/* Sub-Prozess wurde asyncron gestartet */
} /* New_Connection */
-LOCAL CONN_ID Socket2Index( INT Sock )
+LOCAL CONN_ID
+Socket2Index( INT Sock )
{
/* zum Socket passende Connection suchen */
} /* Socket2Index */
-LOCAL VOID Read_Request( CONN_ID Idx )
+LOCAL VOID
+Read_Request( CONN_ID Idx )
{
/* Daten von Socket einlesen und entsprechend behandeln.
* Tritt ein Fehler auf, so wird der Socket geschlossen. */
} /* Read_Request */
-LOCAL VOID Handle_Buffer( CONN_ID Idx )
+LOCAL VOID
+Handle_Buffer( CONN_ID Idx )
{
/* Daten im Lese-Puffer einer Verbindung verarbeiten. */
/* Ende der Anfrage wurde gefunden */
*ptr = '\0';
len = ( ptr - My_Connections[Idx].rbuf ) + delta;
- if( len > COMMAND_LEN )
+ if( len > ( COMMAND_LEN - 1 ))
{
/* Eine Anfrage darf(!) nicht laenger als 512 Zeichen
* (incl. CR+LF!) werden; vgl. RFC 2812. Wenn soetwas
} /* Handle_Buffer */
-LOCAL VOID Check_Connections( VOID )
+LOCAL VOID
+Check_Connections( VOID )
{
/* Pruefen, ob Verbindungen noch "alive" sind. Ist dies
* nicht der Fall, zunaechst PING-PONG spielen und, wenn
} /* Check_Connections */
-LOCAL VOID Check_Servers( VOID )
+LOCAL VOID
+Check_Servers( VOID )
{
/* Pruefen, ob Server-Verbindungen aufgebaut werden
* muessen bzw. koennen */
My_Connections[idx].our_server = i;
/* Hostnamen in IP aufloesen */
- s = ResolveName( Conf_Server[i].host );
+ s = Resolve_Name( Conf_Server[i].host );
if( s )
{
/* Sub-Prozess wurde asyncron gestartet */
} /* Check_Servers */
-LOCAL VOID New_Server( INT Server, CONN_ID Idx )
+LOCAL VOID
+New_Server( INT Server, CONN_ID Idx )
{
/* Neue Server-Verbindung aufbauen */
/* Neuen Socket registrieren */
FD_SET( new_sock, &My_Sockets );
FD_SET( new_sock, &My_Connects );
- if( new_sock > My_Max_Fd ) My_Max_Fd = new_sock;
+ if( new_sock > Conn_MaxFD ) Conn_MaxFD = new_sock;
} /* New_Server */
-LOCAL VOID Init_Conn_Struct( INT Idx )
+LOCAL VOID
+Init_Conn_Struct( INT Idx )
{
/* Connection-Struktur initialisieren */
} /* Init_Conn_Struct */
-LOCAL BOOLEAN Init_Socket( INT Sock )
+LOCAL BOOLEAN
+Init_Socket( INT Sock )
{
/* Socket-Optionen setzen */
} /* Init_Socket */
-LOCAL RES_STAT *ResolveAddr( struct sockaddr_in *Addr )
-{
- /* IP (asyncron!) aufloesen. Bei Fehler, z.B. wenn der
- * Child-Prozess nicht erzeugt werden kann, wird NULL geliefert.
- * Der Host kann dann nicht aufgeloest werden. */
-
- RES_STAT *s;
- INT pid;
-
- /* Speicher anfordern */
- s = malloc( sizeof( RES_STAT ));
- if( ! s )
- {
- Log( LOG_EMERG, "Resolver: Can't allocate memory!" );
- return NULL;
- }
-
- /* Pipe fuer Antwort initialisieren */
- if( pipe( s->pipe ) != 0 )
- {
- free( s );
- Log( LOG_ALERT, "Resolver: Can't create output pipe: %s!", strerror( errno ));
- return NULL;
- }
-
- /* Sub-Prozess erzeugen */
- pid = fork( );
- if( pid > 0 )
- {
- /* Haupt-Prozess */
- Log( LOG_DEBUG, "Resolver for %s created (PID %d).", inet_ntoa( Addr->sin_addr ), pid );
- FD_SET( s->pipe[0], &My_Resolvers );
- if( s->pipe[0] > My_Max_Fd ) My_Max_Fd = s->pipe[0];
- s->pid = pid;
- return s;
- }
- else if( pid == 0 )
- {
- /* Sub-Prozess */
- Log_Init_Resolver( );
- Do_ResolveAddr( Addr, s->pipe[1] );
- Log_Exit_Resolver( );
- exit( 0 );
- }
- else
- {
- /* Fehler */
- free( s );
- Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
- return NULL;
- }
-} /* ResolveAddr */
-
-
-LOCAL RES_STAT *ResolveName( CHAR *Host )
+LOCAL VOID
+Read_Resolver_Result( INT r_fd )
{
- /* Hostnamen (asyncron!) aufloesen. Bei Fehler, z.B. wenn der
- * Child-Prozess nicht erzeugt werden kann, wird NULL geliefert.
- * Der Host kann dann nicht aufgeloest werden. */
-
- RES_STAT *s;
- INT pid;
-
- /* Speicher anfordern */
- s = malloc( sizeof( RES_STAT ));
- if( ! s )
- {
- Log( LOG_EMERG, "Resolver: Can't allocate memory!" );
- return NULL;
- }
-
- /* Pipe fuer Antwort initialisieren */
- if( pipe( s->pipe ) != 0 )
- {
- free( s );
- Log( LOG_ALERT, "Resolver: Can't create output pipe: %s!", strerror( errno ));
- return NULL;
- }
-
- /* Sub-Prozess erzeugen */
- pid = fork( );
- if( pid > 0 )
- {
- /* Haupt-Prozess */
- Log( LOG_DEBUG, "Resolver for \"%s\" created (PID %d).", Host, pid );
- FD_SET( s->pipe[0], &My_Resolvers );
- if( s->pipe[0] > My_Max_Fd ) My_Max_Fd = s->pipe[0];
- s->pid = pid;
- return s;
- }
- else if( pid == 0 )
- {
- /* Sub-Prozess */
- Log_Init_Resolver( );
- Do_ResolveName( Host, s->pipe[1] );
- Log_Exit_Resolver( );
- exit( 0 );
- }
- else
- {
- /* Fehler */
- free( s );
- Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
- return NULL;
- }
-} /* ResolveName */
-
-
-LOCAL VOID Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd )
-{
- /* Resolver Sub-Prozess: IP aufloesen und Ergebnis in Pipe schreiben. */
-
- CHAR hostname[HOST_LEN];
- struct hostent *h;
-
- Log_Resolver( LOG_DEBUG, "Now resolving %s ...", inet_ntoa( Addr->sin_addr ));
-
- /* Namen aufloesen */
- h = gethostbyaddr( (CHAR *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
- if( h ) strcpy( hostname, h->h_name );
- else
- {
-#ifdef h_errno
- Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\": %s!", inet_ntoa( Addr->sin_addr ), Resolv_Error( h_errno ));
-#else
- Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\"!", inet_ntoa( Addr->sin_addr ));
-#endif
- strcpy( hostname, inet_ntoa( Addr->sin_addr ));
- }
-
- /* Antwort an Parent schreiben */
- if( write( w_fd, hostname, strlen( hostname ) + 1 ) != ( strlen( hostname ) + 1 ))
- {
- Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
- close( w_fd );
- return;
- }
-
- Log_Resolver( LOG_DEBUG, "Ok, translated %s to \"%s\".", inet_ntoa( Addr->sin_addr ), hostname );
-} /* Do_ResolveAddr */
-
-
-LOCAL VOID Do_ResolveName( CHAR *Host, INT w_fd )
-{
- /* Resolver Sub-Prozess: Name aufloesen und Ergebnis in Pipe schreiben. */
-
- CHAR ip[16];
- struct hostent *h;
- struct in_addr *addr;
-
- Log_Resolver( LOG_DEBUG, "Now resolving \"%s\" ...", Host );
-
- /* Namen aufloesen */
- h = gethostbyname( Host );
- if( h )
- {
- addr = (struct in_addr *)h->h_addr;
- strcpy( ip, inet_ntoa( *addr ));
- }
- else
- {
-#ifdef h_errno
- Log_Resolver( LOG_WARNING, "Can't resolve \"%s\": %s!", Host, Resolv_Error( h_errno ));
-#else
- Log_Resolver( LOG_WARNING, "Can't resolve \"%s\"!", Host );
-#endif
- strcpy( ip, "" );
- }
-
- /* Antwort an Parent schreiben */
- if( write( w_fd, ip, strlen( ip ) + 1 ) != ( strlen( ip ) + 1 ))
- {
- Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
- close( w_fd );
- return;
- }
-
- if( ip[0] ) Log_Resolver( LOG_DEBUG, "Ok, translated \"%s\" to %s.", Host, ip );
-} /* Do_ResolveName */
-
-
-LOCAL VOID Read_Resolver_Result( INT r_fd )
-{
/* Ergebnis von Resolver Sub-Prozess aus Pipe lesen
- * und entsprechende Connection aktualisieren */
+ * und entsprechende Connection aktualisieren */
CHAR result[HOST_LEN];
CLIENT *c;
INT len, i;
- FD_CLR( r_fd, &My_Resolvers );
+ FD_CLR( r_fd, &Resolver_FDs );
/* Anfrage vom Parent lesen */
len = read( r_fd, result, HOST_LEN);
if( i >= MAX_CONNECTIONS )
{
/* Opsa! Keine passende Connection gefunden!? Vermutlich
- * wurde sie schon wieder geschlossen. */
+ * wurde sie schon wieder geschlossen. */
close( r_fd );
Log( LOG_DEBUG, "Resolver: Got result for unknown connection!?" );
return;
} /* Read_Resolver_Result */
-
-#ifdef h_errno
-
-LOCAL CHAR *Resolv_Error( INT H_Error )
-{
- /* Fehlerbeschreibung fuer H_Error liefern */
-
- switch( H_Error )
- {
- case HOST_NOT_FOUND:
- return "host not found";
- case NO_DATA:
- return "name valid but no IP address defined";
- case NO_RECOVERY:
- return "name server error";
- case TRY_AGAIN:
- return "name server temporary not available";
- default:
- return "unknown error";
- }
-} /* Resolv_Error */
-
-#endif
-
-
/* -eof- */
blob - 5e64153b862306d51e61a0d7c65c95dfcc83e68f
blob + ead4a8027b5b4750a5f3b0e1f2c1c47ed01c47ca
--- src/ngircd/conn.h
+++ src/ngircd/conn.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: conn.h,v 1.14 2002/03/29 22:54:35 alex Exp $
+ * $Id: conn.h,v 1.15 2002/05/27 13:09:26 alex Exp $
*
* conn.h: Verwaltung aller Netz-Verbindungen ("connections") (Header)
*/
typedef INT CONN_ID;
-typedef struct _Res_Stat
-{
- INT pid; /* PID des Child-Prozess */
- INT pipe[2]; /* Pipe fuer IPC */
-} RES_STAT;
+GLOBAL VOID Conn_Init PARAMS((VOID ));
+GLOBAL VOID Conn_Exit PARAMS(( VOID ));
-GLOBAL VOID Conn_Init( VOID );
-GLOBAL VOID Conn_Exit( VOID );
+GLOBAL BOOLEAN Conn_NewListener PARAMS(( CONST UINT Port ));
-GLOBAL BOOLEAN Conn_NewListener( CONST UINT Port );
+GLOBAL VOID Conn_Handler PARAMS(( INT Timeout ));
-GLOBAL VOID Conn_Handler( INT Timeout );
+GLOBAL BOOLEAN Conn_Write PARAMS(( CONN_ID Idx, CHAR *Data, INT Len ));
+GLOBAL BOOLEAN Conn_WriteStr PARAMS(( CONN_ID Idx, CHAR *Format, ... ));
-GLOBAL BOOLEAN Conn_Write( CONN_ID Idx, CHAR *Data, INT Len );
-GLOBAL BOOLEAN Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... );
+GLOBAL VOID Conn_Close PARAMS(( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ));
-GLOBAL VOID Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient );
+GLOBAL VOID Conn_UpdateIdle PARAMS(( CONN_ID Idx ));
+GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx ));
+GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx ));
-GLOBAL VOID Conn_UpdateIdle( CONN_ID Idx );
-GLOBAL time_t Conn_GetIdle( CONN_ID Idx );
-GLOBAL time_t Conn_LastPing( CONN_ID Idx );
+GLOBAL INT Conn_MaxFD;
+
#endif
blob - 551c74bd5aa2ca6bd49003de3509bbd521d003dc
blob + 8d6dce0975a2f52c4beab987e6e71524e65c211e
--- src/ngircd/irc-channel.c
+++ src/ngircd/irc-channel.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-channel.c,v 1.5 2002/05/21 00:10:16 alex Exp $
+ * $Id: irc-channel.c,v 1.6 2002/05/27 13:09:26 alex Exp $
*
* irc-channel.c: IRC-Channel-Befehle
*/
#include <string.h>
#include "defines.h"
-#include "irc.h"
-#include "irc-write.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
+#include "lists.h"
#include "log.h"
#include "messages.h"
+#include "parse.h"
+#include "irc.h"
+#include "irc-write.h"
#include "exp.h"
#include "irc-channel.h"
-GLOBAL BOOLEAN IRC_JOIN( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_JOIN( CLIENT *Client, REQUEST *Req )
{
CHAR *channame, *flags, *topic, modes[8];
BOOLEAN is_new_chan;
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Channel-Namen durchgehen */
+ chan = NULL;
channame = strtok( Req->argv[0], "," );
while( channame )
{
if( flags ) *flags++ = '\0';
}
- /* neuer Channel udn lokaler Client? */
- if( is_new_chan && ( Client_Type( Client ) == CLIENT_USER ))
+ /* Lokaler Client? */
+ if( Client_Type( Client ) == CLIENT_USER )
{
- /* Dann soll der Client Channel-Operator werden! */
- flags = "o";
+ /* Existiert der Channel bereits, oder wird er im Moment neu erzeugt? */
+ if( is_new_chan )
+ {
+ /* Erster User im Channel: Operator-Flag setzen */
+ flags = "o";
+ }
+ else
+ {
+ /* Existierenden Channel suchen */
+ chan = Channel_Search( channame );
+ assert( chan != NULL );
+
+ /* Testen, ob Client gebanned ist */
+ if( Lists_CheckBanned( target, chan ))
+ {
+ /* Client ist gebanned: */
+ }
+
+ /* Ist der Channel "invite-only"? */
+ if( strchr( Channel_Modes( chan ), 'i' ))
+ {
+ /* Wurde der Client invited? */
+ if( ! Lists_CheckInvited( target, chan ))
+ {
+ /* Client wurde nicht invited: */
+ }
+ }
+ }
}
/* Channel joinen (und ggf. anlegen) */
channame = strtok( NULL, "," );
continue;
}
- chan = Channel_Search( channame );
+ if( ! chan ) chan = Channel_Search( channame );
assert( chan != NULL );
/* Modes setzen (wenn vorhanden) */
} /* IRC_JOIN */
-GLOBAL BOOLEAN IRC_PART( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_PART( CLIENT *Client, REQUEST *Req )
{
CLIENT *target;
CHAR *chan;
} /* IRC_PART */
-GLOBAL BOOLEAN IRC_TOPIC( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_TOPIC( CLIENT *Client, REQUEST *Req )
{
CHANNEL *chan;
CLIENT *from;
} /* IRC_TOPIC */
-GLOBAL BOOLEAN IRC_LIST( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_LIST( CLIENT *Client, REQUEST *Req )
{
CHAR *pattern;
CHANNEL *chan;
blob - bd85af6e3e8c5b3580f877fdd6f735d241f2becb
blob + 75eee9609eb1072860c5ded10618840d2b4d1db9
--- src/ngircd/irc-channel.h
+++ src/ngircd/irc-channel.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-channel.h,v 1.3 2002/04/23 19:51:14 alex Exp $
+ * $Id: irc-channel.h,v 1.4 2002/05/27 13:09:26 alex Exp $
*
* irc-channel.h: IRC-Channel-Befehle (Header)
*/
#ifndef __irc_channel_h__
#define __irc_channel_h__
-#include "parse.h"
-#include "client.h"
+GLOBAL BOOLEAN IRC_JOIN PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_PART PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_TOPIC PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_JOIN( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_PART( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_TOPIC( CLIENT *Client, REQUEST *Req );
+GLOBAL BOOLEAN IRC_LIST PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_LIST( CLIENT *Client, REQUEST *Req );
#endif
blob - a23788c23ea41871a34d68d70e50f7029c5ae6cf
blob + 73fa034d3c32a714acc3d3a19ab74485a1bcba75
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-login.c,v 1.13 2002/04/14 14:02:35 alex Exp $
+ * $Id: irc-login.c,v 1.14 2002/05/27 13:09:26 alex Exp $
*
* irc-login.c: Anmeldung und Abmeldung im IRC
*/
#include <string.h>
#include "ngircd.h"
+#include "resolve.h"
#include "conf.h"
-#include "irc.h"
-#include "irc-write.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
#include "log.h"
#include "messages.h"
+#include "parse.h"
+#include "irc.h"
+#include "irc-write.h"
#include "exp.h"
#include "irc-login.h"
-LOCAL BOOLEAN Hello_User( CLIENT *Client );
-LOCAL VOID Kill_Nick( CHAR *Nick, CHAR *Reason );
+LOCAL BOOLEAN Hello_User PARAMS(( CLIENT *Client ));
+LOCAL VOID Kill_Nick PARAMS(( CHAR *Nick, CHAR *Reason ));
-GLOBAL BOOLEAN IRC_PASS( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_PASS( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
} /* IRC_PASS */
-GLOBAL BOOLEAN IRC_NICK( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_NICK( CLIENT *Client, REQUEST *Req )
{
CLIENT *intr_c, *target, *c;
CHAR *modes;
} /* IRC_NICK */
-GLOBAL BOOLEAN IRC_USER( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_USER( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
} /* IRC_USER */
-GLOBAL BOOLEAN IRC_QUIT( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_QUIT( CLIENT *Client, REQUEST *Req )
{
CLIENT *target;
} /* IRC_QUIT */
-GLOBAL BOOLEAN IRC_PING( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_PING( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *from;
} /* IRC_PING */
-GLOBAL BOOLEAN IRC_PONG( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_PONG( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *from;
} /* IRC_PONG */
-LOCAL BOOLEAN Hello_User( CLIENT *Client )
+LOCAL BOOLEAN
+Hello_User( CLIENT *Client )
{
assert( Client != NULL );
} /* Hello_User */
-LOCAL VOID Kill_Nick( CHAR *Nick, CHAR *Reason )
+LOCAL VOID
+Kill_Nick( CHAR *Nick, CHAR *Reason )
{
CLIENT *c;
blob - 8577d02166e5f24dbca2ca2344c1c4984cf3bb3d
blob + 405d540e2ce041b2548d69807535b39e62a2e0e9
--- src/ngircd/irc-login.h
+++ src/ngircd/irc-login.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-login.h,v 1.3 2002/03/12 14:37:52 alex Exp $
+ * $Id: irc-login.h,v 1.4 2002/05/27 13:09:27 alex Exp $
*
* irc-login.h: Anmeldung und Abmeldung im IRC (Header)
*/
#ifndef __irc_login_h__
#define __irc_login_h__
-#include "parse.h"
-#include "client.h"
+GLOBAL BOOLEAN IRC_PASS PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_NICK PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_USER PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_PING PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_PONG PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_QUIT PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_PASS( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_NICK( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_USER( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_PING( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_PONG( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_QUIT( CLIENT *Client, REQUEST *Req );
-
#endif
blob - ca638fb41768690d01267af487fa0c1ce453c69b
blob + d817bf3c3957b6f6410afc412b08e24de8b6dbd9
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-mode.c,v 1.5 2002/05/21 00:10:16 alex Exp $
+ * $Id: irc-mode.c,v 1.6 2002/05/27 13:09:27 alex Exp $
*
* irc-mode.c: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...)
*/
#include <assert.h>
#include <string.h>
+#include "conn.h"
+#include "client.h"
#include "channel.h"
#include "defines.h"
#include "irc-write.h"
#include "log.h"
+#include "parse.h"
#include "messages.h"
#include "exp.h"
#include "irc-mode.h"
-GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_MODE( CLIENT *Client, REQUEST *Req )
{
CHAR *mode_ptr, the_modes[CLIENT_MODE_LEN], x[2];
CLIENT *cl, *chan_cl, *prefix;
/* invisible */
x[0] = 'i';
break;
- case 'r':
- /* restricted (kann nur gesetzt werden) */
- if( set ) x[0] = 'r';
- else ok = IRC_WriteStrClient( Client, ERR_RESTRICTED_MSG, Client_ID( Client ));
- break;
case 'o':
/* operator (kann nur geloescht werden) */
if( ! set )
}
else ok = IRC_WriteStrClient( Client, ERR_UMODEUNKNOWNFLAG_MSG, Client_ID( Client ));
break;
+ case 'r':
+ /* restricted (kann nur gesetzt werden) */
+ if( set ) x[0] = 'r';
+ else ok = IRC_WriteStrClient( Client, ERR_RESTRICTED_MSG, Client_ID( Client ));
+ break;
case 's':
/* server messages */
x[0] = 's';
/* Anonymous */
x[0] = 'a';
break;
+ case 'i':
+ /* Invite-Only */
+ x[0] = 'i';
+ break;
case 'm':
/* Moderated */
x[0] = 'm';
} /* IRC_MODE */
-GLOBAL BOOLEAN IRC_AWAY( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_AWAY( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
blob - 2b53664d0416c70bada00e4a8f888b17fae3b4bf
blob + 028b33a08f1e801109d8d614bf299de4c402825a
--- src/ngircd/irc-mode.h
+++ src/ngircd/irc-mode.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-mode.h,v 1.3 2002/04/04 13:03:11 alex Exp $
+ * $Id: irc-mode.h,v 1.4 2002/05/27 13:09:27 alex Exp $
*
* irc-mode.h: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...) (Header)
*/
#ifndef __irc_mode_h__
#define __irc_mode_h__
-#include "parse.h"
-#include "client.h"
+GLOBAL BOOLEAN IRC_MODE PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_AWAY PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_AWAY( CLIENT *Client, REQUEST *Req );
-
#endif
blob - b58d16fb253ac1384a9a8c46e0ca9375d4ca56cd
blob + 57b69bdaf508b8dc7f0b599356a9edd32c310ca3
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-oper.c,v 1.4 2002/04/04 13:03:39 alex Exp $
+ * $Id: irc-oper.c,v 1.5 2002/05/27 13:09:27 alex Exp $
*
* irc-oper.c: IRC-Operator-Befehle
*/
#include <string.h>
#include "ngircd.h"
+#include "resolve.h"
#include "conf.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
#include "irc-write.h"
#include "log.h"
#include "messages.h"
+#include "parse.h"
#include <exp.h>
#include "irc-oper.h"
-GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_OPER( CLIENT *Client, REQUEST *Req )
{
INT i;
} /* IRC_OPER */
-GLOBAL BOOLEAN IRC_DIE( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_DIE( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
} /* IRC_DIE */
-GLOBAL BOOLEAN IRC_RESTART( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_RESTART( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
blob - 9c8f2dabc7c9e9618f7702480190bcc0c0d1479b
blob + b1ce132fe554f228e5b6048e72147cfa4215917d
--- src/ngircd/irc-oper.h
+++ src/ngircd/irc-oper.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-oper.h,v 1.2 2002/03/12 14:37:52 alex Exp $
+ * $Id: irc-oper.h,v 1.3 2002/05/27 13:09:27 alex Exp $
*
* irc-oper.h: IRC-Operator-Befehle (Header)
*/
#ifndef __irc_oper_h__
#define __irc_oper_h__
-#include "parse.h"
-#include "client.h"
+GLOBAL BOOLEAN IRC_OPER PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_DIE PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_RESTART PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_DIE( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_RESTART( CLIENT *Client, REQUEST *Req );
-
#endif
blob - 9d5a1c1ca024cfe6c9737198393658a68731438f
blob + ed03b6ff928710c0036b55b060072f524c9e3fd7
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-server.c,v 1.9 2002/04/08 01:20:14 alex Exp $
+ * $Id: irc-server.c,v 1.10 2002/05/27 13:09:27 alex Exp $
*
* irc-server.c: IRC-Befehle fuer Server-Links
*/
#include <stdlib.h>
#include <string.h>
+#include "resolve.h"
#include "conf.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
#include "irc-write.h"
#include "log.h"
#include "messages.h"
+#include "parse.h"
#include "exp.h"
#include "irc-server.h"
-GLOBAL BOOLEAN IRC_SERVER( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_SERVER( CLIENT *Client, REQUEST *Req )
{
CHAR str[LINE_LEN], *ptr;
CLIENT *from, *c, *cl;
} /* IRC_SERVER */
-GLOBAL BOOLEAN IRC_NJOIN( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_NJOIN( CLIENT *Client, REQUEST *Req )
{
CHAR *channame, *ptr, modes[8];
BOOLEAN is_op, is_voiced;
} /* IRC_NJOIN */
-GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_SQUIT( CLIENT *Client, REQUEST *Req )
{
CLIENT *target;
CHAR msg[LINE_LEN + 64];
blob - 5edbcb79f57299829403ff1278d44f3a0ba55f2f
blob + fcb0b98a9a250c04efe09fe06f1de255d6ddfde0
--- src/ngircd/irc-server.h
+++ src/ngircd/irc-server.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-server.h,v 1.2 2002/03/12 14:37:52 alex Exp $
+ * $Id: irc-server.h,v 1.3 2002/05/27 13:09:27 alex Exp $
*
* irc-server.h: IRC-Befehle fuer Server-Links (Header)
*/
#ifndef __irc_server_h__
#define __irc_server_h__
-#include "parse.h"
-#include "client.h"
+GLOBAL BOOLEAN IRC_SERVER PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_NJOIN PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_SQUIT PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_SERVER( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_NJOIN( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req );
-
#endif
blob - b2af957fe50b6931516bc5c52d0356af735897cd
blob + 0e062f2cbd9a5b7dfcc874e754afef3610c258ee
--- src/ngircd/irc-write.c
+++ src/ngircd/irc-write.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-write.c,v 1.3 2002/03/25 17:13:07 alex Exp $
+ * $Id: irc-write.c,v 1.4 2002/05/27 13:09:27 alex Exp $
*
* irc-write.c: IRC-Texte und Befehle ueber Netzwerk versenden
*/
#include <stdarg.h>
#include <stdio.h>
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
#include "defines.h"
#include "exp.h"
#include "irc-write.h"
-LOCAL CHAR *Get_Prefix( CLIENT *Target, CLIENT *Client );
+LOCAL CHAR *Get_Prefix PARAMS(( CLIENT *Target, CLIENT *Client ));
-GLOBAL BOOLEAN IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... )
+GLOBAL BOOLEAN
+IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... )
{
CHAR buffer[1000];
BOOLEAN ok = CONNECTED;
} /* IRC_WriteStrClient */
-GLOBAL BOOLEAN IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... )
+GLOBAL BOOLEAN
+IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... )
{
/* Text an Clients, lokal bzw. remote, senden. */
} /* IRC_WriteStrClientPrefix */
-GLOBAL BOOLEAN IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... )
+GLOBAL BOOLEAN
+IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... )
{
CHAR buffer[1000];
va_list ap;
} /* IRC_WriteStrChannel */
-GLOBAL BOOLEAN IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
+GLOBAL BOOLEAN
+IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
{
BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED;
CHAR buffer[1000];
} /* IRC_WriteStrChannelPrefix */
-GLOBAL VOID IRC_WriteStrServers( CLIENT *ExceptOf, CHAR *Format, ... )
+GLOBAL VOID
+IRC_WriteStrServers( CLIENT *ExceptOf, CHAR *Format, ... )
{
CHAR buffer[1000];
va_list ap;
} /* IRC_WriteStrServers */
-GLOBAL VOID IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... )
+GLOBAL VOID
+IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... )
{
CHAR buffer[1000];
CLIENT *c;
} /* IRC_WriteStrServersPrefix */
-GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
+GLOBAL BOOLEAN
+IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
{
BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED;
CL2CHAN *chan_cl2chan, *cl2chan;
} /* IRC_WriteStrRelatedPrefix */
-LOCAL CHAR *Get_Prefix( CLIENT *Target, CLIENT *Client )
+LOCAL CHAR *
+Get_Prefix( CLIENT *Target, CLIENT *Client )
{
assert( Target != NULL );
assert( Client != NULL );
blob - 116a621cb6b1ace31fea58d854b371070ee5334f
blob + 4b73f9ab5798dda07ee0e84cc0602fad06242f9d
--- src/ngircd/irc-write.h
+++ src/ngircd/irc-write.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-write.h,v 1.2 2002/03/12 14:37:52 alex Exp $
+ * $Id: irc-write.h,v 1.3 2002/05/27 13:09:27 alex Exp $
*
* irc-write.h: IRC-Texte und Befehle ueber Netzwerk versenden (Header)
*/
#ifndef __irc_write_h__
#define __irc_write_h__
-#include "channel.h"
+GLOBAL BOOLEAN IRC_WriteStrClient PARAMS((CLIENT *Client, CHAR *Format, ... ));
+GLOBAL BOOLEAN IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... ));
-GLOBAL BOOLEAN IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... );
-GLOBAL BOOLEAN IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... );
+GLOBAL BOOLEAN IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... ));
+GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
-GLOBAL BOOLEAN IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... );
-GLOBAL BOOLEAN IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... );
+GLOBAL VOID IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, CHAR *Format, ... ));
+GLOBAL VOID IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ));
-GLOBAL VOID IRC_WriteStrServers( CLIENT *ExceptOf, CHAR *Format, ... );
-GLOBAL VOID IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... );
+GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
-GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... );
-
#endif
blob - 716d52c0ee2259fdf94e2bba134f61e3a00c8f2b
blob + eadfe1543f108468c6ccd41b69dbe8907e168095
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc.c,v 1.89 2002/03/25 17:04:02 alex Exp $
+ * $Id: irc.c,v 1.90 2002/05/27 13:09:27 alex Exp $
*
* irc.c: IRC-Befehle
*/
#include <string.h>
#include "ngircd.h"
-#include "channel.h"
+#include "conn.h"
#include "client.h"
+#include "channel.h"
+#include "resolve.h"
#include "conf.h"
#include "conn.h"
#include "irc-write.h"
#include "log.h"
#include "messages.h"
+#include "parse.h"
#include "tool.h"
#include "exp.h"
#include "irc.h"
-GLOBAL BOOLEAN IRC_MOTD( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_MOTD( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
} /* IRC_MOTD */
-GLOBAL BOOLEAN IRC_PRIVMSG( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_PRIVMSG( CLIENT *Client, REQUEST *Req )
{
CLIENT *cl, *from;
CHANNEL *chan;
} /* IRC_PRIVMSG */
-GLOBAL BOOLEAN IRC_NOTICE( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_NOTICE( CLIENT *Client, REQUEST *Req )
{
CLIENT *to, *from;
} /* IRC_NOTICE */
-GLOBAL BOOLEAN IRC_NAMES( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_NAMES( CLIENT *Client, REQUEST *Req )
{
CHAR rpl[COMMAND_LEN], *ptr;
CLIENT *target, *from, *c;
} /* IRC_NAMES */
-GLOBAL BOOLEAN IRC_ISON( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_ISON( CLIENT *Client, REQUEST *Req )
{
CHAR rpl[COMMAND_LEN];
CLIENT *c;
} /* IRC_ISON */
-GLOBAL BOOLEAN IRC_WHOIS( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_WHOIS( CLIENT *Client, REQUEST *Req )
{
CLIENT *from, *target, *c;
CHAR str[LINE_LEN + 1], *ptr = NULL;
} /* IRC_WHOIS */
-GLOBAL BOOLEAN IRC_WHO( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_WHO( CLIENT *Client, REQUEST *Req )
{
BOOLEAN ok, only_ops;
CHAR flags[8], *ptr;
} /* IRC_WHO */
-GLOBAL BOOLEAN IRC_USERHOST( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_USERHOST( CLIENT *Client, REQUEST *Req )
{
CHAR rpl[COMMAND_LEN];
CLIENT *c;
} /* IRC_USERHOST */
-GLOBAL BOOLEAN IRC_ERROR( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_ERROR( CLIENT *Client, REQUEST *Req )
{
assert( Client != NULL );
assert( Req != NULL );
} /* IRC_ERROR */
-GLOBAL BOOLEAN IRC_LUSERS( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_LUSERS( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *from;
} /* IRC_LUSERS */
-GLOBAL BOOLEAN IRC_LINKS( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_LINKS( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *from, *c;
CHAR *mask;
} /* IRC_LINKS */
-GLOBAL BOOLEAN IRC_VERSION( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_VERSION( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *prefix;
} /* IRC_VERSION */
-GLOBAL BOOLEAN IRC_KILL( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_KILL( CLIENT *Client, REQUEST *Req )
{
CLIENT *prefix, *c;
} /* IRC_KILL */
-GLOBAL BOOLEAN IRC_Show_MOTD( CLIENT *Client )
+GLOBAL BOOLEAN
+IRC_Show_MOTD( CLIENT *Client )
{
BOOLEAN ok;
CHAR line[127];
} /* IRC_Show_MOTD */
-GLOBAL BOOLEAN IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
+GLOBAL BOOLEAN
+IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
{
BOOLEAN is_visible, is_member;
CHAR str[LINE_LEN + 1];
} /* IRC_Send_NAMES */
-GLOBAL BOOLEAN IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps )
+GLOBAL BOOLEAN
+IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps )
{
BOOLEAN is_visible, is_member;
CL2CHAN *cl2chan;
} /* IRC_Send_WHO */
-GLOBAL BOOLEAN IRC_Send_LUSERS( CLIENT *Client )
+GLOBAL BOOLEAN
+IRC_Send_LUSERS( CLIENT *Client )
{
INT cnt;
blob - 90e0326a7382a379dff8eed6d330dc8f906b91e4
blob + f65148e91629bd85420e2f6ae520620a8ecd35a7
--- src/ngircd/irc.h
+++ src/ngircd/irc.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc.h,v 1.30 2002/03/12 14:37:52 alex Exp $
+ * $Id: irc.h,v 1.31 2002/05/27 13:09:27 alex Exp $
*
* irc.h: IRC-Befehle (Header)
*/
#ifndef __irc_h__
#define __irc_h__
-#include "parse.h"
-#include "client.h"
-#include "channel.h"
+GLOBAL BOOLEAN IRC_MOTD PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_LUSERS PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_LINKS PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_VERSION PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_MOTD( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_LUSERS( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_LINKS( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_VERSION( CLIENT *Client, REQUEST *Req );
+GLOBAL BOOLEAN IRC_PRIVMSG PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_NOTICE PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_PRIVMSG( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_NOTICE( CLIENT *Client, REQUEST *Req );
+GLOBAL BOOLEAN IRC_NAMES PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_ISON PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_WHOIS PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_USERHOST PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_WHO PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_NAMES( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_ISON( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_WHOIS( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_USERHOST( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_WHO( CLIENT *Client, REQUEST *Req );
+GLOBAL BOOLEAN IRC_ERROR PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_KILL PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_ERROR( CLIENT *Client, REQUEST *Req );
-GLOBAL BOOLEAN IRC_KILL( CLIENT *Client, REQUEST *Req );
+GLOBAL BOOLEAN IRC_Send_NAMES PARAMS((CLIENT *Client, CHANNEL *Chan ));
+GLOBAL BOOLEAN IRC_Send_LUSERS PARAMS((CLIENT *Client ));
+GLOBAL BOOLEAN IRC_Show_MOTD PARAMS((CLIENT *Client ));
+GLOBAL BOOLEAN IRC_Send_WHO PARAMS((CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps ));
-GLOBAL BOOLEAN IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan );
-GLOBAL BOOLEAN IRC_Send_LUSERS( CLIENT *Client );
-GLOBAL BOOLEAN IRC_Show_MOTD( CLIENT *Client );
-GLOBAL BOOLEAN IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps );
-
#endif
blob - d1678660498a6a0871c8b7434a849d6d08b81d38
blob + 1cf83c31c7e1925424edcaf1cdb2f0679da277f5
--- src/ngircd/log.c
+++ src/ngircd/log.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: log.c,v 1.32 2002/03/31 16:46:15 alex Exp $
+ * $Id: log.c,v 1.33 2002/05/27 13:09:27 alex Exp $
*
* log.c: Logging-Funktionen
*/
#endif
#include "ngircd.h"
-#include "client.h"
#include "defines.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
#include "irc-write.h"
#include "exp.h"
LOCAL CHAR Init_Txt[127];
-LOCAL VOID Wall_ServerNotice( CHAR *Msg );
+LOCAL VOID Wall_ServerNotice PARAMS(( CHAR *Msg ));
-GLOBAL VOID Log_Init( VOID )
+GLOBAL VOID
+Log_Init( VOID )
{
#ifdef USE_SYSLOG
/* Syslog initialisieren */
} /* Log_Init */
-GLOBAL VOID Log_InitErrorfile( VOID )
+GLOBAL VOID
+Log_InitErrorfile( VOID )
{
/* "Error-Log" initialisieren: stderr in Datei umlenken. Dort
* landen z.B. alle Ausgaben von assert()-Aufrufen. */
} /* Log_InitErrfile */
-GLOBAL VOID Log_Exit( VOID )
+GLOBAL VOID
+Log_Exit( VOID )
{
/* Good Bye! */
Log( LOG_NOTICE, PACKAGE" done.");
} /* Log_Exit */
-GLOBAL VOID Log( INT Level, CONST CHAR *Format, ... )
+GLOBAL VOID
+Log( INT Level, CONST CHAR *Format, ... )
{
/* Eintrag in Logfile(s) schreiben */
} /* Log */
-GLOBAL VOID Log_Init_Resolver( VOID )
+GLOBAL VOID
+Log_Init_Resolver( VOID )
{
#ifdef USE_SYSLOG
openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 );
} /* Log_Init_Resolver */
-GLOBAL VOID Log_Exit_Resolver( VOID )
+GLOBAL VOID
+Log_Exit_Resolver( VOID )
{
#ifdef USE_SYSLOG
closelog( );
} /* Log_Exit_Resolver */
-GLOBAL VOID Log_Resolver( CONST INT Level, CONST CHAR *Format, ... )
+GLOBAL VOID
+Log_Resolver( CONST INT Level, CONST CHAR *Format, ... )
{
/* Eintrag des Resolver in Logfile(s) schreiben */
} /* Log_Resolver */
-LOCAL VOID Wall_ServerNotice( CHAR *Msg )
+LOCAL VOID
+Wall_ServerNotice( CHAR *Msg )
{
/* Server-Notice an entsprechende User verschicken */
blob - a0f6dbb250b1f174e371c6394d63c2b5eef23f77
blob + 85f0640c1f5d2408f9260e5e6a043c539c609e48
--- src/ngircd/log.h
+++ src/ngircd/log.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: log.h,v 1.11 2002/03/29 23:33:42 alex Exp $
+ * $Id: log.h,v 1.12 2002/05/27 13:09:27 alex Exp $
*
* log.h: Logging-Funktionen (Header)
*/
#define LOG_snotice 1024
-GLOBAL VOID Log_Init( VOID );
-GLOBAL VOID Log_Exit( VOID );
+GLOBAL VOID Log_Init PARAMS((VOID ));
+GLOBAL VOID Log_Exit PARAMS((VOID ));
-GLOBAL VOID Log_InitErrorfile( VOID );
-GLOBAL VOID Log( INT Level, CONST CHAR *Format, ... );
+GLOBAL VOID Log_InitErrorfile PARAMS((VOID ));
+GLOBAL VOID Log PARAMS((INT Level, CONST CHAR *Format, ... ));
-GLOBAL VOID Log_Init_Resolver( VOID );
-GLOBAL VOID Log_Exit_Resolver( VOID );
+GLOBAL VOID Log_Init_Resolver PARAMS((VOID ));
+GLOBAL VOID Log_Exit_Resolver PARAMS((VOID ));
-GLOBAL VOID Log_Resolver( CONST INT Level, CONST CHAR *Format, ... );
+GLOBAL VOID Log_Resolver PARAMS((CONST INT Level, CONST CHAR *Format, ... ));
#endif
blob - 3ae7425941c142a947cd799fbb25e15ff3cf433b
blob + b22e46ceb5bcccb499fb64ad44d15fa1c2573d3c
--- src/ngircd/ngircd.h
+++ src/ngircd/ngircd.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: ngircd.h,v 1.12 2002/03/27 16:40:31 alex Exp $
+ * $Id: ngircd.h,v 1.13 2002/05/27 13:09:27 alex Exp $
*
* ngircd.h: Prototypen aus dem "Haupt-Modul"
*/
GLOBAL CHAR NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
-GLOBAL CHAR *NGIRCd_Version( VOID );
-GLOBAL CHAR *NGIRCd_VersionAddition( VOID );
+GLOBAL CHAR *NGIRCd_Version PARAMS((VOID ));
+GLOBAL CHAR *NGIRCd_VersionAddition PARAMS((VOID ));
#endif
blob - a1348fe2d45333acfa69b4d106b71e205f55d29b
blob + dc2d464a3d3fe729cfdf70a4cce839d6699a3c1f
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: parse.c,v 1.32 2002/04/23 19:50:27 alex Exp $
+ * $Id: parse.c,v 1.33 2002/05/27 13:09:27 alex Exp $
*
* parse.c: Parsen der Client-Anfragen
*/
#include <string.h>
#include "ngircd.h"
-#include "client.h"
-#include "conn.h"
#include "defines.h"
+#include "conn.h"
+#include "client.h"
+#include "channel.h"
+#include "log.h"
+#include "messages.h"
+#include "tool.h"
+
+#include "exp.h"
+#include "parse.h"
+
+#include "imp.h"
#include "irc.h"
#include "irc-channel.h"
#include "irc-login.h"
#include "irc-mode.h"
+#include "irc-op.h"
#include "irc-oper.h"
#include "irc-server.h"
#include "irc-write.h"
-#include "log.h"
-#include "messages.h"
-#include "tool.h"
#include "exp.h"
-#include "parse.h"
-LOCAL VOID Init_Request( REQUEST *Req );
+LOCAL VOID Init_Request PARAMS(( REQUEST *Req ));
-LOCAL BOOLEAN Parse_Error( CONN_ID Idx, CHAR *Error );
+LOCAL BOOLEAN Parse_Error PARAMS(( CONN_ID Idx, CHAR *Error ));
-LOCAL BOOLEAN Validate_Prefix( REQUEST *Req );
-LOCAL BOOLEAN Validate_Command( REQUEST *Req );
-LOCAL BOOLEAN Validate_Args( REQUEST *Req );
+LOCAL BOOLEAN Validate_Prefix PARAMS(( REQUEST *Req ));
+LOCAL BOOLEAN Validate_Command PARAMS(( REQUEST *Req ));
+LOCAL BOOLEAN Validate_Args PARAMS(( REQUEST *Req ));
-LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req );
+LOCAL BOOLEAN Handle_Request PARAMS(( CONN_ID Idx, REQUEST *Req ));
-GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request )
+GLOBAL BOOLEAN
+Parse_Request( CONN_ID Idx, CHAR *Request )
{
/* Client-Request parsen. Bei einem schwerwiegenden Fehler wird
* die Verbindung geschlossen und FALSE geliefert.
} /* Parse_Request */
-LOCAL VOID Init_Request( REQUEST *Req )
+LOCAL VOID
+Init_Request( REQUEST *Req )
{
/* Neue Request-Struktur initialisieren */
} /* Init_Request */
-LOCAL BOOLEAN Parse_Error( CONN_ID Idx, CHAR *Error )
+LOCAL BOOLEAN
+Parse_Error( CONN_ID Idx, CHAR *Error )
{
/* Fehler beim Parsen. Fehlermeldung an den Client schicken.
* TRUE: Connection wurde durch diese Funktion nicht geschlossen,
} /* Parse_Error */
-LOCAL BOOLEAN Validate_Prefix( REQUEST *Req )
+LOCAL BOOLEAN
+Validate_Prefix( REQUEST *Req )
{
assert( Req != NULL );
return TRUE;
} /* Validate_Prefix */
-LOCAL BOOLEAN Validate_Command( REQUEST *Req )
+LOCAL BOOLEAN
+Validate_Command( REQUEST *Req )
{
assert( Req != NULL );
return TRUE;
} /* Validate_Comman */
-LOCAL BOOLEAN Validate_Args( REQUEST *Req )
+LOCAL BOOLEAN
+Validate_Args( REQUEST *Req )
{
assert( Req != NULL );
return TRUE;
} /* Validate_Args */
-LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
+LOCAL BOOLEAN
+Handle_Request( CONN_ID Idx, REQUEST *Req )
{
/* Client-Request verarbeiten. Bei einem schwerwiegenden Fehler
* wird die Verbindung geschlossen und FALSE geliefert. */
else if( strcasecmp( Req->command, "TOPIC" ) == 0 ) return IRC_TOPIC( client, Req );
else if( strcasecmp( Req->command, "WHO" ) == 0 ) return IRC_WHO( client, Req );
else if( strcasecmp( Req->command, "LIST" ) == 0 ) return IRC_LIST( client, Req );
+ else if( strcasecmp( Req->command, "INVITE" ) == 0 ) return IRC_INVITE( client, Req );
+ else if( strcasecmp( Req->command, "KICK" ) == 0 ) return IRC_KICK( client, Req );
+ else if( strcasecmp( Req->command, "BAN" ) == 0 ) return IRC_BAN( client, Req );
/* Unbekannter Befehl */
if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );
blob - 7810adb83b603d05e661204613ff09b1e43eeec5
blob + 0b9e64935952da45335766f0dcb7a3f9a5022ca9
--- src/ngircd/parse.h
+++ src/ngircd/parse.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: parse.h,v 1.6 2002/03/12 14:37:52 alex Exp $
+ * $Id: parse.h,v 1.7 2002/05/27 13:09:27 alex Exp $
*
* parse.h: Parsen der Client-Anfragen (Header)
*/
#ifndef __parse_h__
#define __parse_h__
-#include "conn.h"
-
typedef struct _REQUEST /* vgl. RFC 2812, 2.3 */
{
CHAR *prefix; /* Prefix */
} REQUEST;
-GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request );
+GLOBAL BOOLEAN Parse_Request PARAMS((CONN_ID Idx, CHAR *Request ));
#endif
blob - ed5abb86bc9c8279d3f94b1a048e1a9ceb81fe78
blob + 0923ec3fa8019360ae9b85ba9fdb02bcf8b6a1b7
--- src/ngircd/tool.c
+++ src/ngircd/tool.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: tool.c,v 1.8 2002/03/22 00:17:27 alex Exp $
+ * $Id: tool.c,v 1.9 2002/05/27 13:09:27 alex Exp $
*
* tool.c: Hilfsfunktionen, ggf. Platformabhaengig
*/
#include "tool.h"
-GLOBAL VOID ngt_TrimStr( CHAR *String )
+GLOBAL VOID
+ngt_TrimStr( CHAR *String )
{
/* Mit ngt_TrimStr() werden fuehrende und folgende Leerzeichen,
* Tabulatoren und Zeilenumbrueche (ASCII 10 und ASCII 13) aus
} /* ngt_TrimStr */
-GLOBAL CHAR *ngt_LowerStr( CHAR *String )
+GLOBAL CHAR *
+ngt_LowerStr( CHAR *String )
{
/* String in Kleinbuchstaben konvertieren. Der uebergebene
* Speicherbereich wird durch das Ergebnis ersetzt, zusaetzlich
blob - b72cb86a3160c333395f1ff8033d83b49af2a6a8
blob + 152e94eb9ad98b54ea455c53d91286ac12a5a129
--- src/ngircd/tool.h
+++ src/ngircd/tool.h
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: tool.h,v 1.7 2002/03/22 00:17:27 alex Exp $
+ * $Id: tool.h,v 1.8 2002/05/27 13:09:27 alex Exp $
*
* log.h: Hilfsfunktionen (Header)
*/
#define __tool_h__
-GLOBAL VOID ngt_TrimStr( CHAR *String );
+GLOBAL VOID ngt_TrimStr PARAMS((CHAR *String ));
-GLOBAL CHAR *ngt_LowerStr( CHAR *String );
+GLOBAL CHAR *ngt_LowerStr PARAMS((CHAR *String ));
#endif