+GLOBAL bool
+Conf_DisableServer( const char *Name )
+{
+ /* Enable specified server and adjust port */
+
+ int i;
+
+ assert( Name != NULL );
+
+ for( i = 0; i < MAX_SERVERS; i++ ) {
+ if( strcasecmp( Conf_Server[i].name, Name ) == 0 ) {
+ /* Gotcha! Disable and disconnect server: */
+ Conf_Server[i].flags |= CONF_SFLAG_DISABLED;
+ if( Conf_Server[i].conn_id > NONE ) Conn_Close( Conf_Server[i].conn_id, NULL, "Server link terminated on operator request", true);
+ return true;
+ }
+ }
+ return false;
+} /* Conf_DisableServer */
+
+
+GLOBAL bool
+Conf_AddServer( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd )
+{
+ /* Add new server to configuration */
+
+ int i;
+
+ assert( Name != NULL );
+ assert( Host != NULL );
+ assert( MyPwd != NULL );
+ assert( PeerPwd != NULL );
+
+ /* Search unused item in server configuration structure */
+ for( i = 0; i < MAX_SERVERS; i++ ) {
+ /* Is this item used? */
+ if( ! Conf_Server[i].name[0] ) break;
+ }
+ if( i >= MAX_SERVERS ) return false;
+
+ Init_Server_Struct( &Conf_Server[i] );
+ strlcpy( Conf_Server[i].name, Name, sizeof( Conf_Server[i].name ));
+ strlcpy( Conf_Server[i].host, Host, sizeof( Conf_Server[i].host ));
+ strlcpy( Conf_Server[i].pwd_out, MyPwd, sizeof( Conf_Server[i].pwd_out ));
+ strlcpy( Conf_Server[i].pwd_in, PeerPwd, sizeof( Conf_Server[i].pwd_in ));
+ Conf_Server[i].port = Port;
+ Conf_Server[i].flags = CONF_SFLAG_ONCE;
+
+ return true;
+} /* Conf_AddServer */
+
+
+/**
+ * Check if the given nick name is an service
+ */
+GLOBAL bool
+Conf_IsService(int ConfServer, const char *Nick)
+{
+ return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
+} /* Conf_IsService */
+
+
+/**
+ * Initialize configuration settings with their default values.
+ */
+static void
+Set_Defaults(bool InitServers)
+{
+ int i;
+
+ strcpy(Conf_ServerName, "");
+ snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s",
+ PACKAGE_NAME, PACKAGE_VERSION);
+ strcpy(Conf_ServerPwd, "");
+
+ strcpy(Conf_ServerAdmin1, "");
+ strcpy(Conf_ServerAdmin2, "");
+ strcpy(Conf_ServerAdminMail, "");
+
+ strlcpy(Conf_MotdFile, SYSCONFDIR, sizeof(Conf_MotdFile));
+ strlcat(Conf_MotdFile, MOTD_FILE, sizeof(Conf_MotdFile));
+ strlcpy(Conf_MotdPhrase, MOTD_PHRASE, sizeof(Conf_MotdPhrase));