]> arthur.barton.de Git - ngircd-alex.git/commitdiff
add const qualifier to pointers where possible
authorFlorian Westphal <fw@strlen.de>
Sat, 11 Apr 2009 23:09:42 +0000 (01:09 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 21 Apr 2009 18:58:23 +0000 (20:58 +0200)
src/ngircd/channel.c
src/ngircd/channel.h
src/ngircd/client.c
src/ngircd/client.h
src/ngircd/conf.c
src/ngircd/conf.h
src/ngircd/conn-zip.c
src/ngircd/conn-zip.h
src/ngircd/conn.c
src/ngircd/conn.h

index 0a1ba4552b59b1043b988fe9d316f3b184815075..6f8507244501853c7b72b767864e5b250bd3fcf3 100644 (file)
@@ -198,7 +198,7 @@ Channel_Exit( void )
  * Add_Client().
  */
 GLOBAL bool
-Channel_Join( CLIENT *Client, char *Name )
+Channel_Join( CLIENT *Client, const char *Name )
 {
        CHANNEL *chan;
 
@@ -325,7 +325,7 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
 
 
 GLOBAL void
-Channel_Quit( CLIENT *Client, char *Reason )
+Channel_Quit( CLIENT *Client, const char *Reason )
 {
        CHANNEL *c, *next_c;
 
@@ -731,7 +731,7 @@ Channel_SetTopic(CHANNEL *Chan, CLIENT *Client, const char *Topic)
 
 
 GLOBAL void
-Channel_SetModes( CHANNEL *Chan, char *Modes )
+Channel_SetModes( CHANNEL *Chan, const char *Modes )
 {
        assert( Chan != NULL );
        assert( Modes != NULL );
@@ -1042,7 +1042,7 @@ Channel_ShowInvites( CLIENT *Client, CHANNEL *Channel )
  * Log a message to the local &SERVER channel, if it exists.
  */
 GLOBAL void
-Channel_LogServer(char *msg)
+Channel_LogServer(const char *msg)
 {
        CHANNEL *sc;
        CLIENT *c;
index b41cced2a26355519f0770560143bc99c31788c6..46e7e13a8df2f233f1f5ab0cb2c2fc93ca99ed42 100644 (file)
@@ -62,10 +62,10 @@ GLOBAL void Channel_Init PARAMS(( void ));
 GLOBAL void Channel_InitPredefined PARAMS((  void ));
 GLOBAL void Channel_Exit PARAMS(( void ));
 
-GLOBAL bool Channel_Join PARAMS(( CLIENT *Client, char *Name ));
+GLOBAL bool Channel_Join PARAMS(( CLIENT *Client, const 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_Quit PARAMS(( CLIENT *Client, const char *Reason ));
 
 GLOBAL void Channel_Kick PARAMS((CLIENT *Peer, CLIENT *Target, CLIENT *Origin,
                                 const char *Name, const char *Reason));
@@ -81,7 +81,7 @@ GLOBAL char *Channel_Key PARAMS(( CHANNEL *Chan ));
 GLOBAL unsigned long Channel_MaxUsers PARAMS(( CHANNEL *Chan ));
 
 GLOBAL void Channel_SetTopic PARAMS(( CHANNEL *Chan, CLIENT *Client, const char *Topic ));
-GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, char *Modes ));
+GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, const char *Modes ));
 GLOBAL void Channel_SetKey PARAMS(( CHANNEL *Chan, const char *Key ));
 GLOBAL void Channel_SetMaxUsers PARAMS(( CHANNEL *Chan, unsigned long Count ));
 
@@ -126,7 +126,7 @@ GLOBAL bool Channel_AddBan PARAMS((CHANNEL *c, const char *Mask ));
 GLOBAL bool Channel_ShowBans PARAMS((CLIENT *client, CHANNEL *c));
 GLOBAL bool Channel_ShowInvites PARAMS((CLIENT *client, CHANNEL *c));
 
-GLOBAL void Channel_LogServer PARAMS((char *msg));
+GLOBAL void Channel_LogServer PARAMS((const char *msg));
 
 GLOBAL bool Channel_CheckKey PARAMS((CHANNEL *Chan, CLIENT *Client,
                                     const char *Key));
index fbe130a13a9c0267926e8568263eafabaf592330..076a0cb425f17c976be9b92e0e38649b9f688ab0 100644 (file)
@@ -64,12 +64,12 @@ static void Generate_MyToken PARAMS(( CLIENT *Client ));
 static void Adjust_Counters PARAMS(( CLIENT *Client ));
 
 static CLIENT *Init_New_Client PARAMS((CONN_ID Idx, CLIENT *Introducer,
-                                      CLIENT *TopServer, int Type, char *ID,
-                                      char *User, char *Hostname, char *Info,
-                                      int Hops, int Token, char *Modes,
+                                      CLIENT *TopServer, int Type, const char *ID,
+                                      const char *User, const char *Hostname, const char *Info,
+                                      int Hops, int Token, const char *Modes,
                                       bool Idented));
 
-static void Destroy_UserOrService PARAMS((CLIENT *Client, char *Txt, char *FwdMsg,
+static void Destroy_UserOrService PARAMS((CLIENT *Client,const char *Txt, const char *FwdMsg,
                                        bool SendQuit));
 
 
@@ -142,7 +142,7 @@ Client_ThisServer( void )
  * @return New CLIENT structure.
  */
 GLOBAL CLIENT *
-Client_NewLocal(CONN_ID Idx, char *Hostname, int Type, bool Idented)
+Client_NewLocal(CONN_ID Idx, const char *Hostname, int Type, bool Idented)
 {
        return Init_New_Client(Idx, This_Server, NULL, Type, NULL, NULL,
                Hostname, NULL, 0, 0, NULL, Idented);
@@ -154,8 +154,8 @@ Client_NewLocal(CONN_ID Idx, char *Hostname, int Type, bool Idented)
  * @return New CLIENT structure.
  */
 GLOBAL CLIENT *
-Client_NewRemoteServer(CLIENT *Introducer, char *Hostname, CLIENT *TopServer,
- int Hops, int Token, char *Info, bool Idented)
+Client_NewRemoteServer(CLIENT *Introducer, const char *Hostname, CLIENT *TopServer,
+ int Hops, int Token, const char *Info, bool Idented)
 {
        return Init_New_Client(NONE, Introducer, TopServer, CLIENT_SERVER,
                Hostname, NULL, Hostname, Info, Hops, Token, NULL, Idented);
@@ -167,8 +167,8 @@ Client_NewRemoteServer(CLIENT *Introducer, char *Hostname, CLIENT *TopServer,
  * @return New CLIENT structure.
  */
 GLOBAL CLIENT *
-Client_NewRemoteUser(CLIENT *Introducer, char *Nick, int Hops, char *User,
- char *Hostname, int Token, char *Modes, char *Info, bool Idented)
+Client_NewRemoteUser(CLIENT *Introducer, const char *Nick, int Hops, const char *User,
+ const char *Hostname, int Token, const char *Modes, const char *Info, bool Idented)
 {
        return Init_New_Client(NONE, Introducer, NULL, CLIENT_USER, Nick,
                User, Hostname, Info, Hops, Token, Modes, Idented);
@@ -182,8 +182,8 @@ Client_NewRemoteUser(CLIENT *Introducer, char *Nick, int Hops, char *User,
  */
 static CLIENT *
 Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
- int Type, char *ID, char *User, char *Hostname, char *Info, int Hops,
- int Token, char *Modes, bool Idented)
+ int Type, const char *ID, const char *User, const char *Hostname, const char *Info, int Hops,
+ int Token, const char *Modes, bool Idented)
 {
        CLIENT *client;
 
@@ -224,12 +224,13 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
 
 
 GLOBAL void
-Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
+Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool SendQuit )
 {
        /* Client entfernen. */
        
        CLIENT *last, *c;
-       char msg[LINE_LEN], *txt;
+       char msg[LINE_LEN];
+       const char *txt;
 
        assert( Client != NULL );
 
@@ -302,7 +303,7 @@ Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
 
 
 GLOBAL void
-Client_SetHostname( CLIENT *Client, char *Hostname )
+Client_SetHostname( CLIENT *Client, const char *Hostname )
 {
        /* Hostname eines Clients setzen */
 
@@ -314,7 +315,7 @@ Client_SetHostname( CLIENT *Client, char *Hostname )
 
 
 GLOBAL void
-Client_SetID( CLIENT *Client, char *ID )
+Client_SetID( CLIENT *Client, const char *ID )
 {
        /* Hostname eines Clients setzen, Hash-Wert berechnen */
 
@@ -329,7 +330,7 @@ Client_SetID( CLIENT *Client, char *ID )
 
 
 GLOBAL void
-Client_SetUser( CLIENT *Client, char *User, bool Idented )
+Client_SetUser( CLIENT *Client, const char *User, bool Idented )
 {
        /* Username eines Clients setzen */
 
@@ -346,7 +347,7 @@ Client_SetUser( CLIENT *Client, char *User, bool Idented )
 
 
 GLOBAL void
-Client_SetInfo( CLIENT *Client, char *Info )
+Client_SetInfo( CLIENT *Client, const char *Info )
 {
        /* Hostname eines Clients setzen */
 
@@ -358,7 +359,7 @@ Client_SetInfo( CLIENT *Client, char *Info )
 
 
 GLOBAL void
-Client_SetModes( CLIENT *Client, char *Modes )
+Client_SetModes( CLIENT *Client, const char *Modes )
 {
        /* Modes eines Clients setzen */
 
@@ -370,7 +371,7 @@ Client_SetModes( CLIENT *Client, char *Modes )
 
 
 GLOBAL void
-Client_SetFlags( CLIENT *Client, char *Flags )
+Client_SetFlags( CLIENT *Client, const char *Flags )
 {
        /* Flags eines Clients setzen */
 
@@ -382,7 +383,7 @@ Client_SetFlags( CLIENT *Client, char *Flags )
 
 
 GLOBAL void
-Client_SetPassword( CLIENT *Client, char *Pwd )
+Client_SetPassword( CLIENT *Client, const char *Pwd )
 {
        /* Von einem Client geliefertes Passwort */
 
@@ -394,7 +395,7 @@ Client_SetPassword( CLIENT *Client, char *Pwd )
 
 
 GLOBAL void
-Client_SetAway( CLIENT *Client, char *Txt )
+Client_SetAway( CLIENT *Client, const char *Txt )
 {
        /* Set AWAY reason of client */
 
@@ -1137,7 +1138,7 @@ Client_TypeText(CLIENT *Client)
  * Destroy user or service client.
  */
 static void
-Destroy_UserOrService(CLIENT *Client, char *Txt, char *FwdMsg, bool SendQuit)
+Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool SendQuit)
 {
        if(Client->conn_id != NONE) {
                /* Local (directly connected) client */
index 6fcf7b64e22fe35f65c5fe64d2ff135813dee84b..106491741de783dcd9cf89b0b4308d71b3924a64 100644 (file)
@@ -72,11 +72,11 @@ typedef struct _WHOWAS
 GLOBAL void Client_Init PARAMS(( void ));
 GLOBAL void Client_Exit PARAMS(( void ));
 
-GLOBAL CLIENT *Client_NewLocal PARAMS(( CONN_ID Idx, char *Hostname, int Type, bool Idented ));
-GLOBAL CLIENT *Client_NewRemoteServer PARAMS(( CLIENT *Introducer, char *Hostname, CLIENT *TopServer, int Hops, int Token, char *Info, bool Idented ));
-GLOBAL CLIENT *Client_NewRemoteUser PARAMS(( CLIENT *Introducer, char *Nick, int Hops, char *User, char *Hostname, int Token, char *Modes, char *Info, bool Idented ));
+GLOBAL CLIENT *Client_NewLocal PARAMS(( CONN_ID Idx, const char *Hostname, int Type, bool Idented ));
+GLOBAL CLIENT *Client_NewRemoteServer PARAMS(( CLIENT *Introducer, const char *Hostname, CLIENT *TopServer, int Hops, int Token, const char *Info, bool Idented ));
+GLOBAL CLIENT *Client_NewRemoteUser PARAMS(( CLIENT *Introducer, const char *Nick, int Hops, const char *User, const char *Hostname, int Token, const char *Modes, const char *Info, bool Idented ));
 
-GLOBAL void Client_Destroy PARAMS(( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit ));
+GLOBAL void Client_Destroy PARAMS(( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool SendQuit ));
 
 GLOBAL CLIENT *Client_ThisServer PARAMS(( void ));
 
@@ -108,19 +108,19 @@ GLOBAL time_t Client_StartTime PARAMS(( CLIENT *Client ));
 
 GLOBAL bool Client_HasMode PARAMS(( CLIENT *Client, char Mode ));
 
-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, bool Idented ));
-GLOBAL void Client_SetInfo PARAMS(( CLIENT *Client, char *Info ));
-GLOBAL void Client_SetPassword PARAMS(( CLIENT *Client, char *Pwd ));
+GLOBAL void Client_SetHostname PARAMS(( CLIENT *Client, const char *Hostname ));
+GLOBAL void Client_SetID PARAMS(( CLIENT *Client, const char *Nick ));
+GLOBAL void Client_SetUser PARAMS(( CLIENT *Client, const char *User, bool Idented ));
+GLOBAL void Client_SetInfo PARAMS(( CLIENT *Client, const char *Info ));
+GLOBAL void Client_SetPassword PARAMS(( CLIENT *Client, const 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, bool OperByMe ));
-GLOBAL void Client_SetModes PARAMS(( CLIENT *Client, char *Modes ));
-GLOBAL void Client_SetFlags PARAMS(( CLIENT *Client, char *Flags ));
+GLOBAL void Client_SetModes PARAMS(( CLIENT *Client, const char *Modes ));
+GLOBAL void Client_SetFlags PARAMS(( CLIENT *Client, const char *Flags ));
 GLOBAL void Client_SetIntroducer PARAMS(( CLIENT *Client, CLIENT *Introducer ));
-GLOBAL void Client_SetAway PARAMS(( CLIENT *Client, char *Txt ));
+GLOBAL void Client_SetAway PARAMS(( CLIENT *Client, const char *Txt ));
 
 GLOBAL bool Client_ModeAdd PARAMS(( CLIENT *Client, char Mode ));
 GLOBAL bool Client_ModeDel PARAMS(( CLIENT *Client, char Mode ));
index 71f5760bd59dede7c58903f6bd98a41c8a262c06..a3c9afecf097c88de0fc55e9b1ac44aebb9c25b0 100644 (file)
@@ -387,7 +387,7 @@ Conf_GetServer( CONN_ID Idx )
 
 
 GLOBAL bool
-Conf_EnableServer( char *Name, UINT16 Port )
+Conf_EnableServer( const char *Name, UINT16 Port )
 {
        /* Enable specified server and adjust port */
 
@@ -426,7 +426,7 @@ Conf_EnablePassiveServer(const char *Name)
 
 
 GLOBAL bool
-Conf_DisableServer( char *Name )
+Conf_DisableServer( const char *Name )
 {
        /* Enable specified server and adjust port */
 
@@ -447,7 +447,7 @@ Conf_DisableServer( char *Name )
 
 
 GLOBAL bool
-Conf_AddServer( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd )
+Conf_AddServer( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd )
 {
        /* Add new server to configuration */
 
@@ -481,7 +481,7 @@ Conf_AddServer( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd
  * Check if the given nick name is an service
  */
 GLOBAL bool
-Conf_IsService(int ConfServer, char *Nick)
+Conf_IsService(int ConfServer, const char *Nick)
 {
        return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
 } /* Conf_IsService */
index 4695b25ab8d2486305209f204adb20c87de92bfe..9bdecdeee69fb44dcefbf888863a239733d84bd7 100644 (file)
@@ -180,12 +180,12 @@ GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
 GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
 GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
 
-GLOBAL bool Conf_EnableServer PARAMS(( char *Name, UINT16 Port ));
+GLOBAL bool Conf_EnableServer PARAMS(( const char *Name, UINT16 Port ));
 GLOBAL bool Conf_EnablePassiveServer PARAMS((const char *Name));
-GLOBAL bool Conf_DisableServer PARAMS(( char *Name ));
-GLOBAL bool Conf_AddServer PARAMS(( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd ));
+GLOBAL bool Conf_DisableServer PARAMS(( const char *Name ));
+GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd ));
 
-GLOBAL bool Conf_IsService PARAMS((int ConfServer, char *Nick));
+GLOBAL bool Conf_IsService PARAMS((int ConfServer, const char *Nick));
 
 
 #endif
index 826383b0732a310d6ef6837756e5694c2d595a71..d77222351a686ceee60ef7b94beea035552830a1 100644 (file)
@@ -93,7 +93,7 @@ Zip_InitConn( CONN_ID Idx )
  * @param Len Length of the data to add.
  * @return true on success, false otherwise. */
 GLOBAL bool
-Zip_Buffer( CONN_ID Idx, char *Data, size_t Len )
+Zip_Buffer( CONN_ID Idx, const char *Data, size_t Len )
 {
        size_t buflen;
 
index 6458a4e2d12a90991cc53c7f5f4fecaf291c2b54..08abb50ca70fa542d943bbcd4388ab4c1c713301 100644 (file)
@@ -22,7 +22,7 @@
 
 GLOBAL bool Zip_InitConn PARAMS(( CONN_ID Idx ));
 
-GLOBAL bool Zip_Buffer PARAMS(( CONN_ID Idx, char *Data, size_t Len ));
+GLOBAL bool Zip_Buffer PARAMS(( CONN_ID Idx, const char *Data, size_t Len ));
 GLOBAL bool Zip_Flush PARAMS(( CONN_ID Idx ));
 GLOBAL bool Unzip_Buffer PARAMS(( CONN_ID Idx ));
 
index 5b5251127bde9a7464328e7f40dac4754b6787f6..c27cebf9a7b74301c219f03f1e10332df45f7b15 100644 (file)
@@ -886,13 +886,13 @@ Conn_Write( CONN_ID Idx, char *Data, size_t Len )
 
 
 GLOBAL void
-Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
+Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClient )
 {
        /* Close connection. Open pipes of asyncronous resolver
         * sub-processes are closed down. */
 
        CLIENT *c;
-       char *txt;
+       const char *txt;
        double in_k, out_k;
        UINT16 port;
 #ifdef ZLIB
index 450d3d10497c7fffbff4fdf013ff2b680156fa1c..28bbda357860efdcbf938afc127b296c480bd389 100644 (file)
@@ -108,7 +108,7 @@ GLOBAL void Conn_Handler PARAMS(( void ));
 
 GLOBAL bool Conn_WriteStr PARAMS(( CONN_ID Idx, char *Format, ... ));
 
-GLOBAL void Conn_Close PARAMS(( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient ));
+GLOBAL void Conn_Close PARAMS(( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClient ));
 
 GLOBAL void Conn_SyncServerStruct PARAMS(( void ));