Ejemplo n.º 1
0
void setup_ov_mode(int on, int hide, int log)
{
#ifdef WANT_OPERVIEW 

char *default_oper = "wsckf";
Window *win = NULL;

	if (on)
	{
		if ((win = get_window_by_name("oper_view")))
		{
			if (win->log)
			do_log(0, NULL, &win->log_fp);
			delete_window(win);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
		}
		send_to_server("MODE %s -%s%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper, send_umode);
	} 
	else 
	{
		Window *tmp = NULL;
		win = current_window;
		if ((tmp = new_window(current_window->screen)))
		{
			malloc_strcpy(&tmp->name, "oper_view");
			tmp->double_status = 0;
			if (hide)
				hide_window(tmp);
			else
				resize_window(1, tmp, -5);
			tmp->window_level = LOG_WALLOP|LOG_OPNOTE|LOG_SNOTE;
			tmp->absolute_size = 1;
			tmp->skip = 1;
			set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, fget_string_var(FORMAT_OV_FSET));
			build_status(tmp, NULL, 0);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
			send_to_server("MODE %s +%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper);
			set_screens_current_window(win->screen, win);
			tmp->mangler = operlog_line_mangler;
			if (log != -1)
			{
				tmp->log = log;
				if (tmp->log)
					do_log(log, "~/.BitchX/operview.log", &tmp->log_fp);
			}
		}
	}
#endif
}
Ejemplo n.º 2
0
/*
 * Send a status update to all connected clients
 */
void broadcast_status() {
    struct cl_entry *current;
    struct net_status *status;
    uint8_t dcount;
    uint16_t scount;
    uint8_t tcount;
    uint8_t permission;
    int ret;
    
    /*
     * Start iteration over complete client list
     * This locks the mutex for the client list
     */
    current = start_iteration();

    /* Get number of users */
    dcount = docent_exists();
    tcount = tutor_exists();
    scount = get_client_count() - dcount - tcount;

    while (current != NULL) {
        if (current == get_write_user()) {
            permission = 1;
        } else {
            permission = 0;
        }

        /* Build the status message */
        status = build_status(current->cdata->role, current->cdata->cid,
                permission, dcount, tcount, scount);
        ret = send(current->cdata->sfd, status, sizeof(struct net_status), 0);
        if (ret < 0) {
            perror("send");
        }
        free(status);
        /* Select next client in list */
        current = iteration_next();
    }

    log_debug("broadcasting agent: status sent to all connected clients");
    /*
     * End of iteration
     * This unlocks the mutex of the client list
     */
    end_iteration();
}
Ejemplo n.º 3
0
void debug_window(Window *win, char *value, int unused)
{
	Window	*old_win = win;
	char	*nv = NULL;

	internal_debug = parse_debug(value, internal_debug, &nv);
	set_string_var(DEBUG_VAR, nv);

	if (internal_debug)
	{
		Window *tmp = NULL;
		if (!get_window_by_name("debug") && (tmp = new_window(win->screen)))
		{
			malloc_strcpy(&tmp->name, "debug");
			tmp->double_status = 0;
			hide_window(tmp);
			tmp->window_level = LOG_DEBUG;
			tmp->absolute_size = 1;
			tmp->skip = 1;
			debugging_window = tmp;
			set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, DEFAULT_FORMAT_DEBUG_FSET);
			build_status(tmp, NULL, 0);
			update_all_windows();
			set_input_prompt(win, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
			set_screens_current_window(old_win->screen, old_win);
		}
	}
	else
	{
		if ((old_win = get_window_by_name("debug")))
		{
			delete_window(old_win);
			debugging_window = NULL;
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
		}
	}
	new_free(&nv);
}
Ejemplo n.º 4
0
Archivo: main.c Proyecto: jnbek/TekNap
int main(int argc, char *argv[], char *envp[])
{
	char	*channel;

	debug_init();
	srand((unsigned)time(NULL));
	time(&start_time);
	time(&idle_time);
	time(&now);
#ifdef WINNT
	fprintf(stdout, "%s %s\r\n", nap_version, internal_version);
	fprintf(stdout, "%s\r\n", main_version);
#else
	fprintf(stdout, "%s %s\n", nap_version, internal_version);
	fprintf(stdout, "%s\n",  main_version);
#endif
	channel = parse_args(argv, argc, envp);

	FD_ZERO(&readables);
	FD_ZERO(&writables);
	
	if (term_init(NULL))
		_exit(1);

/* 	my_signal(SIGQUIT, SIG_IGN, 0);*/
	my_signal(SIGHUP, irc_exit_old, 0);
	my_signal(SIGTERM, irc_exit_old, 0);
	my_signal(SIGPIPE, SIG_IGN, 0);
	my_signal(SIGINT, cntl_c, 0);
	my_signal(SIGALRM, nothing, 0);
        my_signal(SIGCHLD, child_reap, 0);
	my_signal(SIGCONT, term_cont, 0);
	my_signal(SIGWINCH, sig_refresh_screen, 0);
	my_signal(SIGUSR1, sigusr1, 0);
	        
	if (!init_screen()) 
	{
		create_new_screen();
		new_window(main_screen);
	}

	init_keys();
	init_keys2();
	init_variables();
#ifdef WANT_THREAD
	init_share_mutexes();
#ifdef WANT_NSLOOKUP
	start_dns();
#endif
#ifdef WANT_MP3PLAYER
	start_mp3();
#endif

#ifdef GTK
	start_tgtk();
#endif
#endif
	build_status(current_window, NULL, 0);
	update_input(UPDATE_ALL);

#ifndef WINNT
	charset_ibmpc();
#endif
	load_scripts();
	read_unfinished_list();
	if (auto_connect)
	{
		int serv = 0;
		reload_save(NULL, NULL, NULL, NULL, 0);
		if (starting_server != -1)
			serv = starting_server;
		connect_to_server_by_refnum(serv, -1, create);
		current_window->server = serv;
		xterm_settitle();
	} 
	else
	{
		if (do_get_napigator)
			get_napigator();
		display_server_list();
	}
			
	set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
	for (;;)
		io("main");
#ifdef GUI1
	gui_exit();
#else
	nappanic("get_line() returned");
#endif
	return (-((int)0xdead));
}
Ejemplo n.º 5
0
Archivo: send.c Proyecto: jnbek/TekNap
void napfile_read(int snum)
{
GetFile *gf;
int rc;
SocketList *s;
	s = get_socket(snum);
	if (!(gf = (GetFile *)get_socketinfo(snum)))
	{
		unsigned char buff[2*BIG_BUFFER_SIZE+1];
		unsigned char fbuff[2*BIG_BUFFER_SIZE+1];
		char *nick, *filename, *args;
		
		alarm(10);
		if ((rc = read(snum, buff, 2 * BIG_BUFFER_SIZE)) < 0)
		{
			alarm(0);
			nap_finished_file(snum, PREMATURE_FINISH);
			return;
		}
		alarm(0);
		buff[rc] = 0;
		args = &buff[0];
		if (!*args || !strcmp(buff, "FILE NOT FOUND") || 
			!strcmp(buff, "INVALID REQUEST") || 
			!strcmp(buff, "FILE NOT REQUESTED"))
		{
			say("Error in napfile_read(%d/%s) %s", snum, (rc == 0) ? strerror(errno) : "", *args ? args : "unknown read");
			nap_finished_file(snum, PREMATURE_FINISH);
			return;
		}

		nick = next_arg(args, &args);
		if ((filename = new_next_arg(args, &args)) && *filename)
		{
			strcpy(fbuff, filename);
			convertnap_unix(fbuff);
		}
		if (!nick || !filename || !*filename || !args || !*args
			|| !(gf = find_in_getfile(0, nick, NULL, fbuff, 0, NAP_UPLOAD))
			|| (gf->write == -1))
		{
			memset(buff, 0, 80);
			if (!gf)
				sprintf(buff, "INVALID REQUEST");

			else
			{
				sprintf(buff, "FILE NOT FOUND");
				break_from_list((List **)&transfer_struct, (List *)gf);
				gf->socket = snum;
				if (gf->write == -1)
				{
					send_ncommand(CMDS_REMOVEFILE, "%s", fbuff);
					say("Unable to open [%s]", fbuff);
				}
				else
				{
					close(gf->write);
					gf->write = -1;
				}
			}
			write(snum, buff, strlen(buff));
			nap_finished_file(snum, PREMATURE_FINISH);
			return;
		}
		gf->resume = my_atol(next_arg(args, &args));
		if (gf->resume >= gf->filesize)
		{
			break_from_list((List **)&transfer_struct, (List *)gf);
			close(gf->write);
			gf->write = -1;
			nap_finished_file(snum, PREMATURE_FINISH);
			return;
		}
		if (gf->socket != -1)
		{
			put_it("ERROR gf->socket != -1 %d %s %s", snum, nick, filename);
			break_from_list((List **)&transfer_struct, (List *)gf);
			close(gf->write);
			gf->write = -1;
			nap_finished_file(snum, PREMATURE_FINISH);
			return;
		}
		gf->socket = snum;
		lseek(gf->write, SEEK_SET, gf->resume);
		set_socketinfo(snum, gf);
		memset(buff, 0, 80);
		sprintf(buff, "%lu", gf->filesize);
		write(snum, buff, strlen(buff));
		s->func_write = s->func_read;
		s->is_write = s->is_read;
		if (do_hook(NAPSEND_LIST, "%s %s %lu \"%s\"", gf->resume ? "RESUME":"SEND", gf->nick, gf->filesize, gf->filename) && !get_int_var(QUIET_SENDS_VAR))
			put_it("* %sing file to %s [%s] (%s)", gf->resume ? "Resum" : "Send", gf->nick, base_name(gf->filename), longcomma(gf->filesize));
		set_non_blocking(snum);
		build_status(current_window, NULL, 0);
		send_ncommand(CMDS_UPDATE_SEND1, NULL);
		return;
	} else if (!gf->starttime)
		gf->starttime = now;
	s->func_write = s->func_read = napfile_sendfile;
	napfile_sendfile(snum);
}
Ejemplo n.º 6
0
Archivo: send.c Proyecto: jnbek/TekNap
void napfile_sendfile(int snum)
{
GetFile *gf;
unsigned char buffer[3*BIG_BUFFER_SIZE+1];
int rc, numread;
int flag = NORMAL_FINISH;
SocketList *s;

	if (!(s = get_socket(snum)) || !(gf = (GetFile *)s->info))
	{
		put_it("error get_socket(%d)", snum);
		nap_finished_file(snum, PREMATURE_FINISH);
		return;
	}
	if (gf->deleted)
	{
		if (gf->write != -1)
			close(gf->write);
		gf->write = -1;
		if (gf->deleted++ > 5)
			close_socketread(snum);
		return;
	}
	numread = read(gf->write, buffer, 2*BIG_BUFFER_SIZE);
	switch(numread)
	{
		case -1:
			flag = PREMATURE_FINISH;
			if (do_hook(NAPERROR_LIST, "%s %lu %lu \"%s\"", gf->nick, gf->received+gf->resume, gf->filesize, gf->filename) && !get_int_var(QUIET_SENDS_VAR))
				put_it("* Error sending %s (%lu/%lu) to %s ", gf->nick, gf->received+gf->resume, gf->filesize, base_name(gf->filename));
			break_from_list((List **)&transfer_struct, (List *)gf);
			close(gf->write);
			gf->write = -1;
			nap_finished_file(snum, flag);
			build_status(current_window, NULL, 0);
			send_ncommand(CMDS_UPDATE_SEND, NULL);
			return;
		case 0:
		{
			break_from_list((List **)&transfer_struct, (List *)gf);
			if ((gf->received + gf->resume) >= gf->filesize)
			{
				double speed;
				char speed1[80];
				time_t length;
				if (!(length = now - gf->starttime))
					length = 1;
				shared_stats.files_served++;
				shared_stats.filesize_served += gf->received;
				speed = gf->received / 1024.0 / length;
				if (speed > shared_stats.max_uploadspeed)
				{
					shared_stats.max_uploadspeed = speed;
					malloc_strcpy(&shared_stats.max_uploadspeed_nick, gf->nick);
				}
				sprintf(speed1, "%4.2fK/s", speed);
				if (do_hook(NAPFINISH_LIST, "%s %lu \"%s\"", gf->nick, gf->filesize, gf->filename) && !get_int_var(QUIET_SENDS_VAR))
					put_it("* Finished Sending %s (%s) [%s] at %s", gf->nick, longcomma(gf->filesize), base_name(gf->filename), speed1);
			}
			else 
			{
				flag = PREMATURE_FINISH;
				if (do_hook(NAPERROR_LIST, "%s %lu %lu \"%s\"", gf->nick, gf->received+gf->resume, gf->filesize, gf->filename) && !get_int_var(QUIET_SENDS_VAR))
					put_it("* Error sending %s (%lu/%lu) to %s ", gf->nick, gf->received+gf->resume, gf->filesize, base_name(gf->filename));
			}
			close(gf->write);
			gf->write = -1;
			nap_finished_file(snum, flag);
			build_status(current_window, NULL, 0);
			send_ncommand(CMDS_UPDATE_SEND, NULL);
			return;
		}
		default:
		{
			alarm(2);
			rc = send(snum, buffer, numread, 0);
			alarm(0);
			if (rc == -1)
			{
				if (errno == EWOULDBLOCK || errno == ENOBUFS || errno == EDEADLK)
					lseek(gf->write, -numread, SEEK_CUR);
				else
				{
					break_from_list((List **)&transfer_struct, (List *)gf);
					if (do_hook(NAPERROR_LIST, "%s %lu %lu \"%s\"", gf->nick, gf->received+gf->resume, gf->filesize, gf->filename) && !get_int_var(QUIET_SENDS_VAR))
						put_it("* Error sending %s (%lu/%lu) %s", gf->nick, gf->received+gf->resume, gf->filesize, base_name(gf->filename));
					close(gf->write);
					gf->write = -1;
					nap_finished_file(snum, PREMATURE_FINISH);
					build_status(current_window, NULL, 0);
					send_ncommand(CMDS_UPDATE_SEND, NULL);
				}
				return;
			}
			if (rc != numread)
				lseek(gf->write, -(numread - rc), SEEK_CUR);
			gf->received += rc;
			if (!(gf->received % (10 * (2*BIG_BUFFER_SIZE))))
				build_status(current_window, NULL, 0);
		}
	}
}
Ejemplo n.º 7
0
Archivo: vars.c Proyecto: jnbek/TekNap
void reinit_status(Window *win, char *unused, int value)
{
	update_all_windows();
	update_all_status(current_window, NULL, 0);
	build_status(current_window, NULL, 0);
}
Ejemplo n.º 8
0
Archivo: vars.c Proyecto: jnbek/TekNap
/*
 * init_variables: initializes the string variables that can't really be
 * initialized properly above 
 */
void init_variables()
{
#if defined(WINNT) || defined(__EMX__)
	char *shell;
#endif
	int old_display = window_display;
 	int i;
	char *s;
		
	for (i = 1; i < NUMBER_OF_VARIABLES - 1; i++)
		if (strcmp(irc_variable[i-1].name, irc_variable[i].name) >= 0)
			nappanic("Variable [%d] (%s) is out of order.", i, irc_variable[i].name);

	window_display = 0;

	set_string_var(DEFAULT_EMAIL_VAR, "blah@opennap");
	set_string_var(DEFAULT_SERVER_VAR, "bitchx.dimension6.com");
	if (*password)
		set_string_var(DEFAULT_PASSWORD_VAR, password);
	else
		set_string_var(DEFAULT_PASSWORD_VAR, "blah");
	if (*nickname)
		set_string_var(DEFAULT_NICKNAME_VAR,	nickname);
	else
		set_string_var(DEFAULT_NICKNAME_VAR,	"blah");

	set_string_var(DEFAULT_SPEED_VAR, "?");
	set_string_var(PTEST_CHANGE_PORT_VAR, "8899 0");

	s = m_strdup(irc_lib);
	malloc_strcat(&s, "/help");
	set_string_var(HELP_PATH_VAR, s);
	new_free(&s);
	set_string_var(LOGFILE_VAR, DEFAULT_LOGFILE);

	set_string_var(FORMAT_DIRECTORY_VAR, "%d");
	set_string_var(FORMAT_FILENAME_VAR, "%g4.1L %b %t %f");
	set_string_var(SEARCH_FORMAT_VAR, "%-40f %b %3.1H %t %g4.1L %N %1.3p");
	
	set_string_var(NAMES_NICKCOLOR_VAR, FORMAT_NICKCOLOR);
	set_string_var(DOWNLOAD_DIRECTORY_VAR, DEFAULT_DOWNLOAD_DIRECTORY);
	
	set_string_var(SHOW_NUMERICS_STR_VAR, DEFAULT_SHOW_NUMERICS_STR);
	set_numeric_string(current_window, DEFAULT_SHOW_NUMERICS_STR, 0);

	set_string_var(CMDCHARS_VAR, DEFAULT_CMDCHARS);
	set_string_var(LOGFILE_VAR, DEFAULT_LOGFILE);
	set_string_var(WORD_BREAK_VAR, DEFAULT_WORD_BREAK);

#if defined(__EMX__)
	if ((shell = getenv("SHELL")))
	{
		set_string_var(SHELL_VAR, path_search(shell, getenv("PATH")));
        	if (getenv("SHELL_FLAGS"))
        		set_string_var(SHELL_FLAGS_VAR, getenv("SHELL_FLAGS"));
	}
	else
	{
	        shell = "cmd.exe";
        	set_string_var(SHELL_FLAGS_VAR, "/c");
		set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH"))));
	}
#elif WINNT
	if ((shell = getenv("SHELL")))
	{
		set_string_var(SHELL_VAR, path_search(shell, getenv("PATH")));
        	if (getenv("SHELL_FLAGS"))
        		set_string_var(SHELL_FLAGS_VAR, getenv("SHELL_FLAGS"));
	}
 	else if (gdwPlatform == VER_PLATFORM_WIN32_WINDOWS)
	{
		shell = "command.com";
        	set_string_var(SHELL_FLAGS_VAR, "/c");
		set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH"))));
	}
	else
	{
	        shell = "cmd.exe";
        	set_string_var(SHELL_FLAGS_VAR, "/c");
		set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH"))));
	}
#else
	set_string_var(SHELL_VAR, DEFAULT_SHELL);
	set_string_var(SHELL_FLAGS_VAR, DEFAULT_SHELL_FLAGS);
#endif


	set_string_var(CONTINUED_LINE_VAR, DEFAULT_CONTINUED_LINE);
	set_string_var(INPUT_PROMPT_VAR, DEFAULT_INPUT_PROMPT);
	set_string_var(HIGHLIGHT_CHAR_VAR, DEFAULT_HIGHLIGHT_CHAR);
	set_string_var(LASTLOG_LEVEL_VAR, DEFAULT_LASTLOG_LEVEL);

	set_string_var(STATUS_FORMAT1_VAR, DEFAULT_STATUS_FORMAT1);
	set_string_var(STATUS_FORMAT2_VAR, DEFAULT_STATUS_FORMAT2);

	set_string_var(STATUS_CHANNEL_VAR, DEFAULT_STATUS_CHANNEL);
	set_string_var(STATUS_CLOCK_VAR, DEFAULT_STATUS_CLOCK);
	set_string_var(STATUS_CPU_SAVER_VAR, DEFAULT_STATUS_CPU_SAVER);
	set_string_var(STATUS_HOLD_VAR, DEFAULT_STATUS_HOLD);
	set_string_var(STATUS_HOLD_LINES_VAR, DEFAULT_STATUS_HOLD_LINES);
	set_string_var(STATUS_INSERT_VAR, DEFAULT_STATUS_INSERT);
	set_string_var(STATUS_NICK_VAR, DEFAULT_STATUS_NICK);
	set_string_var(STATUS_NOTIFY_VAR, DEFAULT_STATUS_NOTIFY);
	set_string_var(STATUS_OVERWRITE_VAR, DEFAULT_STATUS_OVERWRITE);
	set_string_var(STATUS_QUERY_VAR, DEFAULT_STATUS_QUERY);
	set_string_var(STATUS_SERVER_VAR, DEFAULT_STATUS_SERVER);
	set_string_var(STATUS_STATS_VAR, DEFAULT_STATUS_STATS);
	set_string_var(STATUS_USER0_VAR, DEFAULT_STATUS_USER);
	set_string_var(STATUS_USER1_VAR, DEFAULT_STATUS_USER1);
	set_string_var(STATUS_USER2_VAR, DEFAULT_STATUS_USER2);
	set_string_var(STATUS_USER3_VAR, DEFAULT_STATUS_USER3);
	set_string_var(STATUS_USER4_VAR, DEFAULT_STATUS_USER4);
	set_string_var(STATUS_USER5_VAR, DEFAULT_STATUS_USER5);
	set_string_var(STATUS_USER6_VAR, DEFAULT_STATUS_USER6);
	set_string_var(STATUS_USER7_VAR, DEFAULT_STATUS_USER7);
	set_string_var(STATUS_USER8_VAR, DEFAULT_STATUS_USER8);
	set_string_var(STATUS_USER9_VAR, DEFAULT_STATUS_USER9);
	set_string_var(STATUS_USER10_VAR, DEFAULT_STATUS_USER10);
	set_string_var(STATUS_USER11_VAR, DEFAULT_STATUS_USER11);
	set_string_var(STATUS_USER12_VAR, DEFAULT_STATUS_USER12);
	set_string_var(STATUS_USER13_VAR, DEFAULT_STATUS_USER13);
	set_string_var(STATUS_USER14_VAR, DEFAULT_STATUS_USER14);
	set_string_var(STATUS_USER15_VAR, DEFAULT_STATUS_USER15);
	set_string_var(STATUS_USER16_VAR, DEFAULT_STATUS_USER16);
	set_string_var(STATUS_USER17_VAR, DEFAULT_STATUS_USER17);
	set_string_var(STATUS_USER18_VAR, DEFAULT_STATUS_USER18);
	set_string_var(STATUS_USER19_VAR, DEFAULT_STATUS_USER19);
	set_string_var(STATUS_USER20_VAR, DEFAULT_STATUS_USER20);
	set_string_var(STATUS_USER21_VAR, DEFAULT_STATUS_USER21);
	set_string_var(STATUS_USER22_VAR, DEFAULT_STATUS_USER22);
	set_string_var(STATUS_USER23_VAR, DEFAULT_STATUS_USER23);
	set_string_var(STATUS_USER24_VAR, DEFAULT_STATUS_USER24);
	set_string_var(STATUS_USER25_VAR, DEFAULT_STATUS_USER25);
	set_string_var(STATUS_USER26_VAR, DEFAULT_STATUS_USER26);
	set_string_var(STATUS_USER27_VAR, DEFAULT_STATUS_USER27);
	set_string_var(STATUS_USER28_VAR, DEFAULT_STATUS_USER28);
	set_string_var(STATUS_USER29_VAR, DEFAULT_STATUS_USER29);
	set_string_var(STATUS_USER30_VAR, DEFAULT_STATUS_USER30);
	set_string_var(STATUS_USER31_VAR, DEFAULT_STATUS_USER31);
	set_string_var(STATUS_USER32_VAR, DEFAULT_STATUS_USER32);
	set_string_var(STATUS_USER33_VAR, DEFAULT_STATUS_USER33);
	set_string_var(STATUS_USER34_VAR, DEFAULT_STATUS_USER34);
	set_string_var(STATUS_USER35_VAR, DEFAULT_STATUS_USER35);
	set_string_var(STATUS_USER36_VAR, DEFAULT_STATUS_USER36);
	set_string_var(STATUS_USER37_VAR, DEFAULT_STATUS_USER37);
	set_string_var(STATUS_USER38_VAR, DEFAULT_STATUS_USER38);
	set_string_var(STATUS_USER39_VAR, DEFAULT_STATUS_USER39);
	set_string_var(STATUS_WINDOW_VAR, DEFAULT_STATUS_WINDOW);
	set_string_var(STATUS_SCROLLBACK_VAR, DEFAULT_STATUS_SCROLLBACK);
	
	set_string_var(ILLEGAL_CHARS_VAR, DEFAULT_ILLEGAL_CHARS);
		
	set_beep_on_msg(current_window, DEFAULT_BEEP_ON_MSG, 0);

	set_cd_device(current_window, "/dev/cdrom", 0);

	set_lastlog_size(current_window, NULL, irc_variable[LASTLOG_VAR].integer);
	set_history_size(current_window, NULL, irc_variable[HISTORY_VAR].integer);

	set_lastlog_level(current_window, irc_variable[LASTLOG_LEVEL_VAR].string, 0);

	set_input_prompt(current_window, DEFAULT_INPUT_PROMPT, 0);
	build_status(current_window, NULL, 0);
	window_display = old_display;
}