commit f7327524fce6a7db28850c8b8b8f0e99d0b2402b from: Alexander Barton date: Thu May 30 16:52:20 2002 UTC - Weitere Anpassungen an pre-ANSI-Compiler. commit - e74ee37db56077606bf19ad7ff6cd509f4a17953 commit + f7327524fce6a7db28850c8b8b8f0e99d0b2402b blob - 54acdcfa3957234bb13a19896b3cb360963d3cf4 blob + bf3e5a7951f4b439834ac8a50815f6059e961daa --- src/ngircd/channel.c +++ src/ngircd/channel.c @@ -9,7 +9,7 @@ * 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.23 2002/05/27 13:09:26 alex Exp $ + * $Id: channel.c,v 1.24 2002/05/30 16:52:21 alex Exp $ * * channel.c: Management der Channels */ @@ -345,15 +345,16 @@ Channel_GetChannel( CL2CHAN *Cl2Chan ) GLOBAL BOOLEAN Channel_IsValidName( CHAR *Name ) { - /* PrŸfen, ob Name als Channelname gueltig */ + /* Pruefen, ob Name als Channelname gueltig */ - CHAR *ptr, badchars[] = " ,:\x07"; + CHAR *ptr, badchars[10]; assert( Name != NULL ); if(( Name[0] != '#' ) || ( strlen( Name ) >= CHANNEL_NAME_LEN )) return FALSE; ptr = Name; + strcpy( badchars, " ,:\x07" ); while( *ptr ) { if( strchr( badchars, *ptr )) return FALSE; blob - 3c6d3aebfbc596cd7a38cfe202a15c354e9bec6f blob + dfa7f870e9928a2bbb377c38d0f4593682c0cf19 --- src/ngircd/client.c +++ src/ngircd/client.c @@ -9,7 +9,7 @@ * 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.55 2002/05/27 13:09:26 alex Exp $ + * $Id: client.c,v 1.56 2002/05/30 16:52:21 alex Exp $ * * client.c: Management aller Clients * @@ -73,7 +73,7 @@ Client_Init( VOID ) if( ! This_Server ) { Log( LOG_EMERG, "Can't allocate client structure for server! Going down." ); - Log( LOG_ALERT, PACKAGE" exiting due to fatal errors!" ); + Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE ); exit( 1 ); } @@ -906,10 +906,12 @@ Client_IsValidNick( CHAR *Nick ) { /* Ist der Nick gueltig? */ - CHAR *ptr, goodchars[] = ";0123456789-"; + CHAR *ptr, goodchars[20]; assert( Nick != NULL ); + strcpy( goodchars, ";0123456789-" ); + if( Nick[0] == '#' ) return FALSE; if( strchr( goodchars, Nick[0] )) return FALSE; if( strlen( Nick ) >= CLIENT_NICK_LEN ) return FALSE; blob - 4a4fe216c6e365128b91335b4871fd5f4a4089fd blob + d4410325c9d682bab1672858eeaf637ea1b911ce --- src/ngircd/conf.c +++ src/ngircd/conf.c @@ -9,7 +9,7 @@ * 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.26 2002/05/27 13:09:26 alex Exp $ + * $Id: conf.c,v 1.27 2002/05/30 16:52:21 alex Exp $ * * conf.h: Konfiguration des ngircd */ @@ -150,7 +150,7 @@ Set_Defaults( VOID ) /* Konfigurationsvariablen initialisieren, d.h. auf Default-Werte setzen. */ strcpy( Conf_ServerName, "" ); - strcpy( Conf_ServerInfo, PACKAGE" "VERSION ); + sprintf( Conf_ServerInfo, "%s %s", PACKAGE, VERSION ); strcpy( Conf_ServerPwd, "" ); strcpy( Conf_MotdFile, MOTD_FILE ); @@ -184,7 +184,7 @@ Read_Config( VOID ) { /* Keine Konfigurationsdatei gefunden */ Config_Error( LOG_ALERT, "Can't read configuration \"%s\": %s", NGIRCd_ConfFile, strerror( errno )); - Config_Error( LOG_ALERT, PACKAGE" exiting due to fatal errors!" ); + Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE ); exit( 1 ); } @@ -494,14 +494,20 @@ Validate_Config( VOID ) { /* Kein Servername konfiguriert */ Config_Error( LOG_ALERT, "No server name configured in \"%s\"!", NGIRCd_ConfFile ); - Config_Error( LOG_ALERT, PACKAGE" exiting due to fatal errors!" ); + Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE ); exit( 1 ); } } /* Validate_Config */ -LOCAL VOID -Config_Error( CONST INT Level, CONST CHAR *Format, ... ) +#ifdef PROTOTYPES +LOCAL VOID Config_Error( CONST INT Level, CONST CHAR *Format, ... ) +#else +LOCAL VOID Config_Error( Level, Format, va_alist ) +CONST INT Level; +CONST CHAR *Format; +va_dcl +#endif { /* Fehler! Auf Console und/oder ins Log schreiben */ @@ -511,7 +517,11 @@ Config_Error( CONST INT Level, CONST CHAR *Format, ... assert( Format != NULL ); /* String mit variablen Argumenten zusammenbauen ... */ +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap ); va_end( ap ); blob - d6ceb629f4f4ed7e4c642cf94fe568b54ad6c889 blob + 6acfb083fbb13bbc3483aa713098c8fb9340e1e0 --- src/ngircd/conn.c +++ src/ngircd/conn.c @@ -9,7 +9,7 @@ * 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.65 2002/05/27 13:09:26 alex Exp $ + * $Id: conn.c,v 1.66 2002/05/30 16:52:21 alex Exp $ * * connect.h: Verwaltung aller Netz-Verbindungen ("connections") */ @@ -298,7 +298,7 @@ Conn_Handler( INT Timeout ) if( errno != EINTR ) { Log( LOG_EMERG, "select(): %s!", strerror( errno )); - Log( LOG_ALERT, PACKAGE" exiting due to fatal errors!" ); + Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE ); exit( 1 ); } continue; @@ -319,8 +319,16 @@ Conn_Handler( INT Timeout ) } /* Conn_Handler */ +#ifdef PROTOTYPES GLOBAL BOOLEAN Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +Conn_WriteStr( Idx, Format, va_alist ) +CONN_ID Idx; +CHAR *Format; +va_dcl +#endif { /* String in Socket schreiben. CR+LF wird von dieser Funktion * automatisch angehaengt. Im Fehlerfall wird dir Verbindung @@ -333,8 +341,12 @@ Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... ) assert( Idx >= 0 ); assert( My_Connections[Idx].sock > NONE ); assert( Format != NULL ); - + +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) == COMMAND_LEN - 2 ) { Log( LOG_CRIT, "Text too long to send (connection %d)!", Idx ); @@ -586,7 +598,7 @@ Handle_Write( CONN_ID Idx ) Log( LOG_DEBUG, "Connection %d with \"%s:%d\" established, now sendig PASS and SERVER ...", Idx, My_Connections[Idx].host, Conf_Server[My_Connections[Idx].our_server].port ); /* PASS und SERVER verschicken */ - Conn_WriteStr( Idx, "PASS %s "PASSSERVERADD, Conf_Server[My_Connections[Idx].our_server].pwd ); + Conn_WriteStr( Idx, "PASS %s %s", Conf_Server[My_Connections[Idx].our_server].pwd, PASSSERVERADD ); Conn_WriteStr( Idx, "SERVER %s :%s", Conf_ServerName, Conf_ServerInfo ); return TRUE; blob - 055a7601ce2618d7b498b01ed0113fab0b938f10 blob + def9358d80586491f99417eaff22a32894e4d919 --- src/ngircd/defines.h +++ src/ngircd/defines.h @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: defines.h,v 1.25 2002/05/27 13:04:07 alex Exp $ + * $Id: defines.h,v 1.26 2002/05/30 16:52:21 alex Exp $ * * defines.h: (globale) Konstanten */ @@ -58,7 +58,11 @@ #define PROTOVER "0210" /* implementierte Protokoll-Version (RFC 2813, 4.1.1) */ #define PROTOSUFFIX "-ngIRCd" /* Protokoll-Suffix (RFC 2813, 4.1.1) */ -#define PASSSERVERADD PROTOVER""PROTOSUFFIX" IRC|"PACKAGE"-"VERSION" P" +#ifdef PROTOTYPES +# define PASSSERVERADD PROTOVER""PROTOSUFFIX" IRC|"PACKAGE"-"VERSION" P" +#else +# define PASSSERVERADD "0210-ngIRCd IRC|ngircd-0 P" +#endif #define STARTUP_DELAY 1 /* Erst n Sek. nach Start zu anderen Servern verbinden */ #define RECONNECT_DELAY 3 /* Server-Links erst nach 3 Sekunden versuchen, wieder aufzubauen */ @@ -71,8 +75,13 @@ #define DEFAULT_AWAY_MSG "Away" /* Away-Meldung fuer User von anderen Servern */ -#define CONFIG_FILE SYSCONFDIR"/ngircd.conf" -#define MOTD_FILE SYSCONFDIR"/ngircd.motd" +#ifdef PROTOTYPES +# define CONFIG_FILE SYSCONFDIR"/ngircd.conf" +# define MOTD_FILE SYSCONFDIR"/ngircd.motd" +#else +# define CONFIG_FILE "ngircd.conf" +# define MOTD_FILE "ngircd.motd" +#endif #define ERROR_DIR "/tmp" #define MAX_LOG_MSG_LEN 256 /* max. Laenge einer Log-Meldung */ blob - 73fa034d3c32a714acc3d3a19ab74485a1bcba75 blob + b8528084e0cc8df388c16a3af795915e3808d04f --- src/ngircd/irc-login.c +++ src/ngircd/irc-login.c @@ -9,7 +9,7 @@ * 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.14 2002/05/27 13:09:26 alex Exp $ + * $Id: irc-login.c,v 1.15 2002/05/30 16:52:21 alex Exp $ * * irc-login.c: Anmeldung und Abmeldung im IRC */ @@ -391,9 +391,9 @@ Hello_User( CLIENT *Client ) IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client )); if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return FALSE; - if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )))) return FALSE; + if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, TARGET_CPU, TARGET_CPU, TARGET_OS )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE; - if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )))) return FALSE; + if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, USERMODES, CHANMODES )) return FALSE; Client_SetType( Client, CLIENT_USER ); blob - ed03b6ff928710c0036b55b060072f524c9e3fd7 blob + 3cefaa1b50b3766d6e9b8cfb174fb5277a6fcf67 --- src/ngircd/irc-server.c +++ src/ngircd/irc-server.c @@ -9,7 +9,7 @@ * 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.10 2002/05/27 13:09:27 alex Exp $ + * $Id: irc-server.c,v 1.11 2002/05/30 16:52:21 alex Exp $ * * irc-server.c: IRC-Befehle fuer Server-Links */ @@ -92,7 +92,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) { /* Eingehende Verbindung: Unseren SERVER- und PASS-Befehl senden */ ok = TRUE; - if( ! IRC_WriteStrClient( Client, "PASS %s "PASSSERVERADD, Conf_Server[i].pwd )) ok = FALSE; + if( ! IRC_WriteStrClient( Client, "PASS %s %s", Conf_Server[i].pwd, PASSSERVERADD )) ok = FALSE; else ok = IRC_WriteStrClient( Client, "SERVER %s 1 :%s", Conf_ServerName, Conf_ServerInfo ); if( ! ok ) { blob - 0e062f2cbd9a5b7dfcc874e754afef3610c258ee blob + 5cc58006a115ad968efb4a04fbfd393ef306f785 --- src/ngircd/irc-write.c +++ src/ngircd/irc-write.c @@ -9,7 +9,7 @@ * 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.4 2002/05/27 13:09:27 alex Exp $ + * $Id: irc-write.c,v 1.5 2002/05/30 16:52:21 alex Exp $ * * irc-write.c: IRC-Texte und Befehle ueber Netzwerk versenden */ @@ -34,8 +34,16 @@ LOCAL CHAR *Get_Prefix PARAMS(( CLIENT *Target, CLIENT *Client )); +#ifdef PROTOTYPES GLOBAL BOOLEAN IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +IRC_WriteStrClient( Client, Format, va_alist ) +CLIENT *Client; +CHAR *Format; +va_dcl +#endif { CHAR buffer[1000]; BOOLEAN ok = CONNECTED; @@ -44,7 +52,11 @@ IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... assert( Client != NULL ); assert( Format != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); @@ -55,8 +67,17 @@ IRC_WriteStrClient( CLIENT *Client, CHAR *Format, ... } /* IRC_WriteStrClient */ +#ifdef PROTOTYPES GLOBAL BOOLEAN IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +IRC_WriteStrClientPrefix( Client, Prefix, Format, va_alist ) +CLIENT *Client; +CLIENT *Prefix; +CHAR *Format; +va_dcl +#endif { /* Text an Clients, lokal bzw. remote, senden. */ @@ -67,7 +88,11 @@ IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Pref assert( Format != NULL ); assert( Prefix != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); @@ -75,8 +100,18 @@ IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Pref } /* IRC_WriteStrClientPrefix */ +#ifdef PROTOTYPES GLOBAL BOOLEAN IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +IRC_WriteStrChannel( Client, Chan, Remote, Format, va_alist ) +CLIENT *Client; +CHANNEL *Chan; +BOOLEAN Remote; +CHAR *Format; +va_dcl +#endif { CHAR buffer[1000]; va_list ap; @@ -84,7 +119,11 @@ IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BO assert( Client != NULL ); assert( Format != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); @@ -92,8 +131,19 @@ IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, BO } /* IRC_WriteStrChannel */ +#ifdef PROTOTYPES GLOBAL BOOLEAN IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +IRC_WriteStrChannelPrefix( Client, Chan, Prefix, Remote, Format, va_alist ) +CLIENT *Client; +CHANNEL *Chan; +CLIENT *Prefix; +BOOLEAN Remote; +CHAR *Format; +va_dcl +#endif { BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED; CHAR buffer[1000]; @@ -107,7 +157,11 @@ IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Ch assert( Prefix != NULL ); assert( Format != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); @@ -153,25 +207,46 @@ IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Ch } /* IRC_WriteStrChannelPrefix */ +#ifdef PROTOTYPES GLOBAL VOID IRC_WriteStrServers( CLIENT *ExceptOf, CHAR *Format, ... ) +#else +GLOBAL VOID +IRC_WriteStrServers( ExceptOf, Format, va_alist ) +CLIENT *ExceptOf; +CHAR *Format; +va_dcl +#endif { CHAR buffer[1000]; va_list ap; assert( Format != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); /* an den Client selber */ - return IRC_WriteStrServersPrefix( ExceptOf, Client_ThisServer( ), buffer ); + IRC_WriteStrServersPrefix( ExceptOf, Client_ThisServer( ), buffer ); } /* IRC_WriteStrServers */ +#ifdef PROTOTYPES GLOBAL VOID IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ) +#else +GLOBAL VOID +IRC_WriteStrServersPrefix( ExceptOf, Prefix, Format, va_alist ) +CLIENT *ExceptOf; +CLIENT *Prefix; +CHAR *Format; +va_dcl +#endif { CHAR buffer[1000]; CLIENT *c; @@ -180,7 +255,11 @@ IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *P assert( Format != NULL ); assert( Prefix != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); @@ -197,8 +276,18 @@ IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *P } /* IRC_WriteStrServersPrefix */ +#ifdef PROTOTYPES GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ) +#else +GLOBAL BOOLEAN +IRC_WriteStrRelatedPrefix( Client, Prefix, Remote, Format, va_alist ) +CLIENT *Client; +CLIENT *Prefix; +BOOLEAN Remote; +CHAR *Format; +va_dcl +#endif { BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED; CL2CHAN *chan_cl2chan, *cl2chan; @@ -212,7 +301,11 @@ IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Pre assert( Prefix != NULL ); assert( Format != NULL ); +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( buffer, 1000, Format, ap ); va_end( ap ); blob - eadfe1543f108468c6ccd41b69dbe8907e168095 blob + ef42e857a0a0f86a27b992b5a829eb3dd8f5abef --- src/ngircd/irc.c +++ src/ngircd/irc.c @@ -9,7 +9,7 @@ * 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.90 2002/05/27 13:09:27 alex Exp $ + * $Id: irc.c,v 1.91 2002/05/30 16:52:21 alex Exp $ * * irc.c: IRC-Befehle */ @@ -609,7 +609,7 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req ) } /* mit Versionsinfo antworten */ - return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( )); + return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE, VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( )); } /* IRC_VERSION */ blob - 1cf83c31c7e1925424edcaf1cdb2f0679da277f5 blob + 63ebd9bf5c4b3bfa3c2f17df64aab70b4f1c5c99 --- src/ngircd/log.c +++ src/ngircd/log.c @@ -9,7 +9,7 @@ * 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.33 2002/05/27 13:09:27 alex Exp $ + * $Id: log.c,v 1.34 2002/05/30 16:52:21 alex Exp $ * * log.c: Logging-Funktionen */ @@ -96,7 +96,7 @@ Log_InitErrorfile( VOID ) * landen z.B. alle Ausgaben von assert()-Aufrufen. */ /* Dateiname zusammen bauen */ - sprintf( Error_File, ERROR_DIR"/"PACKAGE"-%ld.err", (INT32)getpid( )); + sprintf( Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE, (INT32)getpid( )); /* stderr umlenken */ fflush( stderr ); @@ -120,7 +120,7 @@ GLOBAL VOID Log_Exit( VOID ) { /* Good Bye! */ - Log( LOG_NOTICE, PACKAGE" done."); + Log( LOG_NOTICE, "%s done.", PACKAGE ); /* Error-File (stderr) loeschen */ if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno )); @@ -132,8 +132,16 @@ Log_Exit( VOID ) } /* Log_Exit */ +#ifdef PROTOTYPES GLOBAL VOID Log( INT Level, CONST CHAR *Format, ... ) +#else +GLOBAL VOID +Log( Level, Format, va_alist ) +INT Level; +CONST CHAR *Format; +va_dcl +#endif { /* Eintrag in Logfile(s) schreiben */ @@ -158,7 +166,11 @@ Log( INT Level, CONST CHAR *Format, ... ) #endif /* String mit variablen Argumenten zusammenbauen ... */ +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap ); va_end( ap ); @@ -206,8 +218,16 @@ Log_Exit_Resolver( VOID ) } /* Log_Exit_Resolver */ +#ifdef PROTOTYPES GLOBAL VOID Log_Resolver( CONST INT Level, CONST CHAR *Format, ... ) +#else +GLOBAL VOID +Log_Resolver( Level, Format, va_alist ) +CONST INT Level; +CONST CHAR *Format; +va_dcl +#endif { /* Eintrag des Resolver in Logfile(s) schreiben */ @@ -227,7 +247,11 @@ Log_Resolver( CONST INT Level, CONST CHAR *Format, ... #endif /* String mit variablen Argumenten zusammenbauen ... */ +#ifdef PROTOTYPES va_start( ap, Format ); +#else + va_start( ap ); +#endif vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap ); va_end( ap ); blob - df9a89763c554888ddab3d74121ed2018856f1dc blob + c0589846d7b389fc34ff6f2c64f881da2e1bd482 --- src/ngircd/messages.h +++ src/ngircd/messages.h @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: messages.h,v 1.39 2002/05/27 12:35:19 alex Exp $ + * $Id: messages.h,v 1.40 2002/05/30 16:52:21 alex Exp $ * * irc.h: IRC-Befehle (Header) */ @@ -23,13 +23,13 @@ #define RPL_WELCOME_MSG "001 %s :Welcome to the Internet Relay Network %s" #define RPL_YOURHOST "002" -#define RPL_YOURHOST_MSG "002 %s :Your host is %s, running ngircd "VERSION"-"TARGET_CPU"/"TARGET_VENDOR"/"TARGET_OS +#define RPL_YOURHOST_MSG "002 %s :Your host is %s, running ngircd %s-%s/%s/%s" #define RPL_CREATED "003" #define RPL_CREATED_MSG "003 %s :This server was started %s" #define RPL_MYINFO "004" -#define RPL_MYINFO_MSG "004 %s :%s ngircd-"VERSION" "USERMODES" "CHANMODES +#define RPL_MYINFO_MSG "004 %s :%s ngircd-%s %s %s" #define RPL_UMODEIS "211" #define RPL_UMODEIS_MSG "211 %s +%s" @@ -111,7 +111,7 @@ #define RPL_TOPIC_MSG "332 %s %s :%s" #define RPL_VERSION "351" -#define RPL_VERSION_MSG "351 %s "PACKAGE"-"VERSION".%s %s :%s" +#define RPL_VERSION_MSG "351 %s %s-%s.%s %s :%s" #define RPL_WHOREPLY "352" #define RPL_WHOREPLY_MSG "352 %s %s %s %s %s %s %s :%d %s" blob - b54d3177f4699864d762ba8eeeeefc14d650b55d blob + c91f0db18b8eafaf17ee2fc87246192a80c49bf3 --- src/ngircd/ngircd.c +++ src/ngircd/ngircd.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: ngircd.c,v 1.46 2002/05/27 13:00:50 alex Exp $ + * $Id: ngircd.c,v 1.47 2002/05/30 16:52:21 alex Exp $ * * ngircd.c: Hier beginnt alles ;-) */ @@ -340,7 +340,15 @@ NGIRCd_VersionAddition( VOID ) #endif if( txt[0] ) strcat( txt, "-" ); +#ifdef PROTOTYPES strcat( txt, TARGET_CPU"/"TARGET_VENDOR"/"TARGET_OS ); +#else + strcat( txt, TARGET_CPU ); + strcat( txt, "/" ); + strcat( txt, TARGET_VENDOR ); + strcat( txt, "/" ); + strcat( txt, TARGET_OS ); +#endif return txt; } /* NGIRCd_VersionAddition */ blob - 4ed83f992fbbb6208c95ae8d3c8d9e1e1c80efc0 blob + 9fefbec359bddd2e5318ce36100811a29d0bffe9 --- src/ngircd/resolve.c +++ src/ngircd/resolve.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: resolve.c,v 1.1 2002/05/27 11:23:27 alex Exp $ + * $Id: resolve.c,v 1.2 2002/05/30 16:52:21 alex Exp $ * * resolve.c: asyncroner Resolver */ @@ -40,7 +40,7 @@ LOCAL VOID Do_ResolveAddr PARAMS(( struct sockaddr_in LOCAL VOID Do_ResolveName PARAMS(( CHAR *Host, INT w_fd )); #ifdef h_errno -LOCAL CHAR *Resolve_Error PARAMS(( INT H_Error )); +LOCAL CHAR *Get_Error PARAMS(( INT H_Error )); #endif blob - 14cbc0086d0bdb736382391578ad7887e5340fdd blob + f5e4a5e7c00558b8f9993c260ca28232ea11b7f5 --- src/portab/portabtest.c +++ src/portab/portabtest.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: portabtest.c,v 1.4 2002/05/27 13:01:40 alex Exp $ + * $Id: portabtest.c,v 1.5 2002/05/30 16:52:20 alex Exp $ * * portabtest.c: Testprogramm fuer portab.h */ @@ -39,7 +39,7 @@ main( VOID ) } else puts( "ok." ); - puts( "- system type: "TARGET_CPU"/"TARGET_VENDOR"/"TARGET_OS ); + printf( "- system type: %s/%s/%s\n", TARGET_CPU, TARGET_VENDOR, TARGET_OS ); return ret; } /* main */