]> arthur.barton.de Git - ngircd-alex.git/commitdiff
- Handling von "--version" und "--help" nochmal geaendert ...
authorAlexander Barton <alex@barton.de>
Sun, 10 Mar 2002 17:50:48 +0000 (17:50 +0000)
committerAlexander Barton <alex@barton.de>
Sun, 10 Mar 2002 17:50:48 +0000 (17:50 +0000)
MacOSX/ngircd.pbproj/project.pbxproj
src/ngircd/conf.c
src/ngircd/conf.h
src/ngircd/conn.c
src/ngircd/ngircd.c

index ad2110a312e3045a0b939a3c2e0caf599564d466..a02348f821673a7e3b339a1be454498c83a0cd8b 100644 (file)
@@ -94,7 +94,7 @@
                                HEADER_SEARCH_PATHS = "";
                                INSTALL_PATH = "$(HOME)/bin";
                                LIBRARY_SEARCH_PATHS = "";
                                HEADER_SEARCH_PATHS = "";
                                INSTALL_PATH = "$(HOME)/bin";
                                LIBRARY_SEARCH_PATHS = "";
-                               OTHER_CFLAGS = "";
+                               OTHER_CFLAGS = "-DLOCALSTATEDIR=\\\\\\\"/usr/local/var\\\\\\\" -DSYSCONFDIR=\\\\\\\"/usr/local/etc\\\\\\\"";
                                OTHER_LDFLAGS = "";
                                OTHER_REZFLAGS = "";
                                PRODUCT_NAME = ngircd;
                                OTHER_LDFLAGS = "";
                                OTHER_REZFLAGS = "";
                                PRODUCT_NAME = ngircd;
index 950d260daf1139a693789190f6d2d7cafc3ddb94..7739cf36eed5ce1e772a6d9b558e2f3cac19b21e 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
  * 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.15 2002/03/06 15:35:19 alex Exp $
+ * $Id: conf.c,v 1.16 2002/03/10 17:50:48 alex Exp $
  *
  * conf.h: Konfiguration des ngircd
  *
  * $Log: conf.c,v $
  *
  * conf.h: Konfiguration des ngircd
  *
  * $Log: conf.c,v $
+ * Revision 1.16  2002/03/10 17:50:48  alex
+ * - Handling von "--version" und "--help" nochmal geaendert ...
+ *
  * Revision 1.15  2002/03/06 15:35:19  alex
  * - Dateinamen und Pfad sind nun in Konstanten definiert.
  *
  * Revision 1.15  2002/03/06 15:35:19  alex
  * - Dateinamen und Pfad sind nun in Konstanten definiert.
  *
@@ -180,6 +183,7 @@ LOCAL VOID Read_Config( VOID )
                                        strcpy( Conf_Server[Conf_Server_Count].name, "" );
                                        strcpy( Conf_Server[Conf_Server_Count].pwd, "" );
                                        Conf_Server[Conf_Server_Count].port = 0;
                                        strcpy( Conf_Server[Conf_Server_Count].name, "" );
                                        strcpy( Conf_Server[Conf_Server_Count].pwd, "" );
                                        Conf_Server[Conf_Server_Count].port = 0;
+                                       Conf_Server[Conf_Server_Count].group = -1;
                                        Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
                                        Conf_Server[Conf_Server_Count].res_stat = NULL;
                                        Conf_Server_Count++;
                                        Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
                                        Conf_Server[Conf_Server_Count].res_stat = NULL;
                                        Conf_Server_Count++;
@@ -322,7 +326,7 @@ GLOBAL VOID Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
 
 GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
 {
 
 GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
 {
-       INT port;
+       INT32 port;
        
        assert( Line > 0 );
        assert( Var != NULL );
        
        assert( Line > 0 );
        assert( Var != NULL );
@@ -353,10 +357,16 @@ GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
        {
                /* Port, zu dem Verbunden werden soll */
                port = atol( Arg );
        {
                /* Port, zu dem Verbunden werden soll */
                port = atol( Arg );
-               if( port > 0 && port < 0xFFFF ) Conf_Server[Conf_Server_Count - 1].port = port;
+               if( port > 0 && port < 0xFFFF ) Conf_Server[Conf_Server_Count - 1].port = (INT)port;
                else Log( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", Conf_File, Line, port );
                return;
        }
                else Log( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", Conf_File, Line, port );
                return;
        }
+       if( strcasecmp( Var, "Group" ) == 0 )
+       {
+               /* Server-Gruppe */
+               Conf_Server[Conf_Server_Count - 1].group = atoi( Arg );
+               return;
+       }
        
        Log( LOG_ERR, "%s, line %d (section \"Server\"): Unknown variable \"%s\"!", Conf_File, Line, Var );
 } /* Handle_SERVER */
        
        Log( LOG_ERR, "%s, line %d (section \"Server\"): Unknown variable \"%s\"!", Conf_File, Line, Var );
 } /* Handle_SERVER */
index 0dbcc3fbfa0dd713a086ccd5db6106667dff9bdd..3e507b39db1bd655c8a7f67d9ccccf59fdbcaab3 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
  * 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.10 2002/02/27 23:23:53 alex Exp $
+ * $Id: conf.h,v 1.11 2002/03/10 17:50:48 alex Exp $
  *
  * conf.h: Konfiguration des ngircd (Header)
  *
  * $Log: conf.h,v $
  *
  * conf.h: Konfiguration des ngircd (Header)
  *
  * $Log: conf.h,v $
+ * Revision 1.11  2002/03/10 17:50:48  alex
+ * - Handling von "--version" und "--help" nochmal geaendert ...
+ *
  * Revision 1.10  2002/02/27 23:23:53  alex
  * - Includes fuer einige Header bereinigt.
  *
  * Revision 1.10  2002/02/27 23:23:53  alex
  * - Includes fuer einige Header bereinigt.
  *
 
 typedef struct _Conf_Oper
 {
 
 typedef struct _Conf_Oper
 {
-       CHAR name[CLIENT_PASS_LEN];
-       CHAR pwd[CLIENT_PASS_LEN];
+       CHAR name[CLIENT_PASS_LEN];     /* Name (ID) des IRC-OPs */
+       CHAR pwd[CLIENT_PASS_LEN];      /* Passwort */
 } CONF_OPER;
 
 typedef struct _Conf_Server
 {
 } CONF_OPER;
 
 typedef struct _Conf_Server
 {
-       CHAR host[HOST_LEN];
-       CHAR ip[16];
-       CHAR name[CLIENT_ID_LEN];
-       CHAR pwd[CLIENT_PASS_LEN];
-       INT port;
-       time_t lasttry;
-       RES_STAT *res_stat;
+       CHAR host[HOST_LEN];            /* Hostname */
+       CHAR ip[16];                    /* IP-Adresse (von Resolver) */
+       CHAR name[CLIENT_ID_LEN];       /* IRC-Client-ID */
+       CHAR pwd[CLIENT_PASS_LEN];      /* Passwort */
+       INT port;                       /* Server-Port */
+       INT group;                      /* Gruppe des Servers */
+       time_t lasttry;                 /* Letzter Connect-Versuch */
+       RES_STAT *res_stat;             /* Status des Resolver */
 } CONF_SERVER;
 
 
 } CONF_SERVER;
 
 
index 5c37329f2f0c58016394b261a13a2c420d140fa3..d19e0030fb7eaba342a7f12ec2c8e6e87b0a5928 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
  * 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.47 2002/03/04 23:16:23 alex Exp $
+ * $Id: conn.c,v 1.48 2002/03/10 17:50:48 alex Exp $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  *
  * $Log: conn.c,v $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  *
  * $Log: conn.c,v $
+ * Revision 1.48  2002/03/10 17:50:48  alex
+ * - Handling von "--version" und "--help" nochmal geaendert ...
+ *
  * Revision 1.47  2002/03/04 23:16:23  alex
  * - Logging geaendert: detaillierter im Syslog, "allgemeiner" fuer Clients.
  *
  * Revision 1.47  2002/03/04 23:16:23  alex
  * - Logging geaendert: detaillierter im Syslog, "allgemeiner" fuer Clients.
  *
@@ -1008,6 +1011,7 @@ LOCAL VOID Check_Servers( VOID )
                /* Haben wir schon eine Verbindung? */
                for( n = 0; n < MAX_CONNECTIONS; n++ )
                {
                /* Haben wir schon eine Verbindung? */
                for( n = 0; n < MAX_CONNECTIONS; n++ )
                {
+                       /* Verbindung zu diesem Server? */
                        if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server == i ))
                        {
                                /* Komplett aufgebaute Verbindung? */
                        if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server == i ))
                        {
                                /* Komplett aufgebaute Verbindung? */
@@ -1016,6 +1020,12 @@ LOCAL VOID Check_Servers( VOID )
                                /* IP schon aufgeloest? */
                                if( My_Connections[n].res_stat == NULL ) New_Server( i, n );
                        }
                                /* IP schon aufgeloest? */
                                if( My_Connections[n].res_stat == NULL ) New_Server( i, n );
                        }
+
+                       /* Verbindung in dieser Server-Gruppe? */
+                       if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server != NONE ))
+                       {
+                               if( Conf_Server[n].group == Conf_Server[i].group != NONE ) break;
+                       }
                }
                if( n < MAX_CONNECTIONS ) continue;
                
                }
                if( n < MAX_CONNECTIONS ) continue;
                
@@ -1145,7 +1155,7 @@ LOCAL VOID Init_Conn_Struct( INT Idx )
        My_Connections[Idx].rdatalen = 0;
        My_Connections[Idx].wbuf[0] = '\0';
        My_Connections[Idx].wdatalen = 0;
        My_Connections[Idx].rdatalen = 0;
        My_Connections[Idx].wbuf[0] = '\0';
        My_Connections[Idx].wdatalen = 0;
-       My_Connections[Idx].our_server = -1;
+       My_Connections[Idx].our_server = NONE;
        My_Connections[Idx].lastdata = time( NULL );
        My_Connections[Idx].lastping = 0;
        My_Connections[Idx].lastprivmsg = time( NULL );
        My_Connections[Idx].lastdata = time( NULL );
        My_Connections[Idx].lastping = 0;
        My_Connections[Idx].lastprivmsg = time( NULL );
index 4dd9b6a28d9798c1d0978f560503adcc358fc3dd..113cecabf848cda2246ff08c278fd69c7b50edda 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
  * 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.30 2002/03/10 17:45:41 alex Exp $
+ * $Id: ngircd.c,v 1.31 2002/03/10 17:50:48 alex Exp $
  *
  * ngircd.c: Hier beginnt alles ;-)
  *
  * $Log: ngircd.c,v $
  *
  * ngircd.c: Hier beginnt alles ;-)
  *
  * $Log: ngircd.c,v $
+ * Revision 1.31  2002/03/10 17:50:48  alex
+ * - Handling von "--version" und "--help" nochmal geaendert ...
+ *
  * Revision 1.30  2002/03/10 17:45:41  alex
  * - bei "ngircd --version" werden nun die eincompilierten Pfade angezeigt.
  *
  * Revision 1.30  2002/03/10 17:45:41  alex
  * - bei "ngircd --version" werden nun die eincompilierten Pfade angezeigt.
  *
@@ -210,7 +213,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] )
 #endif
                        if( strcmp( argv[i], "--version" ) == 0 )
                        {
 #endif
                        if( strcmp( argv[i], "--version" ) == 0 )
                        {
-                               Show_Version( ); puts( "" );
+                               Show_Version( );
                                exit( 1 );
                        }
                }
                                exit( 1 );
                        }
                }
@@ -489,15 +492,16 @@ LOCAL VOID Show_Version( VOID )
        puts( "Copyright (c)2001,2002 by Alexander Barton (alex@barton.de).\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." );
        puts( "Copyright (c)2001,2002 by Alexander Barton (alex@barton.de).\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." );
-        puts( "\nCompile-time defaults:\n" );
-        puts( "  - configuration: "CONFIG_FILE );
-        puts( "  - MOTD file: "MOTD_FILE );
-        puts( "  - server error log: "ERROR_FILE );
 } /* Show_Version */
 
 
 LOCAL VOID Show_Help( VOID )
 {
 } /* Show_Version */
 
 
 LOCAL VOID Show_Help( VOID )
 {
+       puts( "Compile-time defaults:\n" );
+       puts( "  - configuration: "CONFIG_FILE );
+       puts( "  - MOTD file: "MOTD_FILE );
+       puts( "  - server error log: "ERROR_FILE"\n" );
+       puts( "Run-time options:\n" );
 #ifdef DEBUG
        puts( "  -d, --debug       log extra debug messages" );
 #endif
 #ifdef DEBUG
        puts( "  -d, --debug       log extra debug messages" );
 #endif