mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-30 17:24:44 +00:00
- Handling von "--version" und "--help" nochmal geaendert ...
This commit is contained in:
parent
0777bca325
commit
d67d94ea04
@ -94,7 +94,7 @@
|
|||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = "";
|
||||||
INSTALL_PATH = "$(HOME)/bin";
|
INSTALL_PATH = "$(HOME)/bin";
|
||||||
LIBRARY_SEARCH_PATHS = "";
|
LIBRARY_SEARCH_PATHS = "";
|
||||||
OTHER_CFLAGS = "";
|
OTHER_CFLAGS = "-DLOCALSTATEDIR=\\\\\\\"/usr/local/var\\\\\\\" -DSYSCONFDIR=\\\\\\\"/usr/local/etc\\\\\\\"";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_REZFLAGS = "";
|
OTHER_REZFLAGS = "";
|
||||||
PRODUCT_NAME = ngircd;
|
PRODUCT_NAME = ngircd;
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* 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
|
* conf.h: Konfiguration des ngircd
|
||||||
*
|
*
|
||||||
* $Log: conf.c,v $
|
* $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
|
* Revision 1.15 2002/03/06 15:35:19 alex
|
||||||
* - Dateinamen und Pfad sind nun in Konstanten definiert.
|
* - 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].name, "" );
|
||||||
strcpy( Conf_Server[Conf_Server_Count].pwd, "" );
|
strcpy( Conf_Server[Conf_Server_Count].pwd, "" );
|
||||||
Conf_Server[Conf_Server_Count].port = 0;
|
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].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
|
||||||
Conf_Server[Conf_Server_Count].res_stat = NULL;
|
Conf_Server[Conf_Server_Count].res_stat = NULL;
|
||||||
Conf_Server_Count++;
|
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( Line > 0 );
|
||||||
assert( Var != NULL );
|
assert( Var != NULL );
|
||||||
@ -353,10 +357,16 @@ GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
|
|||||||
{
|
{
|
||||||
/* Port, zu dem Verbunden werden soll */
|
/* Port, zu dem Verbunden werden soll */
|
||||||
port = atol( Arg );
|
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 );
|
else Log( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", Conf_File, Line, port );
|
||||||
return;
|
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 );
|
Log( LOG_ERR, "%s, line %d (section \"Server\"): Unknown variable \"%s\"!", Conf_File, Line, Var );
|
||||||
} /* Handle_SERVER */
|
} /* Handle_SERVER */
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* 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)
|
* conf.h: Konfiguration des ngircd (Header)
|
||||||
*
|
*
|
||||||
* $Log: conf.h,v $
|
* $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
|
* Revision 1.10 2002/02/27 23:23:53 alex
|
||||||
* - Includes fuer einige Header bereinigt.
|
* - Includes fuer einige Header bereinigt.
|
||||||
*
|
*
|
||||||
@ -56,19 +59,20 @@
|
|||||||
|
|
||||||
typedef struct _Conf_Oper
|
typedef struct _Conf_Oper
|
||||||
{
|
{
|
||||||
CHAR name[CLIENT_PASS_LEN];
|
CHAR name[CLIENT_PASS_LEN]; /* Name (ID) des IRC-OPs */
|
||||||
CHAR pwd[CLIENT_PASS_LEN];
|
CHAR pwd[CLIENT_PASS_LEN]; /* Passwort */
|
||||||
} CONF_OPER;
|
} CONF_OPER;
|
||||||
|
|
||||||
typedef struct _Conf_Server
|
typedef struct _Conf_Server
|
||||||
{
|
{
|
||||||
CHAR host[HOST_LEN];
|
CHAR host[HOST_LEN]; /* Hostname */
|
||||||
CHAR ip[16];
|
CHAR ip[16]; /* IP-Adresse (von Resolver) */
|
||||||
CHAR name[CLIENT_ID_LEN];
|
CHAR name[CLIENT_ID_LEN]; /* IRC-Client-ID */
|
||||||
CHAR pwd[CLIENT_PASS_LEN];
|
CHAR pwd[CLIENT_PASS_LEN]; /* Passwort */
|
||||||
INT port;
|
INT port; /* Server-Port */
|
||||||
time_t lasttry;
|
INT group; /* Gruppe des Servers */
|
||||||
RES_STAT *res_stat;
|
time_t lasttry; /* Letzter Connect-Versuch */
|
||||||
|
RES_STAT *res_stat; /* Status des Resolver */
|
||||||
} CONF_SERVER;
|
} CONF_SERVER;
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* 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")
|
* connect.h: Verwaltung aller Netz-Verbindungen ("connections")
|
||||||
*
|
*
|
||||||
* $Log: conn.c,v $
|
* $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
|
* Revision 1.47 2002/03/04 23:16:23 alex
|
||||||
* - Logging geaendert: detaillierter im Syslog, "allgemeiner" fuer Clients.
|
* - Logging geaendert: detaillierter im Syslog, "allgemeiner" fuer Clients.
|
||||||
*
|
*
|
||||||
@ -1008,6 +1011,7 @@ LOCAL VOID Check_Servers( VOID )
|
|||||||
/* Haben wir schon eine Verbindung? */
|
/* Haben wir schon eine Verbindung? */
|
||||||
for( n = 0; n < MAX_CONNECTIONS; n++ )
|
for( n = 0; n < MAX_CONNECTIONS; n++ )
|
||||||
{
|
{
|
||||||
|
/* Verbindung zu diesem Server? */
|
||||||
if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server == i ))
|
if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server == i ))
|
||||||
{
|
{
|
||||||
/* Komplett aufgebaute Verbindung? */
|
/* Komplett aufgebaute Verbindung? */
|
||||||
@ -1016,6 +1020,12 @@ LOCAL VOID Check_Servers( VOID )
|
|||||||
/* IP schon aufgeloest? */
|
/* IP schon aufgeloest? */
|
||||||
if( My_Connections[n].res_stat == NULL ) New_Server( i, n );
|
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].rdatalen = 0;
|
||||||
My_Connections[Idx].wbuf[0] = '\0';
|
My_Connections[Idx].wbuf[0] = '\0';
|
||||||
My_Connections[Idx].wdatalen = 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].lastdata = time( NULL );
|
||||||
My_Connections[Idx].lastping = 0;
|
My_Connections[Idx].lastping = 0;
|
||||||
My_Connections[Idx].lastprivmsg = time( NULL );
|
My_Connections[Idx].lastprivmsg = time( NULL );
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* 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 ;-)
|
* ngircd.c: Hier beginnt alles ;-)
|
||||||
*
|
*
|
||||||
* $Log: ngircd.c,v $
|
* $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
|
* Revision 1.30 2002/03/10 17:45:41 alex
|
||||||
* - bei "ngircd --version" werden nun die eincompilierten Pfade angezeigt.
|
* - bei "ngircd --version" werden nun die eincompilierten Pfade angezeigt.
|
||||||
*
|
*
|
||||||
@ -210,7 +213,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] )
|
|||||||
#endif
|
#endif
|
||||||
if( strcmp( argv[i], "--version" ) == 0 )
|
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( "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( "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( "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 */
|
} /* Show_Version */
|
||||||
|
|
||||||
|
|
||||||
LOCAL VOID Show_Help( VOID )
|
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
|
#ifdef DEBUG
|
||||||
puts( " -d, --debug log extra debug messages" );
|
puts( " -d, --debug log extra debug messages" );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user