]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
Adjusted copyright notice to include 2004.
[ngircd-alex.git] / src / ngircd / ngircd.c
index 45cdfac3b2a41239a32c0ab989aac8f1ec5c32a6..2e0c65bf81b265c9038dc9d802e76a8ae41edd50 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2004 by Alexander Barton (alex@barton.de)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.75 2003/03/27 01:22:44 alex Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.81 2004/01/02 19:23:30 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -183,11 +183,16 @@ main( int argc, const char *argv[] )
                                        ok = TRUE;
                                }
 #endif
+                               if( argv[i][n] == 't' )
+                               {
+                                       configtest = TRUE;
+                                       ok = TRUE;
+                               }
 
                                if( ! ok )
                                {
-                                       printf( "%s: invalid option \"-%c\"!\n", PACKAGE, argv[i][n] );
-                                       printf( "Try \"%s --help\" for more information.\n", PACKAGE );
+                                       printf( "%s: invalid option \"-%c\"!\n", PACKAGE_NAME, argv[i][n] );
+                                       printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
                                        exit( 1 );
                                }
                        }
@@ -195,8 +200,8 @@ main( int argc, const char *argv[] )
                }
                if( ! ok )
                {
-                       printf( "%s: invalid option \"%s\"!\n", PACKAGE, argv[i] );
-                       printf( "Try \"%s --help\" for more information.\n", PACKAGE );
+                       printf( "%s: invalid option \"%s\"!\n", PACKAGE_NAME, argv[i] );
+                       printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
                        exit( 1 );
                }
        }
@@ -239,7 +244,7 @@ main( int argc, const char *argv[] )
                        if( pid < 0 )
                        {
                                /* Fehler */
-                               printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE, strerror( errno ));
+                               printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE_NAME, strerror( errno ));
                                exit( 1 );
                        }
 
@@ -297,16 +302,16 @@ main( int argc, const char *argv[] )
                 * beim PASS-Befehl verwendete Syntax sowie die erweiterten Flags
                 * sind in doc/Protocol.txt beschrieben. */
 #ifdef IRCPLUS
-               sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGEVERSION, IRCPLUSFLAGS );
-#ifdef USE_ZLIB
+               sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
+#ifdef ZLIB
                strcat( NGIRCd_ProtoID, "Z" );
 #endif
                if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" );
 #else
-               sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGEVERSION );
+               sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION );
 #endif
                strcat( NGIRCd_ProtoID, " P" );
-#ifdef USE_ZLIB
+#ifdef ZLIB
                strcat( NGIRCd_ProtoID, "Z" );
 #endif
                Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID );
@@ -318,7 +323,7 @@ main( int argc, const char *argv[] )
                if( Conn_InitListeners( ) < 1 )
                {
                        Log( LOG_ALERT, "Server isn't listening on a single port!" );
-                       Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
+                       Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
                        exit( 1 );
                }
                
@@ -346,9 +351,9 @@ NGIRCd_Version( VOID )
        STATIC CHAR version[126];
        
 #ifdef CVSDATE
-       sprintf( version, "%s %s(%s)-%s", PACKAGEVERSION, CVSDATE, NGIRCd_VersionAddition( ));
+       sprintf( version, "%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition( ));
 #else
-       sprintf( version, "%s %s-%s", PACKAGEVERSION, NGIRCd_VersionAddition( ));
+       sprintf( version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition( ));
 #endif
        return version;
 } /* NGIRCd_Version */
@@ -361,15 +366,15 @@ NGIRCd_VersionAddition( VOID )
 
        strcpy( txt, "" );
 
-#ifdef USE_SYSLOG
+#ifdef SYSLOG
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "SYSLOG" );
 #endif
-#ifdef USE_ZLIB
+#ifdef ZLIB
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "ZLIB" );
 #endif
-#ifdef USE_TCPWRAP
+#ifdef TCPWRAP
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "TCPWRAP" );
 #endif
@@ -377,6 +382,10 @@ NGIRCd_VersionAddition( VOID )
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "RENDEZVOUS" );
 #endif
+#ifdef IDENTAUTH
+       if( txt[0] ) strcat( txt, "+" );
+       strcat( txt, "IDENT" );
+#endif
 #ifdef DEBUG
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "DEBUG" );
@@ -417,7 +426,9 @@ NGIRCd_Rehash( VOID )
        Conn_ExitListeners( );
 
        /* Alten Server-Namen merken */
+#ifdef DEBUG
        assert( sizeof( old_name ) == sizeof( Conf_ServerName ));
+#endif
        strcpy( old_name, Conf_ServerName );
 
        /* Konfiguration neu lesen ... */
@@ -527,7 +538,7 @@ LOCAL VOID
 Show_Version( VOID )
 {
        puts( NGIRCd_Version( ));
-       puts( "Copyright (c)2001-2003 by Alexander Barton (<alex@barton.de>)." );
+       puts( "Copyright (c)2001-2004 by Alexander Barton (<alex@barton.de>)." );
        puts( "Homepage: <http://arthur.ath.cx/~alex/ngircd/>\n" );
        puts( "This is free software; see the source for copying conditions. There is NO" );
        puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );
@@ -546,7 +557,7 @@ Show_Help( VOID )
 #ifdef SNIFFER
        puts( "  -s, --sniffer      enable network sniffer and display all IRC traffic" );
 #endif
-       puts( "      --configtest   read, validate and display configuration; then exit" );
+       puts( "  -t, --configtest   read, validate and display configuration; then exit" );
        puts( "      --version      output version information and exit" );
        puts( "      --help         display this help and exit" );
 } /* Show_Help */