dslinux/user/bitchx/include PMbitchx.h alias.h alist.h array.h bitchx bsdglob.h cdcc.h cdns.h cdrom.h chelp.h color.h commands.h config.h cset.h ctcp.h dcc.h debug.h defs.h.in dlfcn.h encrypt.h exec.h files.h flood.h funny.h gtkbitchx.h gui.h hash.h hash2.h hebrew.h help.h history.h hold.h hook.h if.h ignore.h input.h irc.h irc_std.h ircaux.h ircterm.h keys.h lastlog.h list.h log.h mail.h misc.h module.h modval.h names.h newio.h notice.h notify.h numbers.h output.h parse.h queue.h screen.h server.h ssl.h stack.h status.h struct.h tcl_bx.h timer.h translat.h userlist.h vars.h who.h whowas.h winbitchx.h window.h

stsp stsp at user.in-berlin.de
Sun Jul 2 15:18:39 CEST 2006


Update of /cvsroot/dslinux/dslinux/user/bitchx/include
In directory antilope:/tmp/cvs-serv9280/include

Added Files:
	PMbitchx.h alias.h alist.h array.h bitchx bsdglob.h cdcc.h 
	cdns.h cdrom.h chelp.h color.h commands.h config.h cset.h 
	ctcp.h dcc.h debug.h defs.h.in dlfcn.h encrypt.h exec.h 
	files.h flood.h funny.h gtkbitchx.h gui.h hash.h hash2.h 
	hebrew.h help.h history.h hold.h hook.h if.h ignore.h input.h 
	irc.h irc_std.h ircaux.h ircterm.h keys.h lastlog.h list.h 
	log.h mail.h misc.h module.h modval.h names.h newio.h notice.h 
	notify.h numbers.h output.h parse.h queue.h screen.h server.h 
	ssl.h stack.h status.h struct.h tcl_bx.h timer.h translat.h 
	userlist.h vars.h who.h whowas.h winbitchx.h window.h 
Log Message:
Adding pristine copy of BitchX so I can branch from it.


--- NEW FILE: files.h ---
/*
 * files.h -- header file for files.c
 *
 * Direct file manipulation for irc?  Unheard of!
 * (C) 1995 Jeremy Nelson
 * See the COPYRIGHT file for copyright information
 *
 */

#ifndef FILES_H
#define FILES_H

#include "irc_std.h"

extern	int	open_file_for_read (char *);
extern	int	open_file_for_write (char *);
extern	int	file_write (int, char *);
extern	int	file_writeb (int, char *);
extern	char *	file_read (int);
extern	char *	file_readb (int, int);
extern	int	file_eof (int);
extern	int	file_close (int);
extern 	int	open_file_for_bwrite (char *);
extern	int	file_copy (int, int);
extern        int     file_valid (int);

#endif

--- NEW FILE: whowas.h ---

#ifndef _WhoWas_h
#define _WhoWas_h

#define whowas_userlist_max 300
#define whowas_reg_max 500
#define whowas_chan_max 20
#include "hash.h"

typedef struct _whowaschan_str {
	struct _whowaschan_str *next;
	char *channel;
	int refnum;
	ChannelList *channellist;
	time_t time;
} WhowasChanList;

typedef struct _whowaswrapchan_str {
	HashEntry NickListTable[WHOWASLIST_HASHSIZE];
} WhowasWrapChanList;

typedef struct _whowas_str {
	struct _whowas_str *next;
	int	has_ops; 	/* true is user split away with opz */
	char 	*channel;	/* name of channel */
	time_t 	time;		/* time of split/leave */
	char	*server1;
	char	*server2;
	NickList *nicklist;	/* pointer to nicklist */
	ShitList *shitlist;	/* pointer to shitlist */
	ChannelList *channellist;		
} WhowasList;

typedef struct _whowas_wrap_str {
	unsigned long total_hits;
	unsigned long total_links;
	unsigned long total_unlinks;
	HashEntry NickListTable[WHOWASLIST_HASHSIZE];
} WhowasWrapList;

WhowasList *check_whowas_buffer (char *, char *, char *, int);
WhowasList *check_whowas_nick_buffer (char *, char *, int);
WhowasList *check_whosplitin_buffer (char *, char *, char *, int);

void add_to_whowas_buffer (NickList *, char *, char *, char *);
void add_to_whosplitin_buffer (NickList *, char *, char *, char *);

int remove_oldest_whowas (WhowasWrapList *, time_t, int);
void clean_whowas_list (void);
void sync_whowas_adduser (UserList *);
void sync_whowas_unuser (UserList *);
void sync_whowas_addshit (ShitList *);
void sync_whowas_unshit (ShitList *);

WhowasChanList *check_whowas_chan_buffer (char *, int, int);
void add_to_whowas_chan_buffer (ChannelList *);
int remove_oldest_chan_whowas (WhowasChanList **, time_t, int);
void clean_whowas_chan_list (void);
void show_whowas (void);
void show_wholeft (char *);

extern WhowasWrapList whowas_splitin_list;
#endif

--- NEW FILE: ignore.h ---
/*
 * ignore.h: header for ignore.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 */

#ifndef __ignore_h_
#define __ignore_h_

/* Type of ignored nicks */
#define IGNORE_MSGS	0x0001
#define IGNORE_PUBLIC	0x0002
#define IGNORE_WALLS	0x0004
#define IGNORE_WALLOPS	0x0008
#define IGNORE_INVITES	0x0010
#define IGNORE_NOTICES	0x0020
#define IGNORE_NOTES	0x0040
#define IGNORE_CTCPS	0x0080

#define IGNORE_CDCC	0x0100
#define IGNORE_KICKS	0x0200
#define IGNORE_MODES	0x0400
#define IGNORE_SMODES	0x0800
#define IGNORE_JOINS	0x1000
#define IGNORE_TOPICS	0x2000
#define IGNORE_QUITS	0x4000
#define IGNORE_PARTS	0x8000
#define IGNORE_NICKS	0x10000
#define IGNORE_PONGS	0x20000
#define IGNORE_SPLITS	0x40000
#define IGNORE_CRAP	0x80000


#define IGNORE_ALL	(IGNORE_MSGS | IGNORE_PUBLIC | IGNORE_WALLS | \
			IGNORE_WALLOPS | IGNORE_INVITES | IGNORE_NOTICES | \
			IGNORE_NOTES | IGNORE_CTCPS | IGNORE_CRAP | \
			IGNORE_CDCC | IGNORE_KICKS | IGNORE_MODES | \
			IGNORE_SMODES | IGNORE_JOINS | IGNORE_TOPICS | \
			IGNORE_QUITS | IGNORE_PARTS | IGNORE_NICKS | \
			IGNORE_PONGS | IGNORE_SPLITS)

#define IGNORED		1
#define DONT_IGNORE	2
#define HIGHLIGHTED	-1
#define CHANNEL_GREP	-2

extern	int	ignore_usernames;
extern	char	*highlight_char;
extern Ignore	*ignored_nicks;

int	is_ignored (char *, long);
int	check_ignore (char *, char *, char *, long, char *);
void	ignore (char *, char *, char *, char *);
void	tignore (char *, char *, char *, char *);
void	ignore_nickname (char *, long, int);
long	ignore_type (char *, int);
int	check_is_ignored(char *);
char 	*get_ignores_by_pattern (char *patterns, int covered);
int	get_type_by_desc (char *type, int *do_mask, int *dont_mask);
char	*get_ignore_types (Ignore *tmp);
char	*get_ignore_types_by_pattern (char *pattern);
char	*get_ignore_patterns_by_type (char *ctype);

#endif /* __ignore_h_ */

--- NEW FILE: if.h ---
/*
 * if.h: header for if.c
 *
 * copyright(c) 1994 matthew green
 *
 * See the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: if.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __if_h
# define __if_h

	void	ifcmd (char *, char *, char *, char *);
	void	whilecmd (char *, char *, char *, char *);
	void	foreach_handler (char *, char *, char *);
	void	foreach (char *, char *, char *, char *);
	void	fe (char *, char *, char *, char *);
	void	forcmd (char *, char *, char *, char *);
	void	fec (char *, char *, char *, char *);
	void	docmd (char *, char *, char *, char *);
	void	switchcmd (char *, char *, char *, char *);
extern	char *  next_expr       	(char **, char);
extern	char *  next_expr_failok        (char **, char);
  		
#endif /* __if_h */

--- NEW FILE: gtkbitchx.h ---
#ifndef _GTK_BITCHX_
#define _GTK_BITCHX_

#if defined(GUI)
#ifdef __linux__
/* For glibc linux systems. */ 
#ifndef _REENTRANT
#define _REENTRANT
#endif
#ifndef _POSIX_SOURCE             
#define _POSIX_SOURCE
#endif
#define _P __P                 
#endif                         

/* So X11/X.h won't get included */
#define X_H

void menuitemhandler(gpointer *data);
GtkWidget *newsubmenu(MenuStruct *menutoadd);

int gtk_getx(void);
int gtk_gety(void);
void newmenubar(Screen *menuscreen, MenuStruct *menutoadd);
GtkWidget *newsubmenu(MenuStruct *menutoadd);
void gtk_new_window(Screen *new, Window *win);
void gtk_paste (GtkWidget *widget, GtkSelectionData *selection_data,
                           gpointer data);
void selection_handle (GtkWidget *widget,
					   GtkSelectionData *selection_data,
					   guint info, guint seltime);
int gtkprintf(char *format, ...);
void size_allocate (GtkWidget *widget, GtkWindow *window);

void gtk_about_box(char *about_text);
void gtk_label_set_color(GtkWidget *label, int color);
void gtk_tab_move(int page, int pos);
void gtk_main_paste(int refnum);

int notebook_page_by_refnum(int refnum);
void make_new_notebook(void);
void tab_to_window(Screen *tmp);
void window_to_tab(Screen *tmp);
char *gtk_windowlabel(Screen *tmp);
void gtk_windowicon(GtkWidget *window);

void make_tip(GtkWidget *widget, char *tip);

#endif

void gui_mutex_lock(void);
void gui_mutex_unlock(void);

#endif

--- NEW FILE: cdcc.h ---
#ifndef _CDCC_H_
#define _CDCC_H_

#include <sys/types.h>
#include <sys/stat.h>

/* local commands */
extern double cdcc_minspeed;

typedef struct {
	char *name;
	int (*function)(char *args, char *rest);
	char *help;
} local_cmd;

/* remote commands */
typedef struct {
	char *name;
	int (*function)(char *from, char *args);
	char *help;
} remote_cmd;

/* offer pack type */
typedef struct packtype {
	struct packtype *next;
	int num;
	char *file;
	char *desc;
	char *notes;
	int numfiles;
	int gets;
	int server;
	time_t timeadded;
	unsigned long size;
	double minspeed;
	char	*password;
} pack;

/* cdcc queue struct */
typedef struct queuetype {
	struct queuetype *next;
	char *nick;
	char *file;
	int numfiles;
	time_t time;
	char *desc;
	char *command;
	int num;
	int server;
} queue;
	
/* local command parser */
void cdcc(char *, char *, char *, char *);

/* remote message command parser */
char *msgcdcc(char *, char *, char *);

/* send a file from the queue */
void dcc_sendfrom_queue (void);

void cdcc_timer_offer (void);

/* publicly list offered packs */
int l_plist(char *, char *);

int BX_get_num_queue(void);
int BX_add_to_queue(char *, char *, pack *);

#endif

--- NEW FILE: who.h ---
/*
 * who.h -- header info for the WHO, ISON, and USERHOST queues.
 * Copyright 1996 EPIC Software Labs
 */

#ifndef __who_h__
#define __who_h__

void clean_server_queues (int);

/* WHO queue */

typedef struct WhoEntryT
{
	int  dirty;
	int  piggyback;
        int  who_mask;
	char *who_target;
        char *who_name;
        char *who_host;
        char *who_server;
        char *who_nick;
        char *who_real;
	char *who_stuff;
	char *who_end;
	char *who_buff;
	char *who_args;
        struct WhoEntryT *next;
	void (*line) (struct WhoEntryT *, char *, char **);
	void (*end) (struct WhoEntryT *, char *, char **);

} WhoEntry;

BUILT_IN_COMMAND(whocmd);
void BX_whobase (char *, void (*)(WhoEntry *, char *, char **), void (*)(WhoEntry *, char *, char **), char *, ...);
void whoreply (char *, char **);
void who_end (char *, char **);



/* ISON queue */

typedef struct IsonEntryT
{
	char *ison_asked;
	char *ison_got;
	struct IsonEntryT *next;
	void (*line) (char *, char *);
} IsonEntry;

BUILT_IN_COMMAND(isoncmd);
void BX_isonbase (char *args, void (*line) (char *, char *));
void ison_returned (char *, char **);



/* USERHOST queue */

typedef struct UserhostItemT
{
	char *	nick;
	int   	oper;
	int	connected;
	int   	away;
	char *	user;
	char *	host;
} UserhostItem;

typedef struct UserhostEntryT
{
	char *userhost_asked;
	char *text;
	struct UserhostEntryT *next;
	void (*func) (UserhostItem *, char *, char *);
} UserhostEntry;

BUILT_IN_COMMAND(userhostcmd);
BUILT_IN_COMMAND(useripcmd);
BUILT_IN_COMMAND(usripcmd);
void BX_userhostbase (char *arg, void (*line) (UserhostItem *, char *, char *), int, char *, ...);
void userhost_returned (char *, char **);
void userhost_cmd_returned (UserhostItem *, char *, char *);

#endif 

--- NEW FILE: ctcp.h ---
/*
 * ctcp.h: header file for ctcp.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: ctcp.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _CTCP_H_
#define _CTCP_H_

#include "irc.h"
#include "irc_std.h"

#define CTCP_PRIVMSG 	0
#define CTCP_NOTICE 	1

#define CTCP_SED	0
#define CTCP_UTC	1
#define CTCP_ACTION	2
#define CTCP_DCC	3
#define CTCP_CDCC	4
#define CTCP_CDCC1	5
#define CTCP_CDCC2	6

#define CTCP_VERSION	7
#define CTCP_CLIENTINFO	8
#define CTCP_USERINFO	9
#define CTCP_ERRMSG	10
#define CTCP_FINGER	11
#define CTCP_TIME	12
#define CTCP_PING	13
#define	CTCP_ECHO	14
#define CTCP_INVITE	15
#define CTCP_WHOAMI	16
#define CTCP_OP		17
#define CTCP_OPS	18
#define CTCP_IDENT	19
#define CTCP_UNBAN	20
#define CTCP_BOTLINK	21
#define CTCP_UPTIME	22
#define CTCP_CUSTOM	23

#define NUMBER_OF_CTCPS	CTCP_CUSTOM

#define CTCP_SPECIAL    0       /* Limited, quiet, noreply, not expanded */
#define CTCP_REPLY      1       /* Sends a reply (not significant) */
#define CTCP_INLINE     2       /* Expands to an inline value */
#define CTCP_NOLIMIT    4       /* Limit of one per privmsg. */
#define CTCP_TELLUSER   8       /* Tell the user about it. */

extern CtcpEntryDll *dll_ctcp;


extern		char	*ctcp_type[];
extern		int	sed;
extern		int	in_ctcp_flag;

#define CTCP_DELIM_CHAR '\001'
#define CTCP_DELIM_STR 	"\001"
#define CTCP_QUOTE_CHAR '\\'
#define CTCP_QUOTE_STR 	"\\"
#define CTCP_QUOTE_EM 	"\r\n\001\\"


extern	char *	ctcp_quote_it (char *, int);
extern	char *	ctcp_unquote_it (char *, int *);
extern	char *	do_ctcp (char *, char *, char *);
extern	char *	do_notice_ctcp (char *, char *, char *);
extern	int	in_ctcp (void);
extern	void	send_ctcp (int, char *, int, char *, ...);
extern	int	get_ctcp_val (char *);

void 	BX_split_CTCP (char *, char *, char *);

#endif /* _CTCP_H_ */

--- NEW FILE: status.h ---
/*
 * status.h: header for status.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: status.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __status_h_
#define __status_h_

	void	make_status (Window *);
	void	set_alarm (Window *, char *, int);
	char	*BX_update_clock (int);
	void	reset_clock (Window *, char *, int);
	void	BX_build_status (Window *, char *, int);
	int	BX_status_update (int);

#define GET_TIME 1
#define RESET_TIME 2

#endif /* __status_h_ */

--- NEW FILE: vars.h ---
/*
 * vars.h: header for vars.c
 *
 * Generated from vars.h.proto automatically by the Makefile
 *
 * @(#)$Id: vars.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __vars_h_
#define __vars_h_

/* indexes for the irc_variable array */

enum VAR_TYPES {
	AINV_VAR,
	ALTNICK_VAR,
	ALT_CHARSET_VAR,
	ALWAYS_SPLIT_BIGGEST_VAR ,
	ANNOY_KICK_VAR ,
	AOP_VAR ,
	APPEND_LOG_VAR,
	AUTOKICK_ON_VERSION_VAR,
	AUTO_AWAY_VAR,
	AUTO_AWAY_TIME_VAR,
	AUTO_JOIN_ON_INVITE_VAR,
	AUTO_LIMIT_VAR,
	AUTO_NSLOOKUP_VAR ,
	AUTO_RECONNECT_VAR,
	AUTO_REJOIN_VAR ,
	AUTO_RESPONSE_VAR,
	AUTO_RESPONSE_STR_VAR,
	AUTO_UNBAN_VAR,
	AUTO_UNMARK_AWAY_VAR ,
	AUTO_WHOWAS_VAR  ,
	BANTIME_VAR,
	BEEP_VAR ,
	BEEP_ALWAYS_VAR ,
	BEEP_MAX_VAR ,
	BEEP_ON_MSG_VAR ,
	BEEP_WHEN_AWAY_VAR ,
	BITCH_VAR,
	BITCHX_HELP_VAR,
	BLINK_VIDEO_VAR,
	BOLD_VIDEO_VAR ,
	BOT_LOG_VAR,
	BOT_LOGFILE_VAR,
	BOT_MODE_VAR ,
	BOT_PASSWD_VAR,
	BOT_RETURN_VAR,
	BOT_TCL_VAR,
	CDCC_VAR,
	CDCC_FLOOD_AFTER_VAR,
	CDCC_FLOOD_RATE_VAR,
	CDCC_PROMPT_VAR,
	CDCC_SECURITY_VAR,
	CD_DEVICE_VAR,
	CHANGE_NICK_ON_KILL_VAR,
	CHANMODE_VAR,
	CHANNEL_NAME_WIDTH_VAR ,
	CHECK_BEEP_USERS_VAR ,
	CLIENTINFO_VAR ,
	CLOAK_VAR ,
	CLOCK_VAR ,
	CLOCK_24HOUR_VAR ,
	CLOCK_FORMAT_VAR,
	CLONE_CHECK_VAR,
	CLONE_COUNT_VAR,
	CMDCHARS_VAR ,
	COLOR_VAR,
	COMMAND_MODE_VAR ,
	COMMENT_BREAKAGE_VAR,
	COMPRESS_MODES_VAR,
	CONNECT_DELAY_VAR,
	CONNECT_TIMEOUT_VAR,
	CONTINUED_LINE_VAR ,
	CPU_SAVER_AFTER_VAR,
	CPU_SAVER_EVERY_VAR,
	CTCP_DELAY_VAR,
	CTCP_FLOOD_AFTER_VAR,
	CTCP_FLOOD_BAN_VAR,
	CTCP_FLOOD_PROTECTION_VAR ,
	CTCP_FLOOD_RATE_VAR,
	CTCP_VERBOSE_VAR,
	CTOOLZ_DIR_VAR ,
	DCC_AUTOGET_VAR ,
	DCC_AUTORENAME_VAR,
	DCC_AUTORESUME_VAR,
	DCC_BAR_TYPE_VAR,
	DCC_BLOCK_SIZE_VAR,
	DCC_DLDIR_VAR , 
	DCC_FAST_VAR,
	DCC_FORCE_PORT_VAR,
	DCC_GET_LIMIT_VAR,
	DCC_MAX_AUTOGET_SIZE_VAR ,
	DCC_QUEUE_LIMIT_VAR,
	DCC_SEND_LIMIT_VAR,
	DCC_TIMEOUT_VAR,
	DCC_ULDIR_VAR,
	DCC_USE_GATEWAY_ADDR_VAR,
	DEBUG_VAR ,
#if defined(__EMXPM__) || defined(WIN32)
	DEFAULT_CODEPAGE_VAR,
#endif
	DEFAULT_FONT_VAR,
	DEFAULT_MENU_VAR,
	DEFAULT_NICK_VAR,
	DEFAULT_REASON_VAR ,
	DEOPFLOOD_VAR ,
	DEOPFLOOD_TIME_VAR,
	DEOP_ON_DEOPFLOOD_VAR,
	DEOP_ON_KICKFLOOD_VAR,
	DETACH_ON_HUP,
	DISPATCH_UNKNOWN_COMMANDS_VAR,
	DISPLAY_VAR ,
	DISPLAY_ANSI_VAR,
	DISPLAY_PC_CHARACTERS_VAR,
	DOUBLE_STATUS_LINE_VAR,
	EIGHT_BIT_CHARACTERS_VAR,
	EXEC_PROTECTION_VAR ,
	FAKE_SPLIT_PATS_VAR,
	FLOATING_POINT_MATH_VAR,
	FLOOD_AFTER_VAR ,
	FLOOD_KICK_VAR ,
	FLOOD_PROTECTION_VAR ,
	FLOOD_RATE_VAR ,
	FLOOD_USERS_VAR ,
	FLOOD_WARNING_VAR ,
	FTP_GRAB_VAR,
	FULL_STATUS_LINE_VAR ,
	HACKING_VAR ,
	HACK_OPS_VAR,
	HEBREW_TOGGLE_VAR,
	HELP_PAGER_VAR ,
	HELP_PATH_VAR ,
	HELP_PROMPT_VAR ,
	HELP_WINDOW_VAR ,
	HIDE_PRIVATE_CHANNELS_VAR ,
	HIGHLIGHT_CHAR_VAR ,
	HIGH_BIT_ESCAPE_VAR,
	HISTORY_VAR ,
	HOLD_MODE_VAR ,
	HOLD_MODE_MAX_VAR ,
	HTTP_GRAB_VAR,
	IDENT_HACK_VAR,
	IDLE_CHECK_VAR,
	IGNORE_TIME_VAR,
	INDENT_VAR ,
	INPUT_ALIASES_VAR ,
	INPUT_GLOB_VAR,
	INPUT_PROMPT_VAR ,
	INSERT_MODE_VAR ,
	INVERSE_VIDEO_VAR ,
	JOINFLOOD_VAR,
	JOINFLOOD_TIME_VAR,
	JOIN_NEW_WINDOW_VAR,
	JOIN_NEW_WINDOW_TYPE_VAR,
	KICKFLOOD_VAR ,
	KICKFLOOD_TIME_VAR ,
	KICK_IF_BANNED_VAR ,
	KICK_ON_DEOPFLOOD_VAR ,
	KICK_ON_JOINFLOOD_VAR,
	KICK_ON_KICKFLOOD_VAR ,
	KICK_ON_NICKFLOOD_VAR ,
	KICK_ON_PUBFLOOD_VAR ,
	KICK_OPS_VAR ,
	LAMEIDENT_VAR,
	LAMELIST_VAR,
	LASTLOG_VAR ,
	LASTLOG_ANSI_VAR ,
	LASTLOG_LEVEL_VAR ,
	LLOOK_VAR ,
	LLOOK_DELAY_VAR ,
	LOAD_PATH_VAR ,
	LOG_VAR ,
	LOGFILE_VAR ,
	MAIL_VAR ,
	MANGLE_INBOUND_VAR,
	MANGLE_LOGFILES_VAR,
	MANGLE_OPERLOG_VAR,
	MANGLE_OUTBOUND_VAR,
	MAX_DEOPS_VAR ,
	MAX_IDLEKICKS_VAR ,
	MAX_SERVER_RECONNECT_VAR,
	MAX_URLS_VAR,
	MDI_VAR,
	META_STATES_VAR,
	MIRCS_VAR,
	MODE_STRIPPER_VAR ,
	MSGCOUNT_VAR, 
	MSGLOG_VAR ,
	MSGLOGFILE_VAR ,
	MSGLOG_LEVEL_VAR,
	NAMES_COLUMNS_VAR,
	NAT_ADDRESS_VAR,
	ND_SPACE_MAX_VAR,
	NEW_SERVER_LASTLOG_LEVEL_VAR,
	NEXT_SERVER_ON_LOCAL_KILL_VAR,
	NICKFLOOD_VAR,
	NICKFLOOD_TIME_VAR,
	NICKLIST_VAR,
	NICKLIST_SORT_VAR,
	NICK_COMPLETION_VAR,
	NICK_COMPLETION_CHAR_VAR,
	NICK_COMPLETION_LEN_VAR,
	NICK_COMPLETION_TYPE_VAR,
	NOTIFY_VAR,
	NOTIFY_HANDLER_VAR,
	NOTIFY_INTERVAL_VAR,
	NOTIFY_LEVEL_VAR,
	NOTIFY_ON_TERMINATION_VAR,
	NO_CTCP_FLOOD_VAR,
	NO_FAIL_DISCONNECT_VAR,
	NUM_BANMODES_VAR,
	NUM_KICKS_VAR,
	NUM_KILLS_VAR,
	NUM_OF_WHOWAS_VAR,
	NUM_OPMODES_VAR,
	OPER_MODES_VAR,
	ORIGNICK_TIME_VAR,
	OV_VAR,
	PAD_CHAR_VAR,
	PING_TYPE_VAR,
	PROTECT_CHANNELS_VAR,
	PUBFLOOD_VAR,
	PUBFLOOD_TIME_VAR,
	QUERY_NEW_WINDOW_VAR,
	QUERY_NEW_WINDOW_TYPE_VAR,
	QUEUE_SENDS_VAR,
	RANDOM_LOCAL_PORTS_VAR,
	RANDOM_SOURCE_VAR,
	REALNAME_VAR,
	REVERSE_STATUS_VAR,
	SAVEFILE_VAR,
	SCREEN_OPTIONS_VAR,
	SCRIPT_HELP_VAR,
	SCROLLBACK_VAR,
	SCROLLBACK_RATIO_VAR,
	SCROLL_LINES_VAR,
	SEND_AWAY_MSG_VAR,
	SEND_CTCP_MSG_VAR,
	SEND_IGNORE_MSG_VAR,
	SEND_OP_MSG_VAR,
	SERVER_GROUPS_VAR,
	SERVER_PROMPT_VAR,
	SHELL_VAR,
	SHELL_FLAGS_VAR,
	SHELL_LIMIT_VAR,
	SHITLIST_VAR,
	SHITLIST_REASON_VAR,
	SHOW_AWAY_ONCE_VAR,
	SHOW_CHANNEL_NAMES_VAR,
	SHOW_END_OF_MSGS_VAR,
	SHOW_NUMERICS_VAR,
	SHOW_NUMERICS_STR_VAR,
	SHOW_STATUS_ALL_VAR,
	SHOW_WHO_HOPCOUNT_VAR,
	SOCKS_HOST_VAR,
	SOCKS_PORT_VAR,
	STATUS_AWAY_VAR,
	STATUS_CDCCCOUNT_VAR,
	STATUS_CHANNEL_VAR,
	STATUS_CHANOP_VAR,
	STATUS_CLOCK_VAR,
	STATUS_CPU_SAVER_VAR,
	STATUS_DCCCOUNT_VAR,
	STATUS_DOES_EXPANDOS_VAR,
	STATUS_FLAG_VAR,
	STATUS_FORMAT_VAR,
	STATUS_FORMAT1_VAR,
	STATUS_FORMAT2_VAR,
	STATUS_FORMAT3_VAR,
	STATUS_HALFOP_VAR,
	STATUS_HOLD_VAR,
	STATUS_HOLD_LINES_VAR,
	STATUS_INSERT_VAR,
	STATUS_LAG_VAR,
	STATUS_MAIL_VAR,
	STATUS_MODE_VAR,
	STATUS_MSGCOUNT_VAR,
	STATUS_NICK_VAR,
	STATUS_NOTIFY_VAR,
	STATUS_NO_REPEAT_VAR,
	STATUS_OPER_VAR,
	STATUS_OPER_KILLS_VAR,
	STATUS_OVERWRITE_VAR,
	STATUS_QUERY_VAR,
	STATUS_SCROLLBACK_VAR,
	STATUS_SERVER_VAR,
	STATUS_TOPIC_VAR,
	STATUS_UMODE_VAR,
	STATUS_USER0_VAR,
	STATUS_USER1_VAR,
	STATUS_USER10_VAR,
	STATUS_USER11_VAR,
	STATUS_USER12_VAR,
	STATUS_USER13_VAR,
	STATUS_USER14_VAR,
	STATUS_USER15_VAR,
	STATUS_USER16_VAR,
	STATUS_USER17_VAR,
	STATUS_USER18_VAR,
	STATUS_USER19_VAR,
	STATUS_USER2_VAR,
	STATUS_USER20_VAR,
	STATUS_USER21_VAR,
	STATUS_USER22_VAR,
	STATUS_USER23_VAR,
	STATUS_USER24_VAR,
	STATUS_USER25_VAR,
	STATUS_USER26_VAR,
	STATUS_USER27_VAR,
	STATUS_USER28_VAR,
	STATUS_USER29_VAR,
	STATUS_USER3_VAR,
	STATUS_USER30_VAR,
	STATUS_USER31_VAR,
	STATUS_USER32_VAR,
	STATUS_USER33_VAR,
	STATUS_USER34_VAR,
	STATUS_USER35_VAR,
	STATUS_USER36_VAR,
	STATUS_USER37_VAR,
	STATUS_USER38_VAR,
	STATUS_USER39_VAR,
	STATUS_USER4_VAR,
	STATUS_USER5_VAR,
	STATUS_USER6_VAR,
	STATUS_USER7_VAR,
	STATUS_USER8_VAR,
	STATUS_USER9_VAR,
	STATUS_USERS_VAR,
	STATUS_VOICE_VAR,
	STATUS_WINDOW_VAR,
	SUPPRESS_SERVER_MOTD_VAR,
	SWATCH_VAR,
	TAB_VAR,
	TAB_MAX_VAR,
	TIMESTAMP_VAR,
	TIMESTAMP_AWAYLOG_HOURLY_VAR,
	TIMESTAMP_STRING_VAR,
	TRANSLATION_VAR,
	UNDERLINE_VIDEO_VAR,
	USERLIST_VAR,
	USERMODE_VAR,
	USER_FLAG_OPS_VAR,
	USER_FLAG_PROT_VAR,
	USER_INFO_VAR,
#define USERINFO_VAR USER_INFO_VAR
	WINDOW_DESTROY_PART_VAR,
	WINDOW_QUIET_VAR,
	WORD_BREAK_VAR,
	XTERM_VAR,
	XTERM_OPTIONS_VAR,
	XTERM_TITLE_VAR,
	_CDCC_CLOSE_IDLE_SENDS_TIME_VAR,
	_CDCC_MINSPEED_TIME_VAR,
	_CDCC_PACKS_OFFERED_VAR,
NUMBER_OF_VARIABLES
};

	int	do_boolean (char *, int *);
	void	setcmd (char *, char *, char *, char *);
	int	BX_get_int_var (enum VAR_TYPES);
	int	get_dllint_var (char *);

	char	*BX_get_string_var (enum VAR_TYPES);
	char	*get_dllstring_var (char *);

	char	*wget_string_var (Window *, enum VAR_TYPES);
	void	wset_string_var (Window *, enum VAR_TYPES, char *);

	void	BX_set_int_var (enum VAR_TYPES, unsigned int);
	void	BX_set_string_var (enum VAR_TYPES, char *);

	void	set_dllint_var (char *, unsigned int);
	void	set_dllstring_var (char *, char *);

	void	init_variables (void);
	char	*make_string_var (const char *);
	void	set_highlight_char (Window *, char *, int);
	int	charset_size (void);
	void	save_variables (FILE *, int);
	void	set_var_value (int, char *, IrcVariableDll *);
	void    save_set (FILE *);

extern	char	*var_settings[];
extern	int	loading_global;
	void	savebitchx_variables (FILE *);
	void	reinit_autoresponse (Window *, char *, int);
	void	clear_sets (void);
	void	clear_bindings (void);
	int	window_set_var (Window *, char *);
	void	init_window_variables (Window *);

#include "cset.h"
	
/* var_settings indexes  also used in display.c for highlights */
#define OFF 0
#define ON 1
#define TOGGLE 2

/* the types of IrcVariables */
#define BOOL_TYPE_VAR	0
#define CHAR_TYPE_VAR	1
#define INT_TYPE_VAR	2
#define STR_TYPE_VAR	3
#define SET_TYPE_VAR	4

#define	VF_NODAEMON	0x0001
#define VF_EXPAND_PATH	0x0002

#define VIF_CHANGED	0x01
#define VIF_GLOBAL	0x02
#define VIF_BITCHX	0x04
#define VIF_PENDING	0x08

#define	DEBUG_COMMANDS		0x0001
#define	DEBUG_EXPANSIONS	0x0002
#define DEBUG_FUNCTIONS		0x0004
#define DEBUG_TCL		0x0008
#define DEBUG_CMDALIAS		0x0010
#define DEBUG_HOOK		0x0020
#define DEBUG_VARIABLE		0x0040
#define DEBUG_FUNC		0x0080

int	parse_mangle	(char *, int, char **);

#endif /* __vars_h_ */

--- NEW FILE: output.h ---
/*
 * output.h: header for output.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: output.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __output_h_
#define __output_h_

	void	put_echo (char *);
	void	BX_put_it (const char *, ...);

	void	BX_send_to_server (const char *, ...);
	void	BX_my_send_to_server (int, const char *, ...);
	void	BX_queue_send_to_server (int, const char *, ...);

	void	say (const char *, ...);
	void	BX_bitchsay (const char *, ...);
	void	serversay (int, int, const char *, ...);
	void	BX_yell (const char *, ...);
	void	error (const char *, ...);
	
	void	refresh_screen (unsigned char, char *);
	int	init_output (void);
	int	init_screen (void);
	void	put_file (char *);

	void	charset_ibmpc (void);
	void	charset_lat1 (void);
	void	charset_graf (void);
	void	charset_cst(void);
	char	*ov_server(int server);
	
extern	FILE	*irclog_fp;

#endif /* __output_h_ */

--- NEW FILE: bsdglob.h ---
/*
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Guido van Rossum.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	from: @(#)glob.h	8.1 (Berkeley) 6/2/93
 *	$Id: bsdglob.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _GLOB_H_
#define	_GLOB_H_

struct stat;
typedef struct {
	int gl_pathc;		/* Count of total paths so far. */
	int gl_matchc;		/* Count of paths matching pattern. */
	int gl_offs;		/* Reserved at beginning of gl_pathv. */
	int gl_flags;		/* Copy of flags parameter to glob. */
	char **gl_pathv;	/* List of paths matching pattern. */
				/* Copy of errfunc parameter to glob. */
	int (*gl_errfunc) (const char *, int);

	/*
	 * Alternate filesystem access methods for glob; replacement
	 * versions of closedir(3), readdir(3), opendir(3), stat(2)
	 * and lstat(2).
	 */
	void (*gl_closedir) (void *);
	struct dirent *(*gl_readdir) (void *);	
	void *(*gl_opendir) (const char *);
	int (*gl_lstat) (const char *, struct stat *);
	int (*gl_stat) (const char *, struct stat *);
} glob_t;

#define	GLOB_APPEND	0x0001	/* Append to output from previous call. */
#define	GLOB_DOOFFS	0x0002	/* Use gl_offs. */
#define	GLOB_ERR	0x0004	/* Return on error. */
#define	GLOB_MARK	0x0008	/* Append / to matching directories. */
#define	GLOB_NOCHECK	0x0010	/* Return pattern itself if nothing matches. */
#define	GLOB_NOSORT	0x0020	/* Don't sort. */

#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
#define	GLOB_BRACE	0x0080	/* Expand braces ala csh. */
#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
#define	GLOB_NOMAGIC	0x0200	/* GLOB_NOCHECK without magic chars (csh). */
#define	GLOB_QUOTE	0x0400	/* Quote special chars with \. */
#define	GLOB_TILDE	0x0800	/* Expand tilde names from the passwd file. */
#define GLOB_INSENSITIVE 0x1000 /* Don't worry about upper versus lower case */

#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
#define	GLOB_ABEND	(-2)	/* Unignored error. */

int	BX_bsd_glob (const char *, int, int (*)(const char *, int), glob_t *);
void	BX_bsd_globfree (glob_t *);

#endif /* !_GLOB_H_ */

--- NEW FILE: newio.h ---
/*
 * newio.h -- header file for newio.c
 *
 * Copyright 1990, 1995 Michael Sandrof, Matthew Green
 * Copyright 1997 EPIC Software Labs
 */

#ifndef __newio_h__
#define __newio_h__

#include "ssl.h"

extern 	int 	dgets_errno;

	int 	BX_dgets 			(char *, int, int, int, void *);
	int 	new_select 		(fd_set *, fd_set *, struct timeval *);
	int	BX_new_open		(int);
	int 	BX_new_close 		(int);
	int	new_close_write		(int);
	int	new_open_write		(int);
	void 	set_socket_options 	(int);
	size_t	get_pending_bytes	(int);

#define IO_BUFFER_SIZE 8192

#endif

--- NEW FILE: stack.h ---
/*
 * stack.h - header for stack.c
 *
 * written by matthew green
 *
 * copyright (c) 1993, 1994.
 *
 * @(#)$Id: stack.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __stack_h_
# define __stack_h_

#include "hook.h"
#include "alias.h"

	void	stackcmd  (char *, char *, char *, char *);

#define STACK_POP 0
#define STACK_PUSH 1
#define STACK_SWAP 2
#define STACK_LIST 3

#define STACK_DO_ALIAS	0x0001
#define STACK_DO_ASSIGN	0x0002

typedef	struct	AliasStru1
{
	char	*name;			/* name of alias */
	char	*stuff;			/* what the alias is */
	char	*stub;			/* the file its stubbed to */
	int	mark;			/* used to prevent recursive aliasing */
	int	global;			/* set if loaded from `global' */
	void	*what;		/* pointer to structure */
	int	struct_type;		/* type of structure */
	struct	AliasStru1 *next;	/* pointer to next alias in list */
}	Alias1;

typedef	struct	aliasstacklist1
{
	int	which;
	char	*name;
	IrcVariable *set;
	enum	VAR_TYPES var_index;
	Alias1	*list;
	struct aliasstacklist1 *next;
}	AliasStack1;

#endif /* __stack_h_ */

--- NEW FILE: dlfcn.h ---
/* 
 * dlfcn.h --
 *
 *	This file provides a replacement for the header file "dlfcn.h"
 *	on systems where dlfcn.h is missing.  It's primary use is for
 *	AIX, where Tcl emulates the dl library.
 *
 *	This file is subject to the following copyright notice, which is
 *	different from the notice used elsewhere in Tcl but rougly
 *	equivalent in meaning.
 *
 *	Copyright (c) 1992,1993,1995,1996, Jens-Uwe Mager, Helios Software GmbH
 *	Not derived from licensed software.
 *
 *	Permission is granted to freely use, copy, modify, and redistribute
 *	this software, provided that the author is not construed to be liable
 *	for any results of using the software, alterations are clearly marked
 *	as such, and this notice is not modified.
 *
 * SCCS: @(#) dlfcn.h 1.4 96/09/17 09:05:59
 */

/*
 * @(#)dlfcn.h	1.4 revision of 95/04/25  09:36:52
 * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
 * 30159 Hannover, Germany
 */

#ifndef __dlfcn_h__
#define __dlfcn_h__

/*
 * Mode flags for the dlopen routine.
 */
#define RTLD_LAZY	1	/* lazy function call binding */
#define RTLD_NOW	2	/* immediate function call binding */
#define RTLD_GLOBAL	0x100	/* allow symbols to be global */

/*
 * To be able to intialize, a library may provide a dl_info structure
 * that contains functions to be called to initialize and terminate.
 */
struct dl_info {
	void (*init) (void);
	void (*fini) (void);
};

void *dlopen (const char *path, int mode);
void *dlsym (void *handle, const char *symbol);
char *dlerror (void);
int dlclose (void *handle);

#endif /* __dlfcn_h__ */

--- NEW FILE: chelp.h ---
/*
 * Written and CopyRight by Colten Edwards 03-09-96
 * 
 *
 */

#ifndef __chelp_h
#define __chelp_h

extern void chelp (char *, char *, char *, char *);

#endif

--- NEW FILE: input.h ---
/*
 * input.h: header for input.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: input.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __input_h_
#define __input_h_
	char	input_pause (char *);
	void	BX_set_input (char *);
	void	BX_set_input_prompt (Window *, char *, int);
	char	*BX_get_input_prompt (void);
	char	*BX_get_input (void);
	void	BX_update_input (int);
	void	init_input (void);
	void	input_move_cursor (int);
	void	change_input_prompt (int);
	void	BX_cursor_to_input (void);

/* keybinding functions */
	void 	backward_character 	(char, char *);
	void 	backward_history 	(char, char *);
	void 	clear_screen 		(char, char *);
	void	command_completion 	(char, char *);
	void 	forward_character	(char, char *);
	void 	forward_history 	(char, char *);
	void	highlight_off 		(char, char *);
	void	input_add_character 	(char, char *);
	void	input_backspace 	(char, char *);
	void	input_backward_word 	(char, char *);
	void	input_beginning_of_line (char, char *);
	void	new_input_beginning_of_line (char, char *);
	void	input_clear_line 	(char, char *);
	void	input_clear_to_bol 	(char, char *);
	void	input_clear_to_eol 	(char, char *);
	void	input_delete_character 	(char, char *);
	void	input_delete_next_word 	   (char, char *);
	void	input_delete_previous_word (char, char *);
 	void	input_delete_to_previous_space (char, char *);
	void	input_end_of_line 	   (char, char *);
	void	input_forward_word 	   (char, char *);
	void	input_transpose_characters (char, char *);
	void	input_yank_cut_buffer 	   (char, char *);
	void	insert_bold 		(char, char *);
	void	insert_reverse 		(char, char *);
	void	insert_underline 	(char, char *);
	void	insert_blink		(char, char *);
	void	insert_altcharset	(char, char *);
	void 	meta1_char 		(char, char *);
	void 	meta2_char 		(char, char *);
	void 	meta3_char 		(char, char *);
	void 	meta4_char 		(char, char *);
	void 	meta5_char 		(char, char *);
	void 	meta6_char 		(char, char *);
	void 	meta7_char 		(char, char *);
	void 	meta8_char 		(char, char *);
	void 	meta9_char 		(char, char *);
	void 	meta10_char 		(char, char *);
	void 	meta11_char 		(char, char *);
	void 	meta12_char 		(char, char *);
	void 	meta13_char 		(char, char *);
	void 	meta14_char 		(char, char *);
	void 	meta15_char 		(char, char *);
	void 	meta16_char 		(char, char *);
	void 	meta17_char 		(char, char *);
	void 	meta18_char 		(char, char *);
	void 	meta19_char 		(char, char *);
	void 	meta20_char 		(char, char *);
	void 	meta21_char 		(char, char *);
	void 	meta22_char 		(char, char *);
	void 	meta23_char 		(char, char *);
	void 	meta24_char 		(char, char *);
	void 	meta25_char 		(char, char *);
	void 	meta26_char 		(char, char *);
	void 	meta27_char 		(char, char *);
	void 	meta28_char 		(char, char *);
	void 	meta29_char 		(char, char *);
	void 	meta30_char 		(char, char *);
	void 	meta31_char 		(char, char *);
	void 	meta32_char 		(char, char *);
	void 	meta33_char 		(char, char *);
	void 	meta34_char 		(char, char *);
	void 	meta35_char 		(char, char *);
	void 	meta36_char 		(char, char *);
	void 	meta37_char 		(char, char *);
	void 	meta38_char 		(char, char *);
	void 	meta39_char 		(char, char *);
	
	void	refresh_inputline 	(char, char *);
	void 	send_line 		(char, char *);
	void 	toggle_insert_mode 	(char, char *);
	void	input_msgreply		(char, char *);
	void	input_autoreply		(char, char *);

	void	input_msgreplyback	(char, char *);
	void	input_autoreplyback	(char, char *);

	void	my_scrollback		(char, char *);
	void	my_scrollforward	(char, char *);
	void	my_scrollend		(char, char *);

	void	wholeft			(char, char *);
	void	toggle_cloak		(char, char *);
	void	cdcc_plist		(char, char *);
	void	dcc_plist		(char, char *);
	void	channel_chops		(char, char *);
	void	channel_nonops		(char, char *);
	void	change_to_split		(char, char *);
	void	do_chelp		(char, char *);
	void	join_last_invite	(char, char *);
	void	dcc_ostats		(char, char *);
	void	window_swap1		(char, char *);
	void	window_swap2		(char, char *);
	void	window_swap3		(char, char *);
	void	window_swap4		(char, char *);
	void	window_swap5		(char, char *);
	void	window_swap6		(char, char *);
	void	window_swap7		(char, char *);
	void	window_swap8		(char, char *);
	void	window_swap9		(char, char *);
	void	window_swap10		(char, char *);
	void	w_help			(char, char *);
	void	cpu_saver_on		(char, char *);
	void	window_key_balance	(char, char *);
	void	window_grow_one		(char, char *);
	void	window_key_hide		(char, char *);
	void	window_key_kill		(char, char *);
	void	window_key_list		(char, char *);
	void	window_key_move		(char, char *);
	void	window_shrink_one	(char, char *);
	void	nick_completion		(char, char *);
	void	ignore_last_nick	(char, char *);
	void	input_unclear_screen	(char, char *);
	void	tab_completion		(char, char *);
		
	Lastlog *get_input_hold		(Window *);
	Display *get_screen_hold	(Window *);
	NickTab *BX_getnextnick		(int, char *, char *, char *);
	char	*BX_getchannick		(char *, char *);
	NickList *BX_lookup_nickcompletion	(ChannelList *, char *);
	void	paste_to_input		(char, char *);

enum completion {
	NO_COMPLETION,
	TABKEY_COMPLETION,
	NICK_COMPLETION,
	COM_COMPLETION,
	CHAN_COMPLETION,
	EXEC_COMPLETION,
	FILE_COMPLETION,
	DCC_COMPLETION,
	LOAD_COMPLETION,
	SERVER_COMPLETION,
	CDCC_COMPLETION
};

	char	*get_completions	(enum completion, char *, int *, char **);
	int	BX_add_completion_type	(char *, int, enum completion);

extern	NickTab *tabkey_array;
extern	NickTab *autoreply_array;


/* used by update_input */
#define NO_UPDATE 0
#define UPDATE_ALL 1
#define UPDATE_FROM_CURSOR 2
#define UPDATE_JUST_CURSOR 3

#ifdef GUI
	void	wm_process(int param);
#endif

#endif /* __input_h_ */

--- NEW FILE: timer.h ---
/*
 * timer.h: header for timer.c 
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 */

#ifndef _TIMER_H_
#define _TIMER_H_

/* functions that may be called by others */
extern	void	timercmd (char *, char *, char *, char *);
extern	void	ExecuteTimers (void);
extern	char	*BX_add_timer (int, char *, double, long, int (*) (void *, char *), char *, char *, int, char *);
extern	int	BX_delete_timer (char *);
extern	int	get_delete_timer(char *);
extern	int	kill_timer(char *);
extern	void	BX_delete_all_timers (void);
extern	int	timer_exists (char *ref);


extern	time_t	TimerTimeout (void);
char		*tcl_add_timer (TimerList **, long, char *, unsigned long);
int 		tcl_remove_timer (TimerList **, unsigned long);
int		timer_callback_exists(void *);

time_t		tclTimerTimeout(time_t);

#define MAGIC_TIMEOUT 100000000

#endif /* _TIMER_H_ */

--- NEW FILE: hash.h ---
/*
 * hash.h: header file for hash.c
 *
 * Written by Scott H Kilau
 *
 * CopyRight(c) 1997
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
 *
 * @(#)$Id: hash.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _HASH_H_
#define _HASH_H_

#define NICKLIST_HASHSIZE 79
#define WHOWASLIST_HASHSIZE 271

#ifndef REMOVE_FROM_LIST
# define REMOVE_FROM_LIST 1
#endif


#include "struct.h"

/* hashentry: structure for all hash lists we make. 
 * quite generic, but powerful.
 */
typedef	struct	hashentry
{
	void *list;		/* our linked list, generic void * */
	unsigned short hits;	/* how many hits this spot has gotten */
	unsigned short links;	/* how many links we have at this spot */
}	HashEntry;

#endif

--- NEW FILE: mail.h ---
/*
 * mail.h: header for mail.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: mail.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __mail_h_
#define __mail_h_

	char	*check_mail (void);
	int	check_mail_status (void);

#endif /* __mail_h_ */

--- NEW FILE: numbers.h ---
/*
 * numbers.h: header for numbers.c
 *
 * written by michael sandrof
 *
 * copyright(c) 1990 
 *
 * see the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: numbers.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __numbers_h_
#define __numbers_h_

	char	*numeric_banner (void);
	void	display_msg (char *, char **);
	void	numbered_command (char *, int, char **);
	void	got_initial_version_28 (char **);
	int	check_sync (int, char *, char *, char *, char *, ChannelList *);

		
#endif /* __numbers_h_ */

--- NEW FILE: hash2.h ---
/*
 * hash2.h: function header file for hash.c
 *
 * Written by Scott H Kilau
 *
 * CopyRight(c) 1997
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
 *
 * @(#)$Id: hash2.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _HASH2_H_
#define _HASH2_H_

#include "struct.h"
#include "whowas.h"
#include "hash.h"

/* Generic List type hash list */
void	BX_add_name_to_genericlist (char *, HashEntry *, unsigned int);
List	*BX_find_name_in_genericlist (char *, HashEntry *, unsigned int, int);
List	*BX_next_namelist(HashEntry *, List *, unsigned int);

void	BX_add_nicklist_to_channellist(NickList *, ChannelList *);

void	BX_add_whowas_userhost_channel (WhowasList *, WhowasWrapList *);

WhowasList *BX_find_userhost_channel (char *, char *, int, WhowasWrapList *);

int	BX_remove_oldest_whowas_hashlist (WhowasWrapList *, time_t, int);

WhowasList *BX_next_userhost(WhowasWrapList *, WhowasList *);

NickList *BX_find_nicklist_in_channellist(char *, ChannelList *, int);
NickList *BX_next_nicklist(ChannelList *, NickList *);

void	clear_nicklist_hashtable(ChannelList *);
void	show_nicklist_hashtable(ChannelList *);

void show_whowas_hashtable(WhowasWrapList *cptr, char *);
int show_wholeft_hashtable(WhowasWrapList *cptr, time_t ltime, int *total, int *hook, char *);

/* Added to sort a hash'd nicklist and them remove the sorted list */
NickList *BX_sorted_nicklist(ChannelList *, int);
void BX_clear_sorted_nicklist(NickList **);


#define NICKSORT_NORMAL 0
#define NICKSORT_NONE 1
#define NICKSORT_NICK 2
#define NICKSORT_HOST 3
#define NICKSORT_TIME 4
#define NICKSORT_IP 5
#define NICKSORT_OP 6
#define NICKSORT_VOICE 7

Flooding *BX_find_name_in_floodlist(char *, char *, HashEntry *, unsigned int, int);
Flooding *BX_add_name_to_floodlist(char *, char *, char *, HashEntry *, unsigned int);

unsigned long hash_nickname(char *, unsigned int);


#endif

--- NEW FILE: list.h ---
/*
 * list.h: header for list.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: list.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __list_h_
#define __list_h_

	void	BX_add_to_list (List **, List *);
	List	*BX_find_in_list (List **, char *, int);
	List	*BX_remove_from_list (List **, char *);
	List	*BX_removewild_from_list (List **, char *);
	List	*BX_list_lookup_ext (List **, char *, int, int, int (*)(List *, char *));
	List	*BX_list_lookup (List **, char *, int, int);
	List	*BX_remove_from_list_ext (List **, char *, int (*)(List *, char *));
	void	BX_add_to_list_ext (List **, List *, int (*)(List *, List *));
	List	*BX_find_in_list_ext (List **, char *, int, int (*)(List *, char *));
	int	list_strnicmp (List *item1, char *str);

#define REMOVE_FROM_LIST 1
#define USE_WILDCARDS 1

#endif /* __list_h_ */

--- NEW FILE: userlist.h ---
/*
 * Userlist functions and definitions.
 * Copyright Colten Edwards 1996
 * 
 */
 
#ifndef _user_list_h
#define _user_list_h

void add_shit (char *, char *, char *, char *);
void add_user (char *, char *, char *, char *);
void showuserlist (char *, char *, char *, char *);
void change_user (char *, char *, char *, char *);
void savelists (char *, char *, char *, char *);

void add_to_a_list (char *, int, char *, char *, char *, int);
void showlist (NickList *, char *);
UserList *lookup_userlevelc (char *, char *, char *, char *);

UserList *nickinuser (char *, char *);
ShitList *nickinshit (char *, char *);

int	find_user_level (char *, char *, char *);
int	find_shit_level (char *, char *, char *);

NickList *check_auto (char *, NickList *, ChannelList *);
int check_prot (char *, char *, ChannelList *, BanList *, NickList *);
void check_shit (ChannelList *);
void check_hack (char *, ChannelList *, NickList *, char *);
int check_channel_match (char *, char *);
int delay_check_auto (char *);


extern ShitList *shitlist_list;
extern LameList *lame_list;
extern WordKickList *ban_words;

#define USERLIST_REMOVE 0
#define USERLIST_ADD 1
#define SHITLIST_ADD 11
#define SHITLIST_REMOVE 12

#define ADD_VOICE	0x00000001
#define ADD_OPS		0x00000002
#define ADD_BAN		0x00000004
#define ADD_UNBAN	0x00000008
#define ADD_INVITE	0x00000010
#define ADD_DCC		0x00000020
#define ADD_TCL		0x00000040
#define ADD_IOPS	0x00000080
#define ADD_FLOOD	0x00000100
#define ADD_BOT		0x00000200

#define PROT_REOP	0x00000400
#define PROT_DEOP	0x00000800
#define PROT_KICK	0x00001000
#define PROT_BAN	0x00002000
#define PROT_INVITE	0x00004000
#define USER_FLAG_OPS	0x00008000
#define USER_FLAG_PROT	0x00010000
#define ADD_CTCP	0x00100000

#define ADD_FRIEND	(ADD_VOICE|ADD_OPS|ADD_UNBAN|ADD_INVITE)
#define ADD_MASTER	(ADD_VOICE|ADD_OPS|ADD_BAN|ADD_UNBAN|ADD_INVITE|ADD_DCC|ADD_FLOOD)
#define ADD_OWNER	(ADD_MASTER|ADD_BOT|ADD_CTCP)
#define PROT_ALL	(PROT_REOP|PROT_DEOP|PROT_KICK|PROT_BAN|PROT_INVITE)

#define SHIT_NOOP	0x0001
#define SHIT_KICK	0x0002
#define SHIT_KICKBAN	0x0004
#define SHIT_PERMBAN	0x0008
#define SHIT_IGNORE	0x0010

/* user.c functions for dealing with hashed userlist */
UserList *find_bestmatch(char *, char *, char *, char *);
char * convert_flags(unsigned long flags);
UserList *find_userlist(char *, char *, int);
void add_userlist(UserList *);
UserList *next_userlist(UserList *, int *, void **);
void destroy_sorted_userlist(UserList **);
UserList *create_sorted_userlist(void);
char *convert_flags_to_str(unsigned long);
unsigned long convert_str_to_flags(char *);
int change_pass(char *, char *);

#endif


--- NEW FILE: modval.h ---
#ifndef _MODVAL_

/* include this so we have the enum table just in case someone forgets. */

#include "module.h"

/* 
 * this is a method first used in eggdrop modules.. 
 * A global table of functions is passed into the init function of module,
 * which is then assigned to the value global. This table is then indexed,
 * to access the various functions. What this means to us, is that we no 
 * longer require -rdynamic on the LDFLAGS line, which reduces the size 
 * of the client. This also makes this less compiler/environment dependant,
 * allowing modules to work on more platforms.
 * A Function_ptr *global is required in the module. The second arg to 
 * the init function is used to initialize this table. The table itself is
 * initialized in modules.c. This file should only be included once in the
 * module and also should be the last file included. It should never be 
 * included in the source itself. 
 * As long as we add new functions to the END of the list in module.h then
 * currently compiled modules will continue to function fine. If we change
 * the order of the list however, then BAD things will occur.
 * Copyright Colten Edwards July 1998.
 */

#define _MODVAL_
#ifndef BUILT_IN_DLL
#define BUILT_IN_DLL(x) \
	void x (IrcCommandDll *intp, char *command, char *args, char *subargs, char *helparg)
#endif

#if defined(WTERM_C) || defined(STERM_C)
/* If we are building wserv or scr-bx we can't use
 * the global table so we forward to the actual
 * functions instead of throught the global table.
 */
#define set_non_blocking(x) BX_set_non_blocking(x)
#define set_blocking(x) BX_set_blocking(x)
#define ip_to_host(x) BX_ip_to_host(x)
#define host_to_ip(x) BX_host_to_ip(x)
#define connect_by_number(a, b, c, d, e) BX_connect_by_number(a, b, c, d, e)
#ifndef __vars_h_
enum VAR_TYPES { unused };
#endif
int  get_int_var (enum VAR_TYPES);
void ircpanic (char *, ...);
char *my_ltoa (long);
#else

/*
 * need to undefine these particular defines. Otherwise we can't include
 * them in the table.
 */
#undef new_malloc
#undef new_free
#undef RESIZE
#undef malloc_strcat
#undef malloc_strcpy
#undef m_strdup
#undef m_strcat_ues
#undef m_strndup

#undef MODULENAME

#ifdef MAIN_SOURCE
void init_global_functions(void);
#ifndef __modules_c
extern char *_modname_;
extern Function_ptr *global;
#endif
#else

#ifdef INIT_MODULE
/* only in the first c file do we #define INIT_MODULE */
char *_modname_ = NULL;
Function_ptr *global = NULL;
#undef INIT_MODULE
#else
extern char *_modname_;
extern Function_ptr *global;
#endif

#endif /* MAIN_SOURCE */

#define MODULENAME _modname_

#define check_module_version(x) ((int) (global[MODULE_VERSION_CHECK]((unsigned long)x)))
#define set_dll_name(x) malloc_strcpy(&_modname_, x)
#define set_global_func(x) global = x;
#define initialize_module(x) { \
		global = global_table; \
		malloc_strcpy(&_modname_, x); \
		if (!check_module_version(MODULE_VERSION)) \
			return INVALID_MODVERSION; \
}

	
#ifndef MAIN_SOURCE
#define empty_string ""
#define space " "
#endif

#ifndef HAVE_VSNPRINTF
#define vsnprintf ((char * (*)())global[VSNPRINTF])
#endif
#ifndef HAVE_SNPRINTF
#define snprintf ((char * (*)())global[SNPRINTF])
#endif

/* ircaux.c */
#define new_malloc(x) ((void *)(global[NEW_MALLOC]((x),MODULENAME, __FILE__,__LINE__)))
#define new_free(x) ((void *)(global[NEW_FREE]((x),MODULENAME, __FILE__,__LINE__)))
#define RESIZE(x, y, z) ((void *)(global[NEW_REALLOC]((void **)& (x), sizeof(y) * (z), MODULENAME, __FILE__, __LINE__)))
#define malloc_strcpy(x, y) ((char *)(global[MALLOC_STRCPY]((char **)x, (char *)y, MODULENAME, __FILE__, __LINE__)))
#define malloc_strcat(x, y) ((char *)(global[MALLOC_STRCAT]((char **)x, (char *)y, MODULENAME, __FILE__, __LINE__)))
#define malloc_str2cpy(x, y, z) ((char *)(global[MALLOC_STR2CPY]((char **)x, (char *)y, (char *)z)))
#define m_3dup(x, y, z) ((char *) (global[M_3DUP]((char *)x, (char *)y, (char *)z)))
#define m_opendup ((char * (*)())global[M_OPENDUP])
#define m_s3cat(x, y, z) ((char *)(global[M_S3CAT]((char **)x, (char *)y, (char *)z)))
#define m_s3cat_s(x, y, z) ((char *)(global[M_S3CAT_S]((char **)x, (char *)y, (char *)z)))
#define m_3cat(x, y, z) ((char *) (global[M_3CAT]((char **)x, (char *)y, (char *)z)))
#define m_2dup(x, y) ((char *)(global[M_2DUP]((char *)x, (char *)y)))
#define m_e3cat(x, y, z) ((char *)(global[M_E3CAT]((char **)x, (char *)y, (char *)z)))

#define my_stricmp(x, y) ((int)(global[MY_STRICMP]((const unsigned char *)x, (const unsigned char *)y)))
#define my_strnicmp(x, y, n) ((int)(global[MY_STRNICMP]((const unsigned char *)x, (const unsigned char *)y, (int)n)))

#define my_strnstr(x, y, z) ((int) (global[MY_STRNSTR]((const unsigned char *)x, (const unsigned char *)y, (size_t)z)))
#define chop(x, n) ((char *) (global[CHOP]((char *)x, (int)n)))
#define strmcpy(x, y, n) ((char *) (global[STRMCPY]((char *)x, (const char *)y, (int)n)))
#define strmcat(x, y, n) ((char *) (global[STRMCAT]((char *)x, (const char *)y, (int)n)))
#define scanstr(x, y) ((int) (global[SCANSTR]((char *)x, (char *)y)))
#define m_dupchar(c) ((char *) (global[M_DUPCHAR]((int)c)))
#define streq(x, y) ((size_t) (global[STREQ]((const char *)x, (const char *)y)))
#define strieq(x, y) ((size_t) (global[STRIEQ]((const char *)x, (const char *)y)))
#define strmopencat ((char * (*)())global[STRMOPENCAT])
#define ov_strcpy(x, y) ((char *) (global[OV_STRCPY]((char *)x, (const char *)y)))
#define upper(x) ((char *) (global[UPPER]((char *)x)))
#define lower(x) ((char *) (global[LOWER]((char *)x)))
#define stristr(x, y) ((char *) (global[STRISTR]((const char *)x, (char *)y)))
#define rstristr(x, y) ((char *) (global[RSTRISTR]((char *)x, (char *)y)))
#define word_count(x) ((int) (global[WORD_COUNT]((char *)x)))
#define remove_trailing_spaces(x) ((char *) (global[REMOVE_TRAILING_SPACES]((char *)x)))
#define expand_twiddle(x) ((char *) (global[EXPAND_TWIDDLE]((char *)x)))
#define check_nickname(x) ((char *) (global[CHECK_NICKNAME]((char *)x)))
#define sindex(x, y) ((char *) (global[SINDEX](( char *)x, (char *)y)))
#define rsindex(x, y, z, a) ((char *) (global[RSINDEX](( char *)x, (char *)y, (char *)z, (int)a)))
#define is_number(x) ((int) (global[ISNUMBER]((char *)x)))
#define rfgets(x, n, y) ((char *) (global[RFGETS]((char *)x, (int)n, (FILE *)y)))
#define path_search(x, y) ((char *) (global[PATH_SEARCH]((char *)x, (char *)y)))
#define double_quote(x, y, z) ((char *) (global[DOUBLE_QUOTE]((const char *)x, (const char *)y, (char *)z)))
#define ircpanic (global[IRCPANIC])
#define end_strcmp(x, y, n) ((int) (global[END_STRCMP]((const char *)x, (const char *)y, (int)n)))
#define beep_em(x) ((void) (global[BEEP_EM]((int)x)))
#define uzfopen(x, y, n) ((FILE *) (global[UZFOPEN]((char **)x, (char *)y, (int)n)))
#define get_time(x) ((global[FUNC_GET_TIME]((struct timeval *)x)))
#define time_diff(x, y) ((double) (global[TIME_DIFF]((struct timeval)x, (struct timeval)y)))
#define time_to_next_minute (int (*)(void)global[TIME_TO_NEXT_MINUTE])
#define plural(x) ((char *) (global[PLURAL]((int)x)))
#define my_ctime(x) ((char *) (global[MY_CTIME]((time_t)x)))
#define ccspan(x, y) ((size_t) (global[CCSPAN]((char *)x, (int)y)))

/* If we are in a module, undefine the previous define from ltoa to my_ltoa */
#ifdef ltoa
#undef ltoa
#endif
#define ltoa(x) ((char *) (global[LTOA]((long)x)))
#define strformat(x, y, n, z) ((char *) (global[STRFORMAT]((char *)x, (char *)y, (int)n, (char)z)))
#define MatchingBracket(x, y, z) ((char *) (global[MATCHINGBRACKET]((char *)x, ( char)y, (char)z)))
#define parse_number(x) ((int) (global[PARSE_NUMBER]((char **)x)))
#define splitw(x, y) ((int) (global[SPLITW]((char *)x, (char ***)y)))
#define unsplitw(x, y) ((char *) (global[UNSPLITW]((char ***)x, (char *)y)))
#define check_val(x) ((int) (global[CHECK_VAL]((char *)x)))
#define on_off(x) ((char *) (global[ON_OFF]((int)x)))
#define strextend(x, y, n) ((char *) (global[STREXTEND]((char *)x, (char)y, (int)n)))
#define strfill(x, n) ((const char *) (global[STRFILL]((char)x, (int)n)))
#define empty(x) ((int) (global[EMPTY_FUNC]((const char *)x)))
#define remove_brackets(x, y, n) ((char *) (global[REMOVE_BRACKETS]((char *)x, (char *)y, (int *)n)))
#define my_atol(x) ((long) (global[MY_ATOL]((char *)x)))
#define strip_control(x, y) ((void) (global[STRIP_CONTROL]((const char *)x, (char *)y)))
#define figure_out_address(a, b, c, d, e, f) ((int) (global[FIGURE_OUT_ADDRESS]((char *)a, (char **)b, (char **)c, (char **)d, (char **)e, (int *)f)))
#define strnrchr(x, y, n) ((char *) (global[STRNRCHR]((char *)x, (char)y, (int)n)))
#define mask_digits(x) ((void) (global[MASK_DIGITS]((char **)x)))
#define ccscpan(x, n) ((size_t) (global[CCSPAN]((const char *)x, (int)n)))
#define charcount(x, y) ((int) (global[CHARCOUNT]((const char *)x, (char)y)))
#define strpcat ((char *) (global[STRPCAT]))
#define strcpy_nocolorcodes(x, y) ((u_char *) (global[STRCPY_NOCOLORCODES]((u_char *)x, (const u_char *)y)))
#define cryptit(x) ((char *) (global[CRYPTIT]((const char *)x)))
#define stripdev(x) ((char *) (global[STRIPDEV]((char *)x)))
#define mangle_line(x, y, z) ((size_t) (global[MANGLE_LINE]((char *)x, (int)y, (size_t)z)))
#define m_strdup(x) ((char *)(global[M_STRDUP]((char *)x, MODULENAME, __FILE__, __LINE__)))
#define m_strcat_ues(x, y, z) ((char *)(global[M_STRCAT_UES](x, y, z, MODULENAME, __FILE__, __LINE__)))
#define m_strndup(x, y) ((char *)(global[M_STRNDUP](x, y, MODULENAME, __FILE__, __LINE__)))
#define malloc_sprintf ((char * (*)())global[MALLOC_SPRINTF])
#define m_sprintf ((char * (*)())global[M_SPRINTF])
#define next_arg(x, y) ((char *)(global[NEXT_ARG]((char *)x, (char **)y)))
#define new_next_arg(x, y) ((char *)(global[NEW_NEXT_ARG]((char *)x, (char **)y)))
#define new_new_next_arg(x, y, z) ((char *)(global[NEW_NEW_NEXT_ARG]((char *)x, (char **)y, (char *)z)))
#define last_arg(x) ((char *)(global[LAST_ARG]((char **)x)))
#define next_in_comma_list(x, y) ((char *)(global[NEXT_IN_COMMA_LIST]((char *)x, (char **)y)))
#define random_number(x) ((unsigned long)(global[RANDOM_NUMBER]((unsigned long)x)))


/* words.c reg.c */
#define search(x, y, z, n) ((char *) (global[SEARCH]((char *)x, (char **)y, (char *)z, (int)n)))
#define move_to_abs_word(x, y, n) ((char *) (global[MOVE_TO_ABS_WORD]((char *)x, (char **)y, (int)n)))
#define move_word_rel(x, y, n) ((char *) (global[MOVE_WORD_REL]((char *)x, (char **)y, (int)n)))
#define extract(x, y, n) ((char *) (global[EXTRACT]((char *)x, (int)y, (int)n)))
#define extract2(x, y, n) ((char *) (global[EXTRACT2]((char *)x, (int)y, (int)n)))
#define wild_match(x, y) ((int) (global[WILD_MATCH]((const unsigned char *)x, (const unsigned char *)y)))

/* network.c */
#define connect_by_number(a, b, c, d, e) ((int) (global[CONNECT_BY_NUMBER]((char *)a, (unsigned short *)b, (int)c, (int)d, (int)e)))
#define lookup_host(x) ((struct sockaddr_foobar *) (global[LOOKUP_HOST]((const char *)x)))
#define resolv(x) ((struct sockaddr_foobar *) (global[LOOKUP_HOST]((const char *)x)))
#define host_to_ip(x) ((char *) (global[HOST_TO_IP]((const char *)x)))
#define ip_to_host(x) ((char *) (global[IP_TO_HOST]((const char *)x)))
#define one_to_another(x) ((char *) (global[ONE_TO_ANOTHER]((const char *)x)))
#define set_blocking(x) ((int) (global[SET_BLOCKING]((int)x)))
#define set_non_blocking(x) ((int) (global[SET_NON_BLOCKING]((int)x)))


/* list.c */
#define add_to_list(x, y) ((void)(global[ADD_TO_LIST]((List **)x, (List *)y)))
#define add_to_list_ext(x, y, f) ((void) (global[ADD_TO_LIST_EXT]((List **)x, (List *)y, (int (*)(List *, List *))f )))
#define	find_in_list(x, y, z) ((List *) (global[FIND_IN_LIST]((List **)x, (char *)y, (int)z)))
#define	find_in_list_ext(x, y, n, f) ((List *) (global[FIND_IN_LIST_EXT]((List **)x, (char *)y, (int)n, (int (*)(List *, char *))f )))
#define	remove_from_list(x, y) ((List *) (global[REMOVE_FROM_LIST_]((List **)x, (char *)y)))
#define	remove_from_list_ext(x, y, f) ((List *) (global[REMOVE_FROM_LIST_EXT]((List **)x, (char *)y, (int (*)(List *, char *))f)))
#define	removewild_from_list(x, y) ((List *) (global[REMOVEWILD_FROM_LIST]((List **)x, (char *)y)))
#define	list_lookup(x, y, z, n)  ((List *) (global[LIST_LOOKUP]((List **)x, (char *)y, (int)z, (int)n)))
#define	list_lookup_ext(x, y, z, n, f) ((List *) (global[LIST_LOOKUP_EXT]((List **)x, (char *)y, (int)z, (int)n, (int (*)(List *, char *))f)))

/* alist.c */
#define add_to_array(x, y) ((Array_item *) (global[ADD_TO_ARRAY]((Array *)x, (Array_item *)y)))
#define remove_from_array(x, y) ((Array_item *) (global[REMOVE_FROM_ARRAY]((Array *)x, (char *)y)))
#define array_pop(x, y) ((Array_item *) (global[ARRAY_POP]((Array *)x, (int)y)))

#define remove_all_from_array(x, y) ((Array_item *) (global[REMOVE_ALL_FROM_ARRAY]((Array *)x, (char *)y)))
#define array_lookup(x, y, z, a) ((Array_item *) (global[ARRAY_LOOKUP]((Array *)x, (char *)y, (int)z, (int)a)))
#define find_array_item(x, y, z, a) ((Array_item *) (global[FIND_ARRAY_ITEM]((Array *)x, (char *)y, (int *)z, (int *)a)))

#define find_fixed_array_item(a, b, c, d, e, f) ((Array_item *) (global[FIND_FIXED_ARRAY_ITEM]((void *)a, (size_t)b, (int)c, (char *)d, (int *)e, (int *)f)))

/* output.c */
#define put_it	((void (*)())global[PUT_IT])
#define bitchsay ((void (*)())global[BITCHSAY])
#define yell ((void (*)())global[YELL])
#define add_to_screen(x) ((void) (global[ADD_TO_SCREEN]((unsigned char *)x)))
#define add_to_log(x, y, z, a) ((void) (global[ADD_TO_LOG]((FILE *)x, (time_t)y, (const char *)z, (int)a)))

#define bsd_glob(x, y, z, a) ((int) (global[BSD_GLOB]((char *)x, (int)y, (void *)z, (glob_t *)a)))
#define bsd_globfree(x) ((void) (global[BSD_GLOBFREE]((glob_t *)x)))

/* misc commands */
#define my_encrypt(x, y, z) ((void) (global[MY_ENCRYPT]((char *)x, (int)y, (char *)z)))
#define my_decrypt(x, y, z) ((void) (global[MY_DECRYPT]((char *)x, (int)y, (char *)z)))
#define prepare_command(x, y, z) ((ChannelList *)(global[PREPARE_COMMAND](x, y, z)))
#define convert_output_format ((char * (*)())global[CONVERT_OUTPUT_FORMAT])
#define userage(x, y) ((void) (global[USERAGE]((char *)x, (char *)y)))
#define send_text(x, y, z, a, b) ((void) (global[SEND_TEXT]((char *)x, (const char *)y, (char *)z, (int)a, (int)b)))
/* this needs to be worked out. it's passed in the IrcVariable * to _Init */
#define load(a, b, c, d) ((void) (global[FUNC_LOAD]((char *)a, (char *)b, (char *)c, (char *)d)))
#define update_clock(x) ((char *)(global[UPDATE_CLOCK](x)))
#define PasteArgs(x, n) ((char *) (global[PASTEARGS]((char **)x, (int)n)))
#define BreakArgs(x, y, z, n) ((int) (global[BREAKARGS]((char *)x, (char **)y, (char **)z, (int)n)))

#define set_lastlog_msg_level(x) ((unsigned long) (global[SET_LASTLOG_MSG_LEVEL]((unsigned long)x)))
#define split_CTCP(x, y, z) ((void) (global[SPLIT_CTCP]((char *)x, (char *)y, (char *)z)))
#define random_str(x, y) ((char *) (global[RANDOM_STR]((int)x, (int)y)))
#define dcc_printf ((int (*)())global[DCC_PRINTF])

/* screen.c */
#define prepare_display(x, y, z, a) ((unsigned char **) (global[PREPARE_DISPLAY]((const unsigned char *)x, (int)y, (int *)z, (int)a)))
#define add_to_window(x, y) ((void) (global[ADD_TO_WINDOW]((Window *)x, (const unsigned char *)y)))
#define skip_incoming_mirc(x) ((unsigned char *) (global[SKIP_INCOMING_MIRC]((unsigned char *)x)))
#define add_to_screen(x) ((void) (global[ADD_TO_SCREEN]((unsigned char *)x)))
#define split_up_line(x, y) ((unsigned char **) (global[SPLIT_UP_LINE]((const unsigned char *)x, (int)y)))
#define output_line(x) ((int) (global[OUTPUT_LINE]((const unsigned char *)x)))
#define output_with_count(x, y, z) ((int) (global[OUTPUT_WITH_COUNT]((const unsigned char *)x, (int)y, (int)z)))
#define scroll_window(x) ((void) (global[SCROLL_WINDOW]((Window *)x)))
#define cursor_not_in_display(x) ((void) (global[CURSOR_IN_DISPLAY]((Screen *)x)))
#define cursor_in_display(x) ((void) (global[CURSOR_IN_DISPLAY]((Screen *)x)))
#define is_cursor_in_display(x) ((int) (global[IS_CURSOR_IN_DISPLAY]((Screen *)x)))
#define repaint_window(x, y, z) ((void) (global[REPAINT_WINDOW]((Window *)x, (int)y, (int)z)))

#define kill_screen(x) ((void) (global[KILL_SCREEN]((Screen *)x)))
#define xterm_settitle ((void (*)(void)) global[XTERM_SETTITLE])
#define add_wait_prompt(a, b, c, d, e) ((void) (global[ADD_WAIT_PROMPT]((char *)a,(void (*) (char *, char *))b, (char *)c, (int)d, (int)e )))
#define skip_ctl_c_seq(a, b, c, d) ((const unsigned char *) (global[SKIP_CTL_C_SEQ]((const unsigned char *)a, (int *)b, (int *)c, (int)d)))
#define strip_ansi(x) ((unsigned char *) (global[STRIP_ANSI]((const unsigned char *)x)))
#define create_new_screen ((Screen * (*)(void))global[CREATE_NEW_SCREEN])
#define create_additional_screen ((Window * (*)(void))global[CREATE_ADDITIONAL_SCREEN])


/* window.c */
#define free_formats(x) ((void) (global[FREE_FORMATS]((Window *)x)))
#define set_screens_current_window(x, y) ((void) (global[SET_SCREENS_CURRENT_WINDOW]((Screen *)x, (Window *)y)))
#define new_window(x) ((Window *) (global[NEW_WINDOW]((Screen *)x)))
#define delete_window(x) ((void) (global[DELETE_WINDOW]((Window *)x)))
#define traverse_all_windows(x) ((int) (global[TRAVERSE_ALL_WINDOWS]((Window **)x)))
#define add_to_invisible_list(x) ((void) (global[ADD_TO_INVISIBLE_LIST]((Window *)x)))
#define remove_window_from_screen(x) ((void) (global[REMOVE_WINDOW_FROM_SCREEN]((Window *)x)))
#define recalculate_window_positions(x) ((void) (global[RECALCULATE_WINDOW_POSITIONS]((Screen *)x)))
#define move_window(x, y) ((void) (global[MOVE_WINDOW]((Window *)x, (int)y)))
#define resize_window(x, y, z) ((void) (global[RESIZE_WINDOW]((int)x, (Window *)y, (int)z)))
#define redraw_all_windows ((void (*)(void)) global[REDRAW_ALL_WINDOWS])
#define rebalance_windows(x) ((void) (global[REBALANCE_WINDOWS]((Screen *)x)))
#define recalculate_windows(x) ((void) (global[RECALCULATE_WINDOWS]((Screen *)x)))

#define update_all_windows ((void (*)(void))global[UPDATE_ALL_WINDOWS])

#define goto_window(x, y) ((void) (global[GOTO_WINDOW]((Screen *)x, (int)y)))
#define hide_window(x) ((void) (global[HIDE_BX_WINDOW]((Window *)x)))
#define swap_last_window(x, y) ((void) (global[FUNC_SWAP_LAST_WINDOW]((char)x, (char *)y)))
#define swap_next_window(x, y) ((void) (global[FUNC_SWAP_NEXT_WINDOW]((char)x, (char *)y)))
#define swap_previous_window(x, y) ((void) (global[FUNC_SWAP_PREVIOUS_WINDOW]((char)x, (char
#define show_window(x) ((void) (global[SHOW_WINDOW]((Window *)x)))
#define get_status_by_refnum(x, y) ((char *) (global[GET_STATUS_BY_REFNUM]((unsigned int)x, (unsigned int)y)))
#define get_visible_by_refnum(x) ((int) (global[GET_VISIBLE_BY_REFNUM]((char *)x)))
#define get_window_by_desc(x) ((Window *) (global[GET_WINDOW_BY_DESC]((unsigned int)x)))
#define get_window_by_refnum(x) ((Window *) (global[GET_WINDOW_BY_REFNUM]((unsigned int)x)))
#define get_window_by_name(x) ((Window *) (global[GET_WINDOW_BY_NAME]((char *)x)))
#define next_window(x, y) ((void) (global[FUNC_NEXT_WINDOW]((char)x, (char *)y)))
#define previous_window(x, y) ((void) (global[FUNC_PREVIOUS_WINDOW]((char)x, (char *)y)))
#define update_window_status(x, y) ((void) (global[UPDATE_WINDOW_STATUS]((Window *)x, (int)y)))
#define update_all_status(x, y, z) ((void) (global[UPDATE_ALL_STATUS]((Window *)x, (char *)y, (int) z)))
#define update_window_status_all ((void (*)())global[UPDATE_WINDOW_STATUS_ALL])
#define status_update(x) ((int) (global[STATUS_UPDATE]((int)x)))

#define set_prompt_by_refnum(x, y) ((void) (global[SET_PROMPT_BY_REFNUM]((unsigned int)x, (char *)y)))
#define get_prompt_by_refnum(x) ((char *) (global[GET_PROMPT_BY_REFNUM]((unsigned int)x)))
#define query_nick() ((char *)(global[QUERY_NICK])())
#define query_host() ((char *)(global[QUERY_HOST])())
#define query_cmd()  ((char *)(global[QUERY_CMD])())
#define get_target_by_refnum(x) ((char *) (global[GET_TARGET_BY_REFNUM]((unsigned int)x)))
#define get_target_cmd_by_refnum(x) ((char *) (global[GET_TARGET_CMD_BY_REFNUM]((unsigned int)x)))
#define get_window_target_by_desc(x) ((Window *) (global[GET_WINDOW_TARGET_BY_DESC]((char *)x)))
#define is_current_channel(x, y, z) ((int) (global[IS_CURRENT_CHANNEL]((char *)x, (int)y, (int)z)))
#define set_current_channel_by_refnum(x, y) ((char *) (global[SET_CURRENT_CHANNEL_BY_REFNUM]((int)x, (char *)y)))
#define get_current_channel_by_refnum(x) ((char *) (global[GET_CURRENT_CHANNEL_BY_REFNUM]((int)x)))
#define get_refnum_by_window(x) ((char *) (global[GET_REFNUM_BY_WINDOW]((Window *)x)))
#define is_bound_to_window(x, y) ((int) (global[IS_BOUND_TO_WINDOW]((Window *)x, (char *)y)))
#define get_window_bound_channel(x) ((Window *) (global[GET_WINDOW_BOUND_CHANNEL]((char *)x)))
#define is_bound_anywhere(x) ((int) (global[IS_BOUND_ANYWHERE]((char *)x)))
#define is_bound(x, y) ((int) (global[IS_BOUND]((char *)x, (int)y)))
#define unbind_channel(x, y) ((void) (global[UNBIND_CHANNEL]((char *)x, (int)y)))
#define get_bound_channel(x) ((char *) (global[GET_BOUND_CHANNEL]((Window *)x)))
#define get_window_server(x) ((int) (global[GET_WINDOW_SERVER]((unsigned int)x)))
#define set_window_server(x, y, z) ((void) (global[SET_WINDOW_SERVER]((int)x, (int)y, (int)z)))
#define window_check_servers ((void (*)(int))global[WINDOW_CHECK_SERVERS])
#define window_close_server ((void (*)(int))global[WINDOW_CHECK_SERVERS])
#define change_window_server(x, y) ((void) (global[CHANGE_WINDOW_SERVER]((int)x, (int)y))) 
#define set_level_by_refnum(x, y) ((void) (global[SET_LEVEL_BY_REFNUM]((unsigned int)x, (int)y)))
#define message_to(x) ((void) (global[MESSAGE_TO]((unsigned int)x)))
#define clear_window(x) ((void) (global[CLEAR_WINDOW]((Window *)x)))
#define clear_all_windows(x, y) ((void) (global[CLEAR_ALL_WINDOWS]((int)x, (int)y)))
#define clear_window_by_refnum(x) ((void) (global[CLEAR_WINDOW_BY_REFNUM]((unsigned int)x)))
#define unclear_window_by_refnum(x) ((void) (global[UNCLEAR_WINDOW_BY_REFNUM]((unsigned int)x)))
#define set_scroll_lines(x, y, z) ((void) (global[SET_SCROLL_LINES]((Window *)x, (char *)y, (int)y)))
#define set_continued_lines(x, y, z) ((void) (global[SET_CONTINUED_LINES]((Window *)x, (char *)y, (int)y)))
#define current_refnum ((int (*)())global[CURRENT_REFNUM])
#define number_of_windows_on_screen(x) ((int) (global[NUMBER_OF_WINDOWS_ON_SCREEN]((Window *)x)))
#define set_scrollback_size(x, y, z) ((void) (global[SET_SCROLLBACK_SIZE]((Window *)x, (char *)y, (int)y)))
#define is_window_name_unique(x) ((int) (global[IS_WINDOW_NAME_UNIQUE]((char *)x)))
#define get_nicklist_by_window(x) ((char *) (global[GET_NICKLIST_BY_WINDOW]((Window *)x)))
#define scrollback_backwards_lines(x) ((void) (global[SCROLLBACK_BACKWARDS_LINES]((int)x)))
#define scrollback_forwards_lines(x) ((void) (global[SCROLLBACK_FORWARDS_LINES]((int)x)))
#define scrollback_forwards(x, y) ((void) (global[SCROLLBACK_FORWARDS]((char)x, (char *)y)))
#define scrollback_backwards(x, y) ((void) (global[SCROLLBACK_BACKWARDS]((char)x, (char *)y)))
#define scrollback_end(x, y) ((void) (global[SCROLLBACK_END]((char)x, (char *)y)))
#define scrollback_start(x, y) ((void) (global[SCROLLBACK_START]((char)x, (char *)y)))
#define hold_mode(x, y, z) ((void) (global[HOLD_MODE]((Window *)x, (int)y, (int)z)))
#define unhold_windows ((int (*)())global[UNHOLD_WINDOWS])
#define unstop_all_windows(x, y) ((void) (global[FUNC_UNSTOP_ALL_WINDOWS]((char)x, (char *)y)))
#define reset_line_cnt(x, y, z) ((void) (global[RESET_LINE_CNT]((Window *)x, (char *)y, (int)z)))
#define toggle_stop_screen(x, y) ((void) (global[TOGGLE_STOP_SCREEN]((char)x, (char *)y)))
#define flush_everything_being_held(x) ((void) (global[FLUSH_EVERYTHING_BEING_HELD]((Window *)x)))
#define unhold_a_window(x) ((int) (global[UNHOLD_A_WINDOW]((Window *)x)))
#define recalculate_window_cursor(x) ((void) (global[RECALCULATE_WINDOW_CURSOR]((Screen *)x)))
#define make_window_current(x) ((void) (global[MAKE_WINDOW_CURRENT]((Window *)x)))
#define clear_scrollback(x) ((void) (global[CLEAR_SCROLLBACK]((Window *)x)))

#define set_display_target(x, y) ((void) (global[SET_DISPLAY_TARGET]((const char *)x,(unsigned long)y))) 
#define save_display_target(x, y) ((void) (global[SAVE_DISPLAY_TARGET]((const char **)x, (unsigned long *)y)))
#define restore_display_target(x, y) ((void) (global[RESTORE_DISPLAY_TARGET]((const char *)x, (unsigned long)y)))
#define reset_display_target ((void (*)())global[RESET_DISPLAY_TARGET])

#define build_status(x, y, z) ((void) (global[BUILD_STATUS]((Window *)x, (char *)y, (int)z)))



#define do_hook ((int (*)())global[HOOK])

/* input.c */
#define update_input(x) ((void) (global[FUNC_UPDATE_INPUT]((int)x)))
#define cursor_to_input ((void (*)(void)) global[CURSOR_TO_INPUT])
#define set_input(x) ((void) (global[SET_INPUT]((char *)x)))
#define get_input ((char * (*)(void)) (global[GET_INPUT]))
#define get_input_prompt ((char * (*)(void)) (global[GET_INPUT_PROMPT]))
#define set_input_prompt(x, y, z) ((void) (global[SET_INPUT_PROMPT]((Window *)x, (char *)y, (int)z)))
#define addtabkey(x, y, z) ((void) (global[ADDTABKEY]((char *)x, (char *)y, (int)z)))
#define gettabkey(x, y, z) ((NickTab *) (global[GETTABKEY]((int)x, (int)y, (char *)z)))
#define getnextnick(x, y, z, a) ((NickTab *) (global[GETNEXTNICK]((int)x, (char *)y, (char *)z, (char *)a)))
#define getchannick(x, y) ((char *) (global[GETCHANNICK]((char *)x, (char *)y)))
#define lookup_nickcompletion(x, y) ((NickList *) (global[LOOKUP_NICKCOMPLETION]((ChannelList *)x, (char *)y)))
#define add_completion_type(x, y, z) ((int) (global[ADD_COMPLETION_TYPE]((char *)x, (int)y, (enum completion)z)))

/* names.c */
#define is_channel(x) ((int) (global[IS_CHANNEL]((char *)x)))
#define make_channel(x) ((char *) (global[MAKE_CHANNEL]((char *)x)))
#define is_chanop(x, y) ((int) (global[IS_CHANOP]((char *)x, (char *)y)))
#define im_on_channel(x, y) ((int) (global[IM_ON_CHANNEL]((char *)x, (int)y)))
#define is_on_channel(x, y, z) ((int) (global[IS_ON_CHANNEL]((char *)x, (int)y, (char *)z)))
#define add_channel(x, y, z) ((ChannelList *) (global[ADD_CHANNEL]((char *)x, (int)y, (int)z)))
#define add_to_channel(a, b, c, d, e, f, g, h, i, j) ((ChannelList *) (global[ADD_TO_CHANNEL]((char *)a, (char *)b, (int)c, (int)d, (int)e, (char *)f, (char *)g, (char *)h, (int)i, (int)j)))
#define get_channel_key(x, y) ((char *) (global[GET_CHANNEL_KEY]((char *)x, (int)y)))
#define recreate_mode(x) ((char *) (global[FUNC_RECREATE_MODE]((ChannelList *)x)))
#define compress_modes(x, y, z, a) ((char *) (global[FUNC_COMPRESS_MODES]((ChannelList *)x, (int)y, (char *)z, (char *)a)))
#define got_ops(x, y) ((int) (global[FUNC_GOT_OPS]((int)x, (ChannelList *)y)))
#define get_channel_bans(x, y, z) ((char *) (global[GET_CHANNEL_BANS]((char *)x, (int)y, (int)z)))
#define get_channel_mode(x, y) ((char *) (global[GET_CHANNEL_MODE]((char *)x, (int)y)))
#define clear_bans(x) ((void) (global[CLEAR_BANS]((ChannelList *)x)))
#define remove_channel(x, y) ((void) (global[REMOVE_CHANNEL]((char *)x, (int)y)))
#define remove_from_channel(a, b, c, d, e) ((void) (global[REMOVE_FROM_CHANNEL]((char *)a, (char *)b, (int)c, (int)d, (char *)e)))
#define rename_nick(x, y, z) ((void) (global[RENAME_NICK]((char *)x, (char *)y, (int)z)))
#define get_channel_oper(x, y) ((int) (global[GET_CHANNEL_OPER]((char *)x, (int)y)))
#define get_channel_halfop(x, y) ((int) (global[GET_CHANNEL_HALFOP]((char *)x, (int)y)))
#define get_channel_voice(x, y) ((int) (global[GET_CHANNEL_VOICE]((char *)x, (int)y)))
#define fetch_userhost(x, y) ((char *) (global[FETCH_USERHOST]((int)x, (char *)y)))
#define create_channel_list(x) ((char *) (global[CREATE_CHANNEL_LIST]((Window *)x)))
#define flush_channel_stats ((void (*)(void)) (global[FLUSH_CHANNEL_STATS]))
#define lookup_channel(x, y, z) ((ChannelList *) (global[LOOKUP_CHANNEL]((char *)x, (int)y, (int)z)))

/* hash.c */
#define find_nicklist_in_channellist(x, y, z) ((NickList *) (global[FIND_NICKLIST_IN_CHANNELLIST]((char *)x, (ChannelList *)y, (int)z)))
#define add_nicklist_to_channellist(x, y) ((void) (global[ADD_NICKLIST_TO_CHANNELLIST]((NickList *)x, (ChannelList *)y)))
#define next_nicklist(x, y) ((NickList *) (global[NEXT_NICKLIST] ((ChannelList *)x, (NickList *)y)))
#define next_namelist(x, y, z) ((List *) (global[NEXT_NAMELIST]((HashEntry *)x, (List *)y, (unsigned int)z)))
#define add_name_to_genericlist(x, y, z) ((void) (global[ADD_NAME_TO_GENERICLIST]((char *)x, (HashEntry *)y, (unsigned int)z)))
#define find_name_in_genericlist(x, y, z, a) ((List *) (global[FIND_NAME_IN_GENERICLIST]((char *)x, (HashEntry *)y, (unsigned int)z, (int)a)))
#define add_whowas_userhost_channel(x, y) ((void) (global[ADD_WHOWAS_USERHOST_CHANNEL]((WhowasList *)x, (WhowasWrapList *)y)))
#define find_userhost_channel(x, y, z, a) ((WhowasList *) (global[FIND_USERHOST_CHANNEL]((char *)x, (char *)y, (int)z, (WhowasWrapList *)a)))
#define next_userhost(x, y) ((WhowasList *) (global[NEXT_USERHOST]((WhowasWrapList *)x, (WhowasList *)y)))
#define sorted_nicklist(x, y) ((NickList *) (global[SORTED_NICKLIST]((ChannelList *)x, (int)y)))
#define clear_sorted_nicklist(x) ((void)(global[CLEAR_SORTED_NICKLIST](x)))
#define add_name_to_floodlist(a, b, c, d, e) ((Flooding *) (global[ADD_NAME_TO_FLOODLIST]((char *)a, (char *)b, (char *)c, (HashEntry *)d, (unsigned int)e)))
#define find_name_in_floodlist(a, b, c, d, e) ((Flooding *) (global[FIND_NAME_IN_FLOODLIST]((char *)a, (char *)b, (HashEntry *)c, (unsigned int)d, (int)e)))

#define remove_oldest_whowas_hashlist(x, y, z) ((int) (global[REMOVE_OLDEST_WHOWAS_HASHLIST]((WhowasWrapList *)x, (time_t)y, (int)z)))



/* cset.c fset.c vars.c set string and set int ops */
#define fget_string_var(x) ((char *)(global[FGET_STRING_VAR]((int)x))) 
#define fset_string_var(x, y) ((void) (global[FSET_STRING_VAR]((int)x, (char *)y)))
#define get_wset_string_var(x, y) ((char *) (global[GET_WSET_STRING_VAR]((WSet *)x, (char *)y)))
#define set_wset_string_var(x, y, z) ((void) (global[SET_WSET_STRING_VAR]((WSet *)x, (int)y, (char *)z)))
#define get_cset_int_var(x, y) ((int) (global[GET_CSET_INT_VAR]((CSetList *)x, (int)y)))
#define set_cset_int_var(x, y, z) ((void) (global[SET_CSET_INT_VAR]((CSetList *)x, (int)y, (int)z)))
#define get_cset_str_var(x, y) ((char *) (global[GET_CSET_STR_VAR]((CSetList *)x, (int)y)))
#define set_cset_str_var(x, y, z) ((void) (global[SET_CSET_STR_VAR]((CSetList *)x, (int)y, (char *)z)))

#define get_dllint_var(x) ((int) (global[GET_DLLINT_VAR]((char *)x)))
#define set_dllint_var(x, y) ((void) (global[SET_DLLINT_VAR]((char *)x, (unsigned int)y)))
#define get_dllstring_var(x) ((char *) (global[GET_DLLSTRING_VAR]((char *)x)))
#define set_dllstring_var(x, y) ((void) (global[SET_DLLSTRING_VAR]((char *)x, (char *)y)))

#define get_int_var(x) ((int) (global[GET_INT_VAR]((int)x)))
#define set_int_var(x, y) ((void) (global[SET_INT_VAR]((int)x, (int)y)))
#define get_string_var(x) ((char *) (global[GET_STRING_VAR]((int)x)))
#define set_string_var(x, y) ((void) (global[SET_STRING_VAR]((int)x, (char *)y)))


/* module.c */
#define add_module_proc(x, y, z, a, b, c, d, e) ((int)(global[ADD_MODULE_PROC](x, y, z, a, b, c, d, e)))
#define remove_module_proc(a, b, c, d) ((int) (global[REMOVE_MODULE_PROC]((int)a, (char *)b, (char *)c, (char *)d)))


/* timer.c */
#define add_timer(x, y, z, n, f, a, b, w, c) ((char *) (global[ADD_TIMER]((int)x, (char *)y, (double)z, (long)n, (int (*) (void *))f, (char *)a, (char *)b, (Window *)w, (char *)c)))
#define delete_timer(x) ((int) (global[DELETE_TIMER]((char *)x)))
#define delete_all_timers ((int (*)(void)) (global[DELETE_ALL_TIMERS]))



/* server.c */
#define send_to_server ((void (*)()) global[SEND_TO_SERVER])
#define queue_send_to_server ((void (*)()) global[QUEUE_SEND_TO_SERVER])
#define my_send_to_server ((void (*)()) global[MY_SEND_TO_SERVER])
#define get_connected(x, y) ((void) (global[GET_CONNECTED]((int)x, (int)y)))
#define connect_to_server_by_refnum(x, y) ((int) (global[CONNECT_TO_SERVER_BY_REFNUM]((int)x, (int)y)))
#define close_server(x, y) ((void) (global[CLOSE_SERVER]((int)x, (char *)y)))
#define is_server_connected(x) ((int) (global[IS_SERVER_CONNECTED]((int)x)))
#define flush_server ((void (*)(void)) global[FLUSH_SERVER])
#define server_is_connected(x, y) ((int) (global[SERVER_IS_CONNECTED]((int)x, (int)y)))
#define is_server_open(x) ((int) (global[IS_SERVER_OPEN]((int)x)))
#define close_all_server ((void (*)(void)) global[CLOSE_ALL_SERVER])

#define read_server_file(x) ((int) (global[READ_SERVER_FILE]((char *)x)))
#define add_to_server_list(a, b, c, d, e, f, g) ((void) (global[ADD_TO_SERVER_LIST]((char *)a, (int)b, (char *)c, (char *)d, (char *)e, (int)f, (int)g)))
#define build_server_list(x) ((int) (global[BUILD_SERVER_LIST]((char *)x)))
#define display_server_list() ((void) (global[DISPLAY_SERVER_LIST]()))
#define create_server_list(x) ((char *) (global[CREATE_SERVER_LIST]((char *)x)))
#define parse_server_info(a, b, c, d, e) ((void) (global[PARSE_SERVER_INFO]((char *)a, (char **)b, (char **)c, (char **)d, (char **)e)))
#define server_list_size ((int (*)(void)) global[SERVER_LIST_SIZE])

#define find_server_refnum(x, y) ((int) (global[FIND_SERVER_REFNUM]((char *)x, (char **)y)))
#define find_in_server_list(x, y) ((int) (global[FIND_IN_SERVER_LIST]((char *)x, (int)y)))
#define parse_server_index(x) ((int) (global[PARSE_SERVER_INDEX]((char *)x)))

#define set_server_redirect(x, y) ((void) (global[SET_SERVER_REDIRECT]((int)x, (char *)y)))
#define get_server_redirect(x) ((char *) (global[GET_SERVER_REDIRECT]((int)x)))
#define check_server_redirect(x) ((int) (global[CHECK_SERVER_REDIRECT]((char *)x)))
#define fudge_nickname(x, y) ((void) (global[FUDGE_NICKNAME]((int)x, (int)y)))
#define reset_nickname(x) ((void) (global[RESET_NICKNAME]((int)x)))

#define set_server_cookie(x, y) ((void) (global[SET_SERVER_COOKIE]((int)x, (char *)y)))
#define set_server_flag(x, y, z) ((void) (global[SET_SERVER_FLAG]((int)x, (int)y, (int)z)))
#define set_server_motd(x, y) ((void) (global[SET_SERVER_MOTD]((int)x, (int)y)))
#define set_server_operator(x, y) ((void) (global[SET_SERVER_OPERATOR]((int)x, (int)y)))
#define set_server_itsname(x, y) ((void) (global[SET_SERVER_ITSNAME]((int)x, (char *)y)))
#define set_server_version(x, y) ((void) (global[SET_SERVER_VERSION]((int)x, (int)y)))
#define set_server_lag(x, y) ((void) (global[SET_SERVER_LAG]((int)x, (int)y)))
#define set_server_password(x, y) ((char *) (global[SET_SERVER_PASSWORD]((int)x, (char *)y)))
#define set_server_nickname(x, y) ((void) (global[SET_SERVER_NICKNAME]((int)x, (char *)y)))
#define set_server2_8(x, y) ((void) (global[SET_SERVER2_8]((int)x, (int)y)))
#define set_server_away(x, y, z) ((void) (global[SET_SERVER_AWAY]((int)x, (char *)y, (int)z)))

#define get_server_cookie(x) ((char *) (global[GET_SERVER_COOKIE]((int)x)))
#define get_server_nickname(x) ((char *) (global[GET_SERVER_NICKNAME]((int)x)))
#define get_server_name(x) ((char *) (global[GET_SERVER_NAME]((int)x)))
#define get_server_itsname(x) ((char *) (global[GET_SERVER_ITSNAME]((int)x)))
#define get_server_motd(x) ((int) (global[GET_SERVER_MOTD]((int)x)))
#define get_server_operator(x) ((int) (global[GET_SERVER_OPERATOR]((int)x)))
#define get_server_version(x) ((int) (global[GET_SERVER_VERSION]((int)x)))
#define get_server_flag(x, y) ((int) (global[GET_SERVER_FLAG]((int)x, (int)y)))
#define get_possible_umodes(x) ((char *) (global[GET_POSSIBLE_UMODES]((int)x)))
#define get_server_port(x) ((int) (global[GET_SERVER_PORT]((int)x)))
#define get_server_lag(x) ((int) (global[GET_SERVER_LAG]((int)x)))
#define get_server2_8(x) ((int) (global[GET_SERVER2_8]((int)x)))
#define get_umode(x) ((char *) (global[GET_UMODE]((int)x)))
#define get_server_away(x) ((char *) (global[GET_SERVER_AWAY]((int)x)))
#define get_server_network(x) ((char *) (global[GET_SERVER_NETWORK]((int)x)))
#define get_pending_nickname(x) ((char *) (global[GET_PENDING_NICKNAME]((int)x)))
#define server_disconnect(x, y) ((void) (global[SERVER_DISCONNECT]((int)x, (char *)y)))

#define get_server_list ((Server * (*)(void)) global[GET_SERVER_LIST])
#define get_server_channels(x) ((ChannelList *) (global[GET_SERVER_CHANNELS]((int) x)))

#define set_server_last_ctcp_time(x, y) ((void) (global[SET_SERVER_LAST_CTCP_TIME]((int)x, (time_t)y)))
#define get_server_last_ctcp_time(x) ((time_t) (global[GET_SERVER_LAST_CTCP_TIME]((int)x)))
#define set_server_trace_flag(x, y) ((void) (global[SET_SERVER_TRACE_FLAG]((int)x, (int)y)))
#define get_server_trace_flag(x) ((int) (global[GET_SERVER_TRACE_FLAG]((int)x)))
#define get_server_read(x) ((int) (global[GET_SERVER_READ]((int)x)))
#define get_server_linklook(x) ((int) (global[GET_SERVER_LINKLOOK]((int)x)))
#define set_server_linklook(x, y) ((void) (global[SET_SERVER_LINKLOOK]((int)x, (int)y)))
#define get_server_stat_flag(x) ((int) (global[GET_SERVER_STAT_FLAG]((int)x)))
#define set_server_stat_flag(x, y) ((void) (global[SET_SERVER_STAT_FLAG]((int)x, (int)y)))
#define get_server_linklook_time(x) ((time_t) (global[GET_SERVER_LINKLOOK_TIME]((int)x)))
#define set_server_linklook_time(x, y) ((void) (global[SET_SERVER_LINKLOOK_TIME]((int)x, (time_t)y)))
#define get_server_trace_kill(x) ((int) (global[GET_SERVER_TRACE_KILL]((int)x)))
#define set_server_trace_kill(x, y) ((void) (global[SET_SERVER_TRACE_KILL]((int)x, (int)y)))
#define add_server_channels(x, y) ((void) (global[ADD_SERVER_CHANNELS]((int)x, (ChannelList *)y)))
#define set_server_channels(x, y) ((void) (global[SET_SERVER_CHANNELS]((int)x, (ChannelList *)y)))
#define send_msg_to_channels(x, y, z) ((void) (global[SEND_MSG_TO_CHANNELS]((ChannelList *)x, (int)y, (char *)z)))
#define send_msg_to_nicks(x, y, z) ((void) (global[SEND_MSG_TO_CHANNELS]((NickList *)x, (int)y, (char *)z)))
#define is_server_queue() ((int) (global[IS_SERVER_QUEUE]()))


/* sockets */
#define add_socketread(a, b, c, d, x, y) ((int) (global[ADD_SOCKETREAD]((int)a, (int)b, (unsigned long)c, (char *)d, (void *)x, (void *)y)))
#define add_sockettimeout(x, y, z) ((int) (global[ADD_SOCKETTIMEOUT]((int)x, (time_t)y, (void *)z)))
#define close_socketread(x) ((void) (global[CLOSE_SOCKETREAD]((int)x)))
#define get_socket(x) ((SocketList *) (global[GET_SOCKET]((int)x)))
#define set_socketflags(x, y) ((void) (global[SET_SOCKETFLAGS]((int)x, (unsigned long)y)))
#define get_socketflags(x) ((unsigned long) (global[GET_SOCKETFLAGS]((int)x)))
#define check_socket(x) ((int) (global[CHECK_SOCKET]((int)x)))
#define read_sockets(x, y, z) ((int) (global[READ_SOCKETS]((int)x, (char *)y, (int)z)))
#define write_sockets(x, y, z, a) ((int) (global[WRITE_SOCKETS]((int)x, (char *)y, (int)z, (int)a)))
#define get_max_fd() ((int) (global[GET_MAX_FD]()))
#define new_close(x) ((int) (global[NEW_CLOSE]((int)x)))
#define new_open(x) ((int) (global[NEW_OPEN]((int)x)))
#define dgets(x, y, z, l, m) ((int) (global[DGETS]((char *)x, (int)y, (int)z, (int)l, (void *)m)))
#define get_socketinfo(a) ((void *) (global[GET_SOCKETINFO]((int)a)))
#define set_socketinfo(a, b) ((void) (global[SET_SOCKETINFO]((int)a, (void *)b)))
#define set_socket_write(a) ((int) (global[SET_SOCKETWRITE]((int)a)))


/* flood.c */
#define is_other_flood(x, y, z, a) ((int) (global[IS_OTHER_FLOOD]((ChannelList *)x, (NickList *)y, (int)z, (int *)a)))
#define check_flooding(x, y, z, a) ((int) (global[CHECK_FLOODING]((char *)x, (int)y, (char *)z, (char *)a)))
#define flood_prot(x, y, z, a, b, c) ((int) (global[FLOOD_PROT]((char *)x, (char *)y, (char *)z, (int)a, (int)b, (char *)c)))

/* expr.c */
#define next_unit(a, b, c, d) ((char *) (global[NEXT_UNIT]((char *)a, (char *)b, (int *)c, (int)d)))
#define parse_inline(x, y, z) ((char *) (global[PARSE_INLINE]((char *)x, (char *)y, (int *)z)))
#define expand_alias(a, b, c, d) ((char *) (global[EXPAND_ALIAS]((char *)a, (char *)b, (int *)c, (char **)d)))
#define alias_special_char(a, b, c, d, e) ((char *) (global[ALIAS_SPECIAL_CHAR]((char **)a, (char *)b, (char *)c, (char *)d, (int *)e))) 
#define parse_line(a, b, c, e, f, g) ((void) (global[PARSE_LINE]((char *)a, (char *)b, (char *)c, (int)e, (int)f, (int)g)))
#define parse_command(a, b, c) ((void) (global[PARSE_COMMAND_FUNC]((char *)a, (int)b, (char *)c)))
#define make_local_stack(a) ((void) (global[MAKE_LOCAL_STACK]((char *)a)))
#define destroy_local_stack() ((void (*)(void)) (global[DESTROY_LOCAL_STACK]))()


/* dcc.c */
#define dcc_create(a, b, c, d, e, f, g, h) ((DCC_int *) (global[DCC_CREATE_FUNC]((char *)a, (char *)b, (char *)c, (unsigned long)d, (int)e, (int)f, (unsigned long)g, (void (*) (int))h)))
#define find_dcc(a, b, c, d, e, f, g) ((SocketList *) (global[FIND_DCC_FUNC]((char *)a, (char *)b, (char *)c, (int)d, (int)e, (int)f, (int)g)))
#define erase_dcc_info ((void (*)()) global[ERASE_DCC_INFO])
#define add_dcc_bind(a, x, b, c, d, e, f) ((int) (global[ADD_DCC_BIND]((char *)a, (char *)x, (void *)b,(void *)c,(void *)d,(void *)e,(void *)f)))
#define remove_dcc_bind(x, y) ((int) (global[REMOVE_DCC_BIND]((char *)x, (int)y)))
#define remove_all_dcc_binds(x) ((int) (global[REMOVE_ALL_DCC_BINDS])((char *)x))
#define get_active_count ((int (*)(void)) (global[GET_ACTIVE_COUNT]))
#define get_num_queue ((int (*)(void)) (global[GET_NUM_QUEUE]))
#define add_to_queue(x, y, z) ((int) (global[ADD_TO_QUEUE]((char *)x, (char *)y, (pack *)z)))
#define dcc_filesend(x, y) ((void) (global[DCC_FILESEND]((char *)x, (char *)y)))
#define dcc_resend(x, y) ((void) (global[DCC_RESEND]((char *)x, (char *)y)))

/* irc.c */
#define irc_exit ((void (*)())  (global[IRC_EXIT_FUNC]))
#define io(x) ((void) (global[IRC_IO_FUNC]((char *)x)))

/* commands.c */
#define find_command(x, y) ( (IrcCommand *)(global[FIND_COMMAND_FUNC]((char *)x, (int *)y)))

#define lock_stack_frame() ((void (*)(void)) (global[LOCK_STACK_FRAME]))()
#define unlock_stack_frame() ((void (*) (void)) (global[UNLOCK_STACK_FRAME]))()

/* who.c */
#define userhostbase ((void (*)())global[USERHOSTBASE])
#define isonbase ((void (*)())global[ISONBASE])
#define whobase ((void (*)())global[WHOBASE])

#define add_to_window_list(x, y) ((int) (global[ADD_TO_WINDOW_LIST]((struct ScreenStru *)x, (Window *)y)))

/*
 * Rest of these are all variables of various sorts.
 */

#ifndef MAIN_SOURCE

#define nickname ((char *) *global[NICKNAME])
#define irc_version ((char *) *global[IRC_VERSION])

#define from_server (*(int *)global[FROM_SERVER])
#define connected_to_server ((int) *((int *)global[CONNECTED_TO_SERVER]))
#define primary_server ((int) *((int *)global[PRIMARY_SERVER]))
#define parsing_server_index ((int) *((int *)global[PARSING_SERVER_INDEX]))
#define now ((time_t) *((time_t *)global[NOW]))
#define start_time ((time_t) *((time_t *)global[START_TIME]))
#define idle_time() ((time_t) *((time_t *)global[IDLE_TIME]()))

#define loading_global ((int) *((int *)global[LOADING_GLOBAL]))
#define target_window (*((Window **)global[TARGET_WINDOW]))
#define current_window (*((Window **)global[CURRENT_WINDOW]))
#define invisible_list (*((Window **)global[INVISIBLE_LIST]))
#define main_screen (*((Screen **)global[MAIN_SCREEN]))
#define last_input_screen (*((Screen **)global[LAST_INPUT_SCREEN]))
#define output_screen (*((Screen **)global[OUTPUT_SCREEN]))
#define screen_list (*((Screen **)global[SCREEN_LIST]))
#define irclog_fp (*((FILE **)global[IRCLOG_FP]))
#define dll_functions (*((BuiltInDllFunctions **)global[DLL_FUNCTIONS]))
#define dll_numeric (*((NumericFunction **)global[DLL_NUMERIC]))
#define dll_commands (*((IrcCommandDll **)global[DLL_COMMANDS]))
#define dll_variable (*((IrcVariableDll **)global[DLL_VARIABLE]))
#define dll_ctcp (*((CtcpEntryDll **)global[DLL_CTCP]))
#define dll_window (*((WindowDll **)global[DLL_WINDOW]))
#define window_display ((int) *((int *)global[WINDOW_DISPLAY]))
#define status_update_flag ((int) *((int *)global[STATUS_UPDATE_FLAG]))
#define tabkey_array (*((NickTab **)global[TABKEY_ARRAY]))
#define autoreply_array (*((NickTab *)global[AUTOREPLY_ARRAY]))
#define identd ((int) *((int *)global[IDENTD_SOCKET]))
#define doing_notice ((int) *((int *)global[DOING_NOTICE]))
#define last_sent_msg_body (*((char **)global[LAST_SENT_MSG_BODY]))
#define sent_nick (*((char **)global[SENT_NICK]))

#define default_output_function (*(void (**)(char *))global[DEFAULT_OUTPUT_FUNCTION])

#define serv_open_func (*(int (**)(int, unsigned long, int))global[SERV_OPEN_FUNC])
#define serv_input_func (*(int (**)(int, char *, int, int, int))global[SERV_INPUT_FUNC])
#define serv_output_func (*(int (**)(int, int, char *, int))global[SERV_OUTPUT_FUNC])
#define serv_close_func (*(int (**)(int, unsigned long, int))global[SERV_CLOSE_FUNC])
#if 0
#define check_ext_mail_status (*(int (**)()) global[CHECK_EXT_MAIL_STATUS])
#define check_ext_mail (*(char *(**)())global[CHECK_EXT_MAIL])
#endif

#ifdef WANT_TCL
#define tcl_interp ((Tcl_Interp *)((Tcl_Interp **)(global[VAR_TCL_INTERP])))
#else
#define tcl_interp NULL
#endif
#else
#undef get_time
#define get_time(a) BX_get_time(a)
#endif /* MAIN_SOURCE */

#ifdef GUI
#ifndef MAIN_SOURCE
#define lastclicklinedata ((char *) *global[LASTCLICKLINEDATA])
#define contextx ((int) *((int *)global[CONTEXTX]))
#define contexty ((int) *((int *)global[CONTEXTY]))
#define guiipc ((int) *((int *)global[GUIIPC]))
#endif
#define gui_mutex_lock() ((void (*)(void)) global[GUI_MUTEX_LOCK])()
#define gui_mutex_unlock() ((void (*)(void))global[GUI_MUTEX_UNLOCK])()
#endif

#endif /* WTERM_C || STERM_C */
#endif

--- NEW FILE: keys.h ---
/*
 * keys.h: header for keys.c 
 *
 * Copyright 1990 Michael Sandrof
 * Copyright 1997 EPIC Software Labs
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 */

#ifndef __keys_h__
#define __keys_h__

/* I hate typedefs... */
typedef void (*KeyBinding) (char, char *);

	BUILT_IN_COMMAND(bindcmd);
	BUILT_IN_COMMAND(rbindcmd);
	BUILT_IN_COMMAND(parsekeycmd);
	BUILT_IN_COMMAND(type);

	int		get_binding	(int, unsigned char,
					 KeyBinding *, char **);
	void		save_bindings 	(FILE *, int);
	void		init_keys 	(void);
	void		init_keys2 	(void);
	void		remove_bindings	(void);
	void		unload_bindings	(const char *);
	void		resize_metamap	(int);
	void		disable_stop	(void);
	char		*convert_to_keystr (char *);
		
#ifdef GUI
enum MOUSE_ACTIONS {
   RCLICK,
   STATUSRCLICK,
   NICKLISTRCLICK,
   LCLICK,
   STATUSLCLICK,
   NICKLISTLCLICK,
   MCLICK,
   STATUSMCLICK,
   NICKLISTMCLICK,
   RDBLCLICK,
   STATUSRDBLCLICK,
   NICKLISTRDBLCLICK,
   LDBLCLICK,
   STATUSLDBLCLICK,
   NICKLISTLDBLCLICK,
   MDBLCLICK,
   STATUSMDBLCLICK,
   NICKLISTMDBLCLICK,
   MAX_MOUSE
};
#endif

#endif /* _KEYS_H_ */

--- NEW FILE: defs.h.in ---
/* include/defs.h.in.  Generated automatically from configure.in by autoheader.  */
/* Define short BitchX version here */
#undef _VERSION_

/* Define long BitchX version here */
#undef VERSION

/* Define BitchX version number here */
#undef VERSION_NUMBER

/* Define this if you have a crypt implementation in -lcrypt */
#undef HAVE_CRYPT

/* Define this if you have the resolv library */
#undef HAVE_RESOLV

/* Define this if tparm is declared in an included header */
#undef TPARM_DECLARED

/* Define this if you have the tparm function in an included lib */
#undef HAVE_TPARM

/* Define this if tputs is declared in an included header */
#undef TPUTS_DECLARED

/* Define this if you have the tputs function in an included lib */
#undef HAVE_TPUTS

/* Define this if you have terminfo support */
#undef HAVE_TERMINFO

/* define this if an unsigned long is 32 bits */
#undef UNSIGNED_LONG32

/* define this if an unsigned int is 32 bits */
#undef UNSIGNED_INT32

/* define this if you are unsure what is is 32 bits */
#undef UNKNOWN_32INT

/* Define this if stpcpy is declared in unistd.h */
#undef STPCPY_DECLARED

/* Define this if getpgid is declared in unistd.h */
#undef GETPGID_DECLARED

/* Define this if killpg is declared in signal.h */
#undef KILLPG_DECLARED

/* Define this if getpass is declared */
#undef GETPASS_DECLARED

/* Define this if errno is declared */
#undef ERRNO_DECLARED

/* Define this if struct linger is declared in sys/socket.h */
#undef STRUCT_LINGER_DECLARED

/* Define this if sun_len is declared in sys/un.h */
#undef HAVE_SUN_LEN

/* Define this if you want QMAIL support */
#undef HAVE_QMAIL

/* Define this if bcopy is declared in string.h */
#undef BCOPY_DECLARED

/* Define this if you system has inet_aton */
#undef HAVE_INET_ATON
 
/* Define your maildir here */
#undef UNIX_MAIL

/* Define a list of default servers here */
#undef DEFAULT_SERVER

/* Define this if you want Tcl support */
#undef WANT_TCL

/* Define this if you have tcl.h */
#undef HAVE_TCL_H

/* Define this is the system has SSL support */
#undef HAVE_SSL

/* Define this if you want IPV6 support */
#undef IPV6

/* Define this if you want SOCKS support */
#undef SOCKS

/* Non-blocking type should be one of these */
#undef NBLOCK_POSIX
#undef NBLOCK_BSD
#undef NBLOCK_SYSV

/*
 * Are we doing non-blocking connects? Note: SOCKS support precludes us from
 * using this feature.
 */
#if (defined(NBLOCK_POSIX) || defined(NBLOCK_BSD) || defined(NBLOCK_SYSV)) && !defined(SOCKS)
#define NON_BLOCKING_CONNECTS
#endif

/* Define this if you want CD-ROM support */
#undef WANT_CD

/* Define this if you want GUI support (PM or GTK) */
#undef GUI

/* Defined if Win32 GUI */
#if defined(GUI) && defined(WINNT)
#define WIN32 1
#endif

/* Define this is you want OS/2 PM support */
#undef __EMXPM__

/* Define this if you want GTK support */
#undef GTK

/* Define this if you want imlib support */
#undef USE_IMLIB

/* Define this if you want GNOME support */
#undef USE_GNOME

/* Define this if your ZVT is newer than 1.0.10 */
#undef HAVE_NEW_ZVT

/* Define this if you want ZVT support */
#undef USE_ZVT

/* Define this is you want sound support */
#undef SOUND

/* Define this if you want loadable module support */
#undef HAVE_DLLIB

/*
 * Define this if you have shlib support and want plugin support in BitchX
 * Note: Not all systems support this.
 */
#ifdef HAVE_DLLIB
#define WANT_DLL
#endif

/* The Extra Files */
#undef DEFAULT_CTOOLZ_DIR
#undef DEFAULT_MSGLOGFILE
#undef DEFAULT_BITCHX_HELP_FILE
#undef DEFAULT_SCRIPT_HELP_FILE
#undef DEFAULT_BITCHX_KICK_FILE
#undef DEFAULT_BITCHX_QUIT_FILE
#undef DEFAULT_BITCHX_IRCNAME_FILE

/* Needed defines */
#undef DEFAULT_HELP_PATH
#undef IRCLIB
#undef IRCPATH
#undef SHLIB_SUFFIX
#undef PLUGINDIR
#undef SCRIPT_PATH
#undef WSERV_PATH
#undef TRANSLATION_PATH

/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
   systems. This function is required for `alloca.c' support on those systems.
   */
#undef CRAY_STACKSEG_END

/* Define if using `alloca.c'. */
#undef C_ALLOCA

/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID

/* Define if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA

/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H

/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H

/* Define if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H

/* Define if you have the <curses.h> header file. */
#undef HAVE_CURSES_H

/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H

/* Define if you have the `fchdir' function. */
#undef HAVE_FCHDIR

/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H

/* Define if you have the `fpathconf' function. */
#undef HAVE_FPATHCONF

/* Define if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME

/* Define if you have the `getlogin' function. */
#undef HAVE_GETLOGIN

/* Define if you have the `getpass' function. */
#undef HAVE_GETPASS

/* Define if you have the `getpgid' function. */
#undef HAVE_GETPGID

/* Define if you have the `getpwent' function. */
#undef HAVE_GETPWENT

/* Define if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE

/* Define if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY

/* Define if you have the `killpg' function. */
#undef HAVE_KILLPG

/* Define if you have the `crypt' library (-lcrypt). */
#undef HAVE_LIBCRYPT

/* Define if you have the `curses' library (-lcurses). */
#undef HAVE_LIBCURSES

/* Define if you have the `c_r' library (-lc_r). */
#undef HAVE_LIBC_R

/* Define if you have the `dgc' library (-ldgc). */
#undef HAVE_LIBDGC

/* Define if you have the `dir' library (-ldir). */
#undef HAVE_LIBDIR

/* Define if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL

/* Define if you have the `dld' library (-ldld). */
#undef HAVE_LIBDLD

/* Define if you have the `dmalloc' library (-ldmalloc). */
#undef HAVE_LIBDMALLOC

/* Define if you have the `intl' library (-lintl). */
#undef HAVE_LIBINTL

/* Define if you have the `m' library (-lm). */
#undef HAVE_LIBM

/* Define if you have the `mysqlclient' library (-lmysqlclient). */
#undef HAVE_LIBMYSQLCLIENT

/* Define if you have the `mytinfo' library (-lmytinfo). */
#undef HAVE_LIBMYTINFO

/* Define if you have the `ncurses' library (-lncurses). */
#undef HAVE_LIBNCURSES

/* Define if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL

/* Define if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD

/* Define if you have the `pthreads' library (-lpthreads). */
#undef HAVE_LIBPTHREADS

/* Define if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV

/* Define if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET

/* Define if you have the `socks' library (-lsocks). */
#undef HAVE_LIBSOCKS

/* Define if you have the `socks5' library (-lsocks5). */
#undef HAVE_LIBSOCKS5

/* Define if you have the `ssl' library (-lssl). */
#undef HAVE_LIBSSL

/* Define if you have the `sun' library (-lsun). */
#undef HAVE_LIBSUN

/* Define if you have the `tcl' library (-ltcl). */
#undef HAVE_LIBTCL

/* Define if you have the `tcl76' library (-ltcl76). */
#undef HAVE_LIBTCL76

/* Define if you have the `tcl80' library (-ltcl80). */
#undef HAVE_LIBTCL80

/* Define if you have the `termcap' library (-ltermcap). */
#undef HAVE_LIBTERMCAP

/* Define if you have the `termlib' library (-ltermlib). */
#undef HAVE_LIBTERMLIB

/* Define if you have the `tinfo' library (-ltinfo). */
#undef HAVE_LIBTINFO

/* Define if you have the `x' library (-lx). */
#undef HAVE_LIBX

/* Define if you have the <linux/soundcard.h> header file. */
#undef HAVE_LINUX_SOUNDCARD_H

/* Define if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H

/* Define if you have the `memmove' function. */
#undef HAVE_MEMMOVE

/* Define if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP

/* Define if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H

/* Define if you have the <ncurses/termcap.h> header file. */
#undef HAVE_NCURSES_TERMCAP_H

/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H

/* Define if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H

/* Define if you have the <netinet/in_systm.h> header file. */
#undef HAVE_NETINET_IN_SYSTM_H

/* Define if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H

/* Define if you have the `realpath' function. */
#undef HAVE_REALPATH

/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H

/* Define if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H

/* Define if you have the `scandir' function. */
#undef HAVE_SCANDIR

/* Define if you have the `select' function. */
#undef HAVE_SELECT

/* Define if you have the `setsid' function. */
#undef HAVE_SETSID

/* Define if you have the `setvbuf' function. */
#undef HAVE_SETVBUF

/* Define if you have the `snprintf' function. */
#undef HAVE_SNPRINTF

/* Define if you have the `socket' function. */
#undef HAVE_SOCKET

/* Define if you have the `stpcpy' function. */
#undef HAVE_STPCPY

/* Define if you have the `strerror' function. */
#undef HAVE_STRERROR

/* Define if you have the `strftime' function. */
#undef HAVE_STRFTIME

/* Define if you have the `strlcat' function. */
#undef HAVE_STRLCAT

/* Define if you have the `strlcpy' function. */
#undef HAVE_STRLCPY

/* Define if you have the `strtoul' function. */
#undef HAVE_STRTOUL

/* Define if you have the `sysconf' function. */
#undef HAVE_SYSCONF

/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H

/* Define if you have the <sys/fcntl.h> header file. */
#undef HAVE_SYS_FCNTL_H

/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H

/* Define if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H

/* Define if you have the <sys/in_systm.h> header file. */
#undef HAVE_SYS_IN_SYSTM_H

/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H

/* Define if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H

/* Define if you have the <sys/syslimits.h> header file. */
#undef HAVE_SYS_SYSLIMITS_H

/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H

/* Define if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H

/* Define if you have the <termcap.h> header file. */
#undef HAVE_TERMCAP_H

/* Define if you have the `uname' function. */
#undef HAVE_UNAME

/* Define if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF

/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE

/* Define if the `setpgrp' function takes no argument. */
#undef SETPGRP_VOID

/* Define if the `setvbuf' function takes the buffering type as its second
   argument and the buffer pointer as the third, as on System V before release
   3. */
#undef SETVBUF_REVERSED

/* The size of a `unsigned int', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_INT

/* The size of a `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG

/* If using the C implementation of alloca, define if you know the
   direction of stack growth for your system; otherwise it will be
   automatically deduced at run-time.
        STACK_DIRECTION > 0 => grows toward higher addresses
        STACK_DIRECTION < 0 => grows toward lower addresses
        STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION

/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Define if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
#undef SYS_SIGLIST_DECLARED

/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME

/* Define if on AIX 3.
   System headers sometimes define this.
   We just want to avoid a redefinition error message.  */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif

/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE

/* Define to empty if `const' does not conform to ANSI C. */
#undef const

/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t

/* Define as `__inline' if that's what the C compiler calls it, or to nothing
   if it is not supported. */
#undef inline

/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t

/* Define to `long' if <sys/types.h> does not define. */
#undef off_t

/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t

/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t

/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t

--- NEW FILE: history.h ---
/*
 * history.h: header for history.c 
 *
 * Copyright 1990 Michael Sandrof
 * Copyright 1997 EPIC Software Labs
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: history.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __history_h__
#define __history_h__

	BUILT_IN_COMMAND(history);
	void	set_history_size	(Window *, char *, int);
	void	add_to_history 		(char *);
	char	*get_from_history (int);
	void	get_history 		(int);
	char	*do_history 		(char *, char *);
	void	shove_to_history 	(char, char *);

/* used by get_history */
#define NEXT 0
#define PREV 1

#endif /* _HISTORY_H_ */

--- NEW FILE: encrypt.h ---
/*
 * crypt.h: header for crypt.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: encrypt.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __CRYPT_H_
#define __CRYPT_H_

	char	*crypt_msg (char *, char *);
	char	*decrypt_msg (char *, char *);
	void	encrypt_cmd (char *, char *, char *, char *);
	char	*is_crypted (char *);
	void	BX_my_decrypt (char *, int, char *);
	void	BX_my_encrypt (char *, int, char *);

#define CRYPT_HEADER ""
#define CRYPT_HEADER_LEN 5

#endif /* __crypt_h_ */

--- NEW FILE: struct.h ---
/*
 * struct.h: header file for structures needed for prototypes
 *
 * Written by Scott Reynolds, based on code by Michael Sandrof
 * Heavily modified by Colten Edwards for BitchX
 *
 * Copyright(c) 1997
 *
 */

#ifndef __struct_h_
#define	__struct_h_

#ifdef WINNT
#include <windows.h>
#endif

#include "alist.h"
#include "hash.h"
[...1206 lines suppressed...]
	struct transfer_struct transfer_orders;	/* structure for resending files */
	int		file;			/* file handle open file */
	u_32int_t	filesize;		/* the filesize to get */
	u_32int_t	packets;		/* number of blocksize packets recieved */
	int		eof;			/* in EOF condition. */
	int		blocksize;		/* this dcc's blocksize */
	int		dcc_fast;		/* set if non-blocking used */
	short		readwaiting; 		/* expect a data on the port */
	unsigned short	remport;		/* the remport we are connected to */
	unsigned short	localport;		/* the localport we are on */
	struct	in_addr	remote;			/* this dcc's remote address */
	unsigned int	dccnum;			/* dcc number we are at */
	UserList	*ul;			/* is this person on the userlist */
} DCC_int;

typedef struct _dcc_struct_type {
	u_32int_t 	struct_type;
} dcc_struct_type;
                       
#endif /* __struct_h_ */

--- NEW FILE: array.h ---
/* 
 * IRC-II (C) 1990, 1995 Michael Sandroff, Matthew Green
 * This file (C) 1993, 1995 Aaron Gifford and Jeremy Nelson
 *
 * array.h -- header file for array.c
 * See the COPYRIGHT file for copyright information
 *
 */

#ifndef ARRAY_H
#define ARRAY_H

#include "irc_std.h"

	BUILT_IN_FUNCTION(function_indextoitem);
	BUILT_IN_FUNCTION(function_itemtoindex);
	BUILT_IN_FUNCTION(function_igetitem);
	BUILT_IN_FUNCTION(function_getitem);
	BUILT_IN_FUNCTION(function_setitem);
	BUILT_IN_FUNCTION(function_finditem);
	BUILT_IN_FUNCTION(function_matchitem);
	BUILT_IN_FUNCTION(function_rmatchitem);
	BUILT_IN_FUNCTION(function_getmatches);
	BUILT_IN_FUNCTION(function_getrmatches);
	BUILT_IN_FUNCTION(function_delitem);
	BUILT_IN_FUNCTION(function_numitems);
	BUILT_IN_FUNCTION(function_getarrays);
	BUILT_IN_FUNCTION(function_numarrays);
	BUILT_IN_FUNCTION(function_delarray);
	BUILT_IN_FUNCTION(function_ifinditem);
	BUILT_IN_FUNCTION(function_ifindfirst);
	BUILT_IN_FUNCTION(function_listarray);
	BUILT_IN_FUNCTION(function_gettmatch);
	BUILT_IN_FUNCTION(function_igetmatches);
	BUILT_IN_FUNCTION(function_igetrmatches);
	void delete_all_arrays(void);

#endif

--- NEW FILE: hebrew.h ---
/*
 * hebrew.h
 * by crisk
 * 
 * for hebrew_process in hebrew.c
 * 
 */

extern unsigned char *hebrew_process(unsigned char *str);



--- NEW FILE: alias.h ---
/*
 * alias.h: header for alias.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: alias.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _ALIAS_H_
#define _ALIAS_H_

#include "irc_std.h"

#define DCC_STRUCT 0
#define USERLIST_STRUCT 1
#define NICK_STRUCT 2
#define SERVER_STRUCT 3


extern BuiltInDllFunctions *dll_functions;

/*
 * XXXX - These need to go away
 */
#define COMMAND_ALIAS 0
#define VAR_ALIAS 1
#define VAR_ALIAS_LOCAL 2

/*
 * These are the user commands.  Dont call these directly.
 */
extern	void	aliascmd  		(char *, char *, char *, char *);
extern	void	assigncmd 		(char *, char *, char *, char *);
extern	void	localcmd  		(char *, char *, char *, char *);
extern	void	stubcmd   		(char *, char *, char *, char *);
extern	void	dumpcmd   		(char *, char *, char *, char *);

extern	void 	add_var_alias      	(char *, char *);
extern	void 	add_local_alias    	(char *, char *);
/*extern	void 	add_cmd_alias 	   	(char *, char *);*/
extern	void 	add_var_stub_alias 	(char *, char *);
extern	void 	add_cmd_stub_alias 	(char *, char *);

extern	char *	get_variable		(char *);
extern	char **	glob_cmd_alias		(char *, int *);
extern	char *	get_cmd_alias   	(char *, int *, char **, void **);
extern	char **	get_subarray_elements 	(char *, int *, int);


/* These are in expr.c */
/*
 * This function is a general purpose interface to alias expansion.
 * The second argument is the text to be expanded.
 * The third argument are the command line expandoes $0, $1, etc.
 * The fourth argument is a flag whether $0, $1, etc are used
 * The fifth argument, if set, controls whether only the first "command"
 *   will be expanded.  If set, this argument will be set to the "rest"
 *   of the commands (after the first semicolon, or the null).  If NULL,
 *   then the entire text will be expanded.
 */
extern	char *	BX_expand_alias 		(const char *, const char *, int *, char **);

/*
 * This is the interface to the "expression parser"
 * The first argument is the expression to be parsed
 * The second argument is the command line expandoes ($0, $1, etc)
 * The third argument will be set if the command line expandoes are used.
 */
extern	char *	BX_parse_inline 		(char *, const char *, int *);

/*
 * This function is used to call a user-defined function.
 * Noone should be calling this directly except for call_function.
 */
extern	char *	call_user_function 	(char *, char *);
extern	void	call_user_alias		(char *, char *, char *, void *);



/*
 * This function is sued to save all the current aliases to a global
 * file.  This is used by /SAVE and /ABORT.
 */
extern	void	save_aliases 		(FILE *, int);
extern	void	save_assigns 		(FILE *, int);

/*
 * This function is in functions.c
 * This function allows you to execute a primitive "BUILT IN" expando.
 * These are the $A, $B, $C, etc expandoes.
 * The argument is the character of the expando (eg, 'A', 'B', etc)
 *
 * This is in functions.c
 */
extern 	char *	built_in_alias		(char, int *);



/* BOGUS */

/*
 * This function is used by parse_command to directly execute an alias.
 * Noone should be calling this function directly. (call parse_line.)
 */
/*extern	void	execute_alias 		(char *, char *, char *);*/
		void	prepare_alias_call      (void *, char **);
		void	destroy_alias_call      (void *);


/*
 * This is in functions.c
 * This is only used by next_unit and expand_alias to call built in functions.
 * Noone should call this function directly.
 */
extern char *	call_function		(char *, const char *, int *);



/*
 * These are the two primitives for runtime stacks.
 */
extern	void	BX_make_local_stack 	(char *);
extern	void	BX_destroy_local_stack 	(void);
extern	void	set_current_command 	(char *);
extern	void	bless_local_stack 	(void);
extern	void	unset_current_command 	(void);
extern	void	dump_call_stack		(void);
extern	void	panic_dump_call_stack 	(void);
extern  void    BX_lock_stack_frame        (void);
extern  void    BX_unlock_stack_frame      (void);
extern	void	destroy_aliases		(int);
	Alias	*find_var_alias		(char *);
	void	delete_var_alias	(char *, int);
	char	*parse_line_with_return	(char *, char *, char *, int, int);
/*
 * This is the alias interface to the /STACK command.
 */
extern	void	do_stack_alias 		(int, char *, int);
	char	*BX_next_unit		(char *, const char *, int *, int);
	char	*BX_alias_special_char(char **buffer, char *ptr, const char *args, char *quote_em, int *args_flag);

#endif /* _ALIAS_H_ */

--- NEW FILE: irc_std.h ---
/*
 * irc_std.h: header to define things used in all the programs ircii
 * comes with
 *
 * hacked together from various other files by matthew green
 * copyright(c) 1993 
 *
 * See the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: irc_std.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __irc_std_h
#define __irc_std_h
#include "defs.h"

/*
 * Everybody needs these ANSI headers...
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>

/*
 * Everybody needs these POSIX headers...
 */
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <limits.h>
#include <sys/param.h>
#include <errno.h>

/*
 * Everybody needs these INET headers...
 */
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

/*
 * Deal with brokenness in <time.h> and <sys/time.h>
 */
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif

/*
 * Deal with brokenness in <fcntl.h> and <sys/fcntl.h>
 */
#ifdef HAVE_SYS_FCNTL_H
# include <sys/fcntl.h>
#else
# ifdef HAVE_FCNTL_H
#  include <fcntl.h>
# endif
#endif

/*
 * Deal with brokenness figuring out struct direct
 */
#if HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
#  include <sys/ndir.h>
# endif
# if HAVE_SYS_DIR_H
#  include <sys/dir.h>
# endif
# if HAVE_NDIR_H
#  include <ndir.h>
# endif
#endif

/*
 * First try to figure out if we can use GNU CC special features...
 */
#ifndef __GNUC__
# define __inline		/* delete gcc keyword */
# define __A(x)
# define __N
# define __inline__
#else
# if (__GNUC__ >= 2) && (__GNUC_MINOR__ >= 7)
#  define __A(x) __attribute__ ((format (printf, x, x + 1)))
#  define __N    __attribute__ ((noreturn))
# else
#  define __A(x)
#  define __N
#  define __inline
# endif
#endif

/*
 * Figure out how to make alloca work
 * I took this from the autoconf documentation
 */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H)
# define alloca __builtin_alloca
#else
# if HAVE_ALLOCA_H
#  include <alloca.h>
# else
#  ifdef _AIX
 #pragma alloca
#  else
#   ifndef alloca
char *alloca();
#   endif
#  endif
# endif
#endif

# include <errno.h>
#ifndef ERRNO_DECLARED
extern	int	errno;
#endif

#ifndef NBBY
# define NBBY		8			/* number of bits in a byte */
#endif /* NBBY */

#ifndef NFDBITS
# define NFDBITS	(sizeof(long) * NBBY)	/* bits per mask */
#endif /* NFDBITS */

#ifndef	FD_SETSIZE
#define FD_SETSIZE	256
#endif

#ifndef howmany
#define howmany(x, y)   (((x) + ((y) - 1)) / (y))
#endif

#ifdef HAVE_SYS_SYSLIMITS_H
# include <sys/syslimits.h>
#endif
   
#include <limits.h>
   
typedef RETSIGTYPE sigfunc (int);
sigfunc *my_signal (int, sigfunc *, int);

#define SIGNAL_HANDLER(x) \
	RETSIGTYPE x (int unused)

#include <stdlib.h>
#define index strchr

#ifndef MAXPATHLEN
#ifndef PATHSIZE
#define PATHSIZE 1024
#endif
#define MAXPATHLEN  PATHSIZE
#endif

/*
 * Dont trust anyone else's NULLs.
 */
#ifdef NULL
#undef NULL
#endif
#define NULL (void *) 0

#ifndef HAVE_STRERROR
#ifndef SYS_ERRLIST_DECLARED
extern  char    *sys_errlist[];
#endif
#define strerror(x) (char *)sys_errlist[x]
#endif

#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
extern	int	gettimeofday(struct timeval *tv, struct timezone *tz);
#endif

#ifndef STPCPY_DECLARED
char *  stpcpy (char *to, const char *from);
#endif

#ifndef GETPGID_DECLARED
pid_t	getpgid (pid_t pid);
#endif

#ifndef KILLPG_DECLARED
int	killpg (int pgrp, int sig);
#endif

#ifndef GETPASS_DECLARED
char *	getpass (const char * prompt);
#endif

#ifndef BCOPY_DECLARED
void	bcopy (const void *src, void *dest, size_t n);
#endif

#define BUILT_IN_COMMAND(x) \
	void x (char *command, char *args, char *subargs, char *helparg)

#define BUILT_IN_FUNCTION(x) \
	char * x (char *fn, char *input)

#if defined(_AIX)
int getpeername (int s, struct sockaddr *, int *);
int getsockname (int s, struct sockaddr *, int *);
int socket (int, int, int);
int bind (int, struct sockaddr *, int);
int listen (int, int);
int accept (int, struct sockaddr *, int *);
int recv (int, void *, int, unsigned int);
int send (int, void *, int, unsigned int);
int gettimeofday (struct timeval *, struct timezone *);
int gethostname (char *, int);
int setsockopt (int, int, int, void *, int);
int setitimer (int, struct itimerval *, struct itimerval *);
int ioctl (int, int, ...);
#endif

#ifdef __EMX__
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif

#define ltoa(a) my_ltoa(a)

/*
 * DCC specification requires exactly a 32 bit checksum.
 * Kind of lame, actually.
 */
#ifdef UNSIGNED_LONG32
  typedef		unsigned long		u_32int_t;
#else
# ifdef UNSIGNED_INT32
  typedef		unsigned int		u_32int_t;
# else
  typedef		unsigned long		u_32int_t;
# endif
#endif

#if defined(_SYS_SIGLIST_DECLARED) && !defined(SYS_SIGLIST_DECLARED)
#define sys_siglist _sys_siglist
#endif
#endif /* __irc_std_h */

--- NEW FILE: queue.h ---
/*
 * queue.h: header for queue.c
 *
 * copyright(c) 1994 matthew green
 *
 * See the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: queue.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __queue_h
# define __queue_h

	void	queuecmd (char *, char *, char *, char *);

#endif /* __queue_h */

--- NEW FILE: screen.h ---
/*
 * screen.h: header for screen.c
 *
 * written by matthew green.
 *
 * copyright (c) 1993, 1994.
 *
 * see the copyright file, or type help ircii copyright
 *
 * @(#)$Id: screen.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __screen_h_
#define __screen_h_

#include "window.h"

#define WAIT_PROMPT_LINE        0x01
#define WAIT_PROMPT_KEY         0x02
#define WAIT_PROMPT_DUMMY	0x04

/* Stuff for the screen/xterm junk */

#define ST_NOTHING      -1
#define ST_SCREEN       0
#define ST_XTERM        1

/* This is here because it happens in so many places */
#define curr_scr_win	current_screen->current_window

	void	clear_window (Window *);
	int	BX_output_line (const unsigned char *);
	Window	*BX_create_additional_screen (void);
	void	BX_scroll_window (Window *);
	void	update_all_windows (void);
	void	BX_add_wait_prompt (char *, void (*) (char *, char *), char *, int, int);
	void	BX_cursor_in_display (Window *);
	int	BX_is_cursor_in_display (Screen *);
	void	BX_cursor_not_in_display (Screen *);
	void	set_current_screen (Screen *);
	void	window_redirect (char *, int);
	void	redraw_resized (Window *, ShrinkInfo, int);
	void	close_all_screen (void);
RETSIGTYPE	sig_refresh_screen (int);
	int	check_screen_redirect (char *);
	void	BX_kill_screen (Screen *);
	int	rite (Window *, const unsigned char *);
	ShrinkInfo	resize_display (Window *);
	void	redraw_window (Window *, int);
	void	redraw_all_windows (void);
	void	BX_add_to_screen (unsigned char *);
	void	do_screens (fd_set *);
	unsigned	char	**BX_split_up_line(const unsigned char *, int);
	void	BX_xterm_settitle(void);
	void	BX_add_to_window(Window *, const unsigned char *);
	
Screen  * BX_create_new_screen(void);

#ifdef GUI
	void	refresh_window_screen(Window *);
#endif
			
	u_char *BX_strip_ansi		(const u_char *);
	char   *normalize_color		(int, int, int, int);
const	u_char *BX_skip_ctl_c_seq		(const u_char *, int *, int *, int);
	u_char **BX_prepare_display	(const u_char *, int, int *, int);
	int	BX_output_with_count	(const unsigned char *, int, int);
unsigned char	*BX_skip_incoming_mirc	(unsigned char *);
void delchar(unsigned char **text, int cnum);

/* Dont do any word-wrapping, just truncate each line at its place. */
#define PREPARE_NOWRAP	0x01

extern	Screen	*main_screen;
extern	Screen	*last_input_screen;
extern	Screen	*screen_list;
extern	Screen	*output_screen;
extern  Window	*debugging_window;

extern	int	strip_ansi_never_xlate;

#endif /* __screen_h_ */

--- NEW FILE: names.h ---
/*
 * names.h: Header for names.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: names.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __names_h_
#define __names_h_

#include "window.h"
#include "irc.h"

/* for lookup_channel() */
#define	CHAN_NOUNLINK	1
#define CHAN_UNLINK	2

#define	GOTNAMES	0x01
#define	GOTMODE		0x02
#define GOTBANS		0x04
#define GOTWHO		0x08
#define	GOTEXEMPT	0x10

void		add_to_join_list (char *, int, int);
void		remove_from_join_list (char *, int);
char		*get_chan_from_join_list (int);
int		get_win_from_join_list (char *, int);
int		in_join_list (char *, int);
int		got_info (char *, int, int);
	
int		is_channel_mode (char *, int, int);
int		BX_is_chanop (char *, char *);
char		*is_chanoper (char *, char *);
ChannelList	*BX_lookup_channel (char *, int, int);
char		*BX_get_channel_mode (char *, int);
#ifdef	INCLUDE_UNUSED_FUNCTIONS
void		set_channel_mode (char *, int, char *);
#endif /* INCLUDE_UNUSED_FUNCTIONS */
ChannelList *	BX_add_channel (char *, int, int);
ChannelList *	BX_add_to_channel (char *, char *, int, int, int, char *, char *, char *, int, int);
void		BX_remove_channel (char *, int);
void		BX_remove_from_channel (char *, char *, int, int, char *);
int		BX_is_on_channel (char *, int, char *);
void		list_channels (void);
void		reconnect_all_channels (int);
void		switch_channels (char, char *);
char		*what_channel (char *, int);
char		*walk_channels (char *, int, int);
char		*real_channel (void);
void		BX_rename_nick (char *, char *, int);
void		update_channel_mode (char *, char *, int, char *, ChannelList *);
void		set_channel_window (Window *, char *, int);
char		*BX_create_channel_list (Window *);
int		BX_get_channel_oper (char *, int);
int		BX_get_channel_halfop (char *, int);
void		channel_server_delete (int);
void		change_server_channels (int, int);
void		clear_channel_list (int);
void		set_waiting_channel (int);
void		remove_from_mode_list (char *, int);
int		chan_is_connected (char *, int);
int		BX_im_on_channel (char *, int);
char		*BX_recreate_mode (ChannelList *);	
int		BX_get_channel_voice (char *, int);
char		*BX_get_channel_key(char *, int);
char		*BX_fetch_userhost (int, char *);
void		unset_window_current_channel (Window *);
void		move_window_channels (Window *);
void		reassign_window_channels (Window *);
void		check_channel_limits();
void		BX_clear_bans(ChannelList *);
char		*BX_compress_modes(ChannelList *, int, char *, char*);
int		BX_got_ops(int, ChannelList *);
void		BX_flush_channel_stats (void);
char		*BX_get_channel_bans(char *, int, int);

#endif /* __names_h_ */

--- NEW FILE: module.h ---
/*
 * Module/dll handling code written by Colten Edwards.
 * Copyright 1997
 */
 
#ifndef _MODULE_H
#define _MODULE_H


/*
 * if we change the table below, we change this module number to the 
 * current date.
 */
#define MODULE_VERSION 011000

#include "struct.h"

typedef int (*Function_ptr)();

#ifdef WANT_DLL
#ifdef HPUX
#include <dl.h>
#endif

#define COMMAND_PROC	0x0001		/* New /command proc return void */
#define ALIAS_PROC	0x0002		/* new $alias proc return new_malloc'd string */
#define CTCP_PROC	0x0004		/* new ctcp proc return new_malloc'd string*/
#define VAR_PROC	0x0008		/* new variable no return */
#define HOOK_PROC	0x0010		/* new numeric proc 
					 * return int 1 if we don't want client
					 * to also handle this.
					 * or 0  if we want client to handle
					 */
#define RAW_PROC	0x0020		/* new raw irc proc */
#define DCC_PROC	0x0040		/* add to dcc command list */
#define OUTPUT_PROC	0x0080		/* New output proc for all windows. */
#define WINDOW_PROC	0x0100		/* New window proc */
#define TABLE_PROC	0x8000		/* removing a global_table proc */

#define INVALID_MODVERSION -1

typedef int (Irc_PackageInitProc)  (IrcCommandDll **, Function_ptr *);
typedef char *(Irc_PackageVersionProc)  (IrcCommandDll **);

typedef struct _function_table 
{
	char	*name;
	char	*desc;
	int	id;
	int	flag;
	void	*func1;
	void	*func2;
} Function;

typedef struct _package_installed {
	struct _package_installed *next;
	char    *name;
	char    *version;

	int	major;
	int	minor;
	int	lock;

#if defined(HPUX)
	shl_t handle;
#elif defined(__EMX__)
	HMODULE handle;
#elif defined(WINNT)
	HINSTANCE handle;
#else
	void	*handle;
#endif
	Irc_PackageInitProc *cleanup;
} Packages;
                                
Packages *find_module (char *);
int BX_add_module_proc (unsigned int, char *, char *, char *, int, int, void *, void *);
int remove_package (char *);
int BX_remove_module_proc (unsigned int, char *, char *, char *);
int add_module(unsigned int, Function *, char *);

extern BuiltInDllFunctions *dll_functions;
#ifndef __hook_c
extern NumericFunction *dll_numeric_list;
#endif
extern IrcCommandDll *dll_commands;
extern CtcpEntryDll *dll_ctcp;
extern WindowDll *dll_window;
extern IrcVariableDll *dll_variable;


char *BX_get_dllstring_var(char *);
int BX_get_dllint_var(char *);
void BX_set_dllstring_var(char *, char *);
void BX_set_dllint_var(char *, unsigned int);
RawDll *find_raw_proc(char *, char **);

int check_version(unsigned long);
#endif /* WANT_DLL */

/* 
 * the order of this enum is extremely important. ie a module compiled
 * on a differant order would fail miserably. So when adding to the list
 * make sure and add to the end of the list.
 */
 
enum FUNCTION_VALUE
{
/* ircaux.c */
	MODULE_VERSION_CHECK,
/* output.c */	
	PUT_IT,
	BITCHSAY,
	YELL,
	ADD_TO_LOG,
	VSNPRINTF,
	SNPRINTF,
	NEW_MALLOC,
	NEW_FREE,
	NEW_REALLOC,
	MALLOC_STRCPY,
	MALLOC_STRCAT,
	MALLOC_STR2CPY,
	M_3DUP,
	M_OPENDUP,
	M_S3CAT,
	M_S3CAT_S,
	M_3CAT,
	UPPER,
	LOWER,
	STRISTR,
	RSTRISTR,
	WORD_COUNT,
	REMOVE_TRAILING_SPACES,
	MY_STRICMP,
	MY_STRNICMP,
	MY_STRNSTR,
	CHOP,
	STRMCPY,
	STRMCAT,
	SCANSTR,
	EXPAND_TWIDDLE,
	CHECK_NICKNAME,
	SINDEX,
	RSINDEX,
	ISNUMBER,
	RFGETS,
	PATH_SEARCH,
	DOUBLE_QUOTE,
	IRCPANIC,
	END_STRCMP,
	BEEP_EM,
	UZFOPEN,
	FUNC_GET_TIME,
	TIME_DIFF,
	TIME_TO_NEXT_MINUTE,
	PLURAL,
	MY_CTIME,
	LTOA,
	STRFORMAT,
	MATCHINGBRACKET,
	PARSE_NUMBER,
	SPLITW,
	UNSPLITW,
	M_2DUP,
	M_E3CAT,
	CHECK_VAL,
	ON_OFF,
	STREXTEND,
	STRFILL,
	EMPTY_FUNC,
	REMOVE_BRACKETS,
	MY_ATOL,
	M_DUPCHAR,
	STREQ,
	STRIEQ,
	STRMOPENCAT,
	OV_STRCPY,
	STRIP_CONTROL,
	FIGURE_OUT_ADDRESS,
	STRNRCHR,
	MASK_DIGITS,
	CCSPAN,
	CHARCOUNT,
	STRPCAT,
	STRCPY_NOCOLORCODES,
	CRYPTIT,
	STRIPDEV,
	MANGLE_LINE,
	M_STRDUP,
	M_STRCAT_UES,
	M_STRNDUP,
	MALLOC_SPRINTF,
	M_SPRINTF,
	NEXT_ARG,
	NEW_NEXT_ARG,
	NEW_NEW_NEXT_ARG,
	LAST_ARG,
	NEXT_IN_COMMA_LIST,
	RANDOM_NUMBER,
	
/* words.c */
	SEARCH,
	MOVE_TO_ABS_WORD,
	MOVE_WORD_REL,
	EXTRACT,
	EXTRACT2,
	WILD_MATCH,
/* network */
	CONNECT_BY_NUMBER,
	RESOLV,
	LOOKUP_HOST,
	LOOKUP_IP,
	HOST_TO_IP,
	IP_TO_HOST,
	ONE_TO_ANOTHER,
	SET_BLOCKING,
	SET_NON_BLOCKING,

/* list.c */
	ADD_TO_LIST,
	ADD_TO_LIST_EXT,
	REMOVE_FROM_LIST_,
	REMOVE_FROM_LIST_EXT,
	REMOVEWILD_FROM_LIST,
	LIST_LOOKUP,
	LIST_LOOKUP_EXT,
	FIND_IN_LIST,
	FIND_IN_LIST_EXT,
/* alist.c */
	ADD_TO_ARRAY,
	REMOVE_FROM_ARRAY,
	ARRAY_POP,
	REMOVE_ALL_FROM_ARRAY,
	ARRAY_LOOKUP,
	FIND_ARRAY_ITEM,
	FIND_FIXED_ARRAY_ITEM,
	
/* server.c */
	SEND_TO_SERVER,
	QUEUE_SEND_TO_SERVER,
	MY_SEND_TO_SERVER,
/* connecting to the server */
	GET_CONNECTED,
	CONNECT_TO_SERVER_BY_REFNUM,
	CLOSE_SERVER,
	IS_SERVER_CONNECTED,
	FLUSH_SERVER,
	SERVER_IS_CONNECTED,
	IS_SERVER_OPEN,
	CLOSE_ALL_SERVER,
/* server file reading */
	READ_SERVER_FILE,
	ADD_TO_SERVER_LIST,
	BUILD_SERVER_LIST,
	DISPLAY_SERVER_LIST,
	CREATE_SERVER_LIST,
	PARSE_SERVER_INFO,
	SERVER_LIST_SIZE,
/* misc server/nickname functions */
	FIND_SERVER_REFNUM,
	FIND_IN_SERVER_LIST,
	PARSE_SERVER_INDEX,
	SET_SERVER_REDIRECT,
	GET_SERVER_REDIRECT,
	CHECK_SERVER_REDIRECT,
	FUDGE_NICKNAME,
	RESET_NICKNAME,
/* various set server struct functions */
	SET_SERVER_COOKIE,
	SET_SERVER_FLAG,
	SET_SERVER_MOTD,
	SET_SERVER_OPERATOR,
	SET_SERVER_ITSNAME,
	SET_SERVER_VERSION,
	SET_SERVER_LAG,
	SET_SERVER_PASSWORD,
	SET_SERVER_NICKNAME,
	SET_SERVER2_8,
	SET_SERVER_AWAY,
/* various get server struct functions */
	GET_SERVER_COOKIE,
	GET_SERVER_NICKNAME,
	GET_SERVER_NAME,
	GET_SERVER_ITSNAME,
	GET_SERVER_MOTD,
	GET_SERVER_OPERATOR,
	GET_SERVER_VERSION,
	GET_SERVER_FLAG,
	GET_POSSIBLE_UMODES,
	GET_SERVER_PORT,
	GET_SERVER_LAG,
	GET_SERVER2_8,
	GET_UMODE,
	GET_SERVER_AWAY,
	GET_SERVER_NETWORK,
	GET_PENDING_NICKNAME,
	SERVER_DISCONNECT,

	GET_SERVER_LIST,
	GET_SERVER_CHANNELS,

	SET_SERVER_LAST_CTCP_TIME,
	GET_SERVER_LAST_CTCP_TIME,
	SET_SERVER_TRACE_FLAG,
	GET_SERVER_TRACE_FLAG,
	GET_SERVER_READ,
	GET_SERVER_LINKLOOK,
	SET_SERVER_LINKLOOK,
	GET_SERVER_LINKLOOK_TIME,
	SET_SERVER_LINKLOOK_TIME,
	GET_SERVER_TRACE_KILL,
	SET_SERVER_TRACE_KILL,
	ADD_SERVER_CHANNELS,
	SET_SERVER_CHANNELS,
	SEND_MSG_TO_CHANNELS,
	SEND_MSG_TO_NICKS,
	IS_SERVER_QUEUE,
/* glob.c */
	BSD_GLOB,
	BSD_GLOBFREE,			
	
	CONVERT_OUTPUT_FORMAT,
	UPDATE_CLOCK,
	BREAKARGS,
	PASTEARGS,
	USERAGE,
	SEND_TEXT,
	SET_LASTLOG_MSG_LEVEL,
	SPLIT_CTCP,
	RANDOM_STR,
	DCC_PRINTF,

	MY_ENCRYPT,
	MY_DECRYPT,
	PREPARE_COMMAND,
	BUILD_STATUS,
	FUNC_LOAD,

	HOOK,
/* irc.c */
	IRC_IO_FUNC,
	IRC_EXIT_FUNC,
/* alias.c */
	LOCK_STACK_FRAME,
	UNLOCK_STACK_FRAME,
	
	
/* input.c */
	FUNC_UPDATE_INPUT,
	CURSOR_TO_INPUT,
	SET_INPUT,
	GET_INPUT,
	SET_INPUT_PROMPT,
	GET_INPUT_PROMPT,
	ADDTABKEY,
	GETTABKEY,
	GETNEXTNICK,
	GETCHANNICK,
	LOOKUP_NICKCOMPLETION,
	ADD_COMPLETION_TYPE,
		
/* module.c */
	ADD_MODULE_PROC,
	REMOVE_MODULE_PROC,
/* names.c */	
	IS_CHANOP,
	IS_CHANNEL,
	MAKE_CHANNEL,
	IM_ON_CHANNEL,
	IS_ON_CHANNEL,
	ADD_CHANNEL,
	ADD_TO_CHANNEL,
	GET_CHANNEL_KEY,
	FUNC_RECREATE_MODE,
	FUNC_COMPRESS_MODES,
	FUNC_GOT_OPS,
	GET_CHANNEL_BANS,
	GET_CHANNEL_MODE,
	CLEAR_BANS,
	REMOVE_CHANNEL,
	REMOVE_FROM_CHANNEL,
	RENAME_NICK,
	GET_CHANNEL_OPER,
	GET_CHANNEL_HALFOP,
	FETCH_USERHOST,
	GET_CHANNEL_VOICE,
	CREATE_CHANNEL_LIST,
	FLUSH_CHANNEL_STATS,
	LOOKUP_CHANNEL,
		
	FIND_NICKLIST_IN_CHANNELLIST,
	ADD_NICKLIST_TO_CHANNELLIST,
	NEXT_NICKLIST,

	NEXT_NAMELIST,
	ADD_NAME_TO_GENERICLIST,
	FIND_NAME_IN_GENERICLIST,
	ADD_WHOWAS_USERHOST_CHANNEL,
	FIND_USERHOST_CHANNEL,
	NEXT_USERHOST,
	SORTED_NICKLIST,
	CLEAR_SORTED_NICKLIST,
	ADD_NAME_TO_FLOODLIST,
	FIND_NAME_IN_FLOODLIST,
	CLEAR_WHOWAS_HASH_TABLE,
	REMOVE_OLDEST_WHOWAS_HASHLIST,
	
		
/* cset.c fset.c vars.c */	
	FGET_STRING_VAR,
	FSET_STRING_VAR,
	GET_WSET_STRING_VAR,
	SET_WSET_STRING_VAR,
	SET_CSET_INT_VAR,
	GET_CSET_INT_VAR,
	SET_CSET_STR_VAR,
	GET_CSET_STR_VAR,
	GET_DLLINT_VAR,
	SET_DLLINT_VAR,
	GET_DLLSTRING_VAR,
	SET_DLLSTRING_VAR,
	GET_INT_VAR,
	SET_INT_VAR,
	GET_STRING_VAR,
	SET_STRING_VAR,

	ADD_TIMER,
	DELETE_TIMER,
	DELETE_ALL_TIMERS,

/* sockets from misc.c */
	ADD_SOCKETREAD,
	ADD_SOCKETTIMEOUT,
	CLOSE_SOCKETREAD,
	GET_SOCKET,
	SET_SOCKETFLAGS,
	GET_SOCKETFLAGS,
	GET_SOCKETINFO,
	SET_SOCKETINFO,
	SET_SOCKETWRITE,
	CHECK_SOCKET,
	READ_SOCKETS,
	WRITE_SOCKETS,
	GET_MAX_FD,
	NEW_CLOSE,
	NEW_OPEN,	
	DGETS,


/* screen.c */
	PREPARE_DISPLAY,
	ADD_TO_WINDOW,
	SKIP_INCOMING_MIRC,
	ADD_TO_SCREEN,
	SPLIT_UP_LINE,
	OUTPUT_LINE,
	OUTPUT_WITH_COUNT,
	SCROLL_WINDOW,
	CURSOR_NOT_IN_DISPLAY,
	CURSOR_IN_DISPLAY,
	IS_CURSOR_IN_DISPLAY,
	REPAINT_WINDOW,
	CREATE_NEW_SCREEN,
	CREATE_ADDITIONAL_SCREEN,
	KILL_SCREEN,
	XTERM_SETTITLE,
	ADD_WAIT_PROMPT,
	SKIP_CTL_C_SEQ,
	STRIP_ANSI,

/* window.c */
	FREE_FORMATS,
	REMOVE_WINDOW_FROM_SCREEN,
	SET_SCREENS_CURRENT_WINDOW,
	NEW_WINDOW,
	DELETE_WINDOW,
	TRAVERSE_ALL_WINDOWS,
	ADD_TO_INVISIBLE_LIST,
	ADD_TO_WINDOW_LIST,
	RECALCULATE_WINDOW_POSITIONS,
	MOVE_WINDOW,
	RESIZE_WINDOW,
	REDRAW_ALL_WINDOWS,
	REBALANCE_WINDOWS,
	RECALCULATE_WINDOWS,
	UPDATE_ALL_WINDOWS,
	GOTO_WINDOW,
	HIDE_BX_WINDOW,
	FUNC_SWAP_LAST_WINDOW,
	FUNC_SWAP_NEXT_WINDOW,
	FUNC_SWAP_PREVIOUS_WINDOW,
	SHOW_WINDOW,
	GET_STATUS_BY_REFNUM,
	GET_WINDOW_BY_DESC,
	GET_WINDOW_BY_REFNUM,
	GET_VISIBLE_BY_REFNUM,
	GET_WINDOW_BY_NAME,
	FUNC_NEXT_WINDOW,
	FUNC_PREVIOUS_WINDOW,
	UPDATE_WINDOW_STATUS,
	UPDATE_ALL_STATUS,
	UPDATE_WINDOW_STATUS_ALL,
	STATUS_UPDATE,
	SET_PROMPT_BY_REFNUM,
	GET_PROMPT_BY_REFNUM,
	QUERY_NICK,
	QUERY_HOST,
	QUERY_CMD,
	GET_TARGET_BY_REFNUM,
	GET_TARGET_CMD_BY_REFNUM,
	GET_WINDOW_TARGET_BY_DESC,
	IS_CURRENT_CHANNEL,
	SET_CURRENT_CHANNEL_BY_REFNUM,
	GET_CURRENT_CHANNEL_BY_REFNUM,
	GET_REFNUM_BY_WINDOW,
	IS_BOUND_TO_WINDOW,
	GET_WINDOW_BOUND_CHANNEL,
	IS_BOUND_ANYWHERE,
	IS_BOUND,
	UNBIND_CHANNEL,
	GET_BOUND_CHANNEL,
	GET_WINDOW_SERVER,
	SET_WINDOW_SERVER,
	WINDOW_CHECK_SERVERS,
	CHANGE_WINDOW_SERVER,
	SET_LEVEL_BY_REFNUM,
	SET_SERVER_STAT_FLAG,
	GET_SERVER_STAT_FLAG,
	MESSAGE_TO,
	CLEAR_WINDOW,
	CLEAR_ALL_WINDOWS,
	CLEAR_WINDOW_BY_REFNUM,
	UNCLEAR_WINDOW_BY_REFNUM,
	SET_SCROLL_LINES,
	SET_CONTINUED_LINES,
	CURRENT_REFNUM,
	NUMBER_OF_WINDOWS_ON_SCREEN,
	SET_SCROLLBACK_SIZE,
	IS_WINDOW_NAME_UNIQUE,
	GET_NICKLIST_BY_WINDOW,
	SCROLLBACK_BACKWARDS_LINES,
	SCROLLBACK_FORWARDS_LINES,
	SCROLLBACK_FORWARDS,
	SCROLLBACK_BACKWARDS,
	SCROLLBACK_END,
	SCROLLBACK_START,
	HOLD_MODE,
	UNHOLD_WINDOWS,
	FUNC_UNSTOP_ALL_WINDOWS,
	RESET_LINE_CNT,
	FUNC_TOGGLE_STOP_SCREEN,
	FLUSH_EVERYTHING_BEING_HELD,
	UNHOLD_A_WINDOW,
	RECALCULATE_WINDOW_CURSOR,
	MAKE_WINDOW_CURRENT,
	CLEAR_SCROLLBACK,
	SET_DISPLAY_TARGET,
	RESET_DISPLAY_TARGET,
	RESTORE_DISPLAY_TARGET,
	SAVE_DISPLAY_TARGET,
	
	IS_OTHER_FLOOD,
	CHECK_FLOODING,
	FLOOD_PROT,	
/* expr.c */
	
	NEXT_UNIT,
	EXPAND_ALIAS,
	PARSE_INLINE,
	ALIAS_SPECIAL_CHAR,
	PARSE_LINE,
	PARSE_COMMAND_FUNC,
	MAKE_LOCAL_STACK,
	DESTROY_LOCAL_STACK,
	
/* dcc.c */
	DCC_CREATE_FUNC,
	FIND_DCC_FUNC,
	ERASE_DCC_INFO,	
	ADD_DCC_BIND,
	REMOVE_DCC_BIND,
	REMOVE_ALL_DCC_BINDS,
	GET_ACTIVE_COUNT,
	GET_NUM_QUEUE,
	ADD_TO_QUEUE,
	DCC_FILESEND,
	DCC_RESEND,
		
/* who.c */
	WHOBASE,
	ISONBASE,
	USERHOSTBASE,

	FIND_COMMAND_FUNC,
			

	NICKNAME,
	IRC_VERSION,
	FROM_SERVER,
	CONNECTED_TO_SERVER,
	PRIMARY_SERVER,
	PARSING_SERVER_INDEX,
	NOW,
	START_TIME,
	IDLE_TIME,

	LOADING_GLOBAL,
	TARGET_WINDOW,
	CURRENT_WINDOW,
	INVISIBLE_LIST,
	
	MAIN_SCREEN,
	LAST_INPUT_SCREEN,
	OUTPUT_SCREEN,
	SCREEN_LIST,
	IRCLOG_FP,
	DOING_NOTICE,
	LAST_SENT_MSG_BODY,
	SENT_NICK,

	DLL_FUNCTIONS,
	DLL_NUMERIC,
	DLL_COMMANDS,
	DLL_VARIABLE,
	DLL_CTCP,
	DLL_WINDOW,
	WINDOW_DISPLAY,
	STATUS_UPDATE_FLAG,
	TABKEY_ARRAY,
	AUTOREPLY_ARRAY,
	IDENTD_SOCKET,
				
	VAR_TCL_INTERP,
        LASTCLICKLINEDATA,
        CONTEXTX,
        CONTEXTY,
        GUIIPC,
	GUI_MUTEX_LOCK,
	GUI_MUTEX_UNLOCK,
	
/* input output functions */
	SERV_OPEN_FUNC,
	SERV_INPUT_FUNC,
	SERV_OUTPUT_FUNC,
	SERV_CLOSE_FUNC,
	CHECK_EXT_MAIL_STATUS,
	CHECK_EXT_MAIL,
	DEFAULT_OUTPUT_FUNCTION,
	DEFAULT_STATUS_OUTPUT_FUNCTION,
	NUMBER_OF_GLOBAL_FUNCTIONS
};

extern Function_ptr global_table[];
extern IrcCommand irc_command[];

#endif

--- NEW FILE: winbitchx.h ---

#ifndef WIN_BitchX_h
#define WIN_BitchX_h

#include <windows.h>

/* prototypes */
void VTActivate();
void ChangeTitle();
void SwitchMenu();
void SwitchTitleBar();
void OpenHelp(HWND HWin, UINT Command, DWORD Data);
void ResetTerminal();
void ResetCharSet();
void HideStatusLine();
void ChangeTerminalSize(int Nx, int Ny);
int VTParse();

void EnableDlgItem(HWND HDlg, int FirstId, int LastId);
void DisableDlgItem(HWND HDlg, int FirstId, int LastId);
void ShowDlgItem(HWND HDlg, int FirstId, int LastId);
void SetRB(HWND HDlg, int R, int FirstId, int LastId);
void GetRB(HWND HDlg, LPWORD R, int FirstId, int LastId);
void SetDlgNum(HWND HDlg, int id_Item, LONG Num);
void SetDlgPercent(HWND HDlg, int id_Item, LONG a, LONG b);
/*void SetDropDownList(HWND HDlg, int Id_Item, PCHAR far *List, int nsel);*/
LONG GetCurSel(HWND HDlg, int Id_Item);

void InitDisp();
void EndDisp();
void DispReset();
void DispConvWinToScreen
  (int Xw, int Yw, int *Xs, int *Ys, LPBOOL Right);
void SetLogFont();
void ChangeFont();
void ResetIME();
void ChangeCaret();
void CaretOn();
void CaretOff();
void DispDestroyCaret();
BOOL IsCaretOn();
void DispEnableCaret(BOOL On);
BOOL IsCaretEnabled();
void DispSetCaretWidth(BOOL DW);
void DispChangeWinSize(int Nx, int Ny);
void ResizeWindow(int x, int y, int w, int h, int cw, int ch);
void PaintWindow(HDC PaintDC, RECT PaintRect, BOOL fBkGnd,
		 int* Xs, int* Ys, int* Xe, int* Ye);
void DispEndPaint();
void DispClearWin();
void DispChangeBackground();
void DispChangeWin();
void DispInitDC();
void DispReleaseDC();
void DispSetupDC(BYTE Attr, BYTE Attr2, BOOL Reverse);
void DispStr(PCHAR Buff, int Count, int Y, int* X);
void DispEraseCurToEnd(int YEnd);
void DispEraseHomeToCur(int YHome);
void DispEraseCharsInLine(int XStart, int Count);
BOOL DispDeleteLines(int Count, int YEnd);
BOOL DispInsertLines(int Count, int YEnd);
BOOL IsLineVisible(int* X, int* Y);
void AdjustScrollBar();
void DispScrollToCursor(int CurX, int CurY);
void DispScrollNLines(int Top, int Bottom, int Direction);
void DispCountScroll();
void DispUpdateScroll();
void DispScrollHomePos();
void DispAutoScroll(POINT p);
void DispHScroll(int Func, int Pos);
void DispVScroll(int Func, int Pos);
void DispSetupFontDlg();
void DispRestoreWinSize();
void DispSetWinPos();
void DispSetActive(BOOL ActiveFlag);

  /* Character attribute bit masks */
#define AttrDefault 0x00
#define AttrDefault2 0x00
#define AttrBold 0x01
#define AttrUnder 0x02
#define AttrSpecial 0x04
#define AttrFontMask 0x07
#define AttrBlink 0x08
#define AttrReverse 0x10
#define AttrKanji 0x80

extern int WinWidth, WinHeight;
extern HFONT VTFont[AttrFontMask+1];
extern int FontHeight, FontWidth, ScreenWidth, ScreenHeight;
extern BOOL AdjustSize, DontChangeSize;
extern int CursorX, CursorY;
extern int WinOrgX, WinOrgY, NewOrgX, NewOrgY;
extern int NumOfLines, NumOfColumns;
extern int PageStart, BuffEnd;

#define SCROLL_BOTTOM	1
#define SCROLL_LINEDOWN	2
#define SCROLL_LINEUP	3
#define SCROLL_PAGEDOWN	4
#define SCROLL_PAGEUP	5
#define SCROLL_POS	6
#define SCROLL_TOP	7

  /* Parsing modes */
#define ModeFirst 0
#define ModeESC   1
#define ModeDCS   2
#define ModeDCUserKey 3
#define ModeSOS   4
#define ModeCSI   5
#define ModeXS	  6
#define ModeDLE   7
#define ModeCAN   8

extern HWND HVTWin;
extern HWND HTEKWin;
extern int ActiveWin; /* IdVT, IdTEK */
extern int TalkStatus; /* IdTalkKeyb, IdTalkCB, IdTalkTextFile */
extern BOOL KeybEnabled; /* keyboard switch */
extern BOOL Connecting;

/* 'help' button on dialog box */
extern WORD MsgDlgHelp;
extern LONG HelpId;

/*extern TTTSet ts;
extern TComVar cv;*/

/* pointers to window objects */
extern void* pVTWin;
extern void* pTEKWin;
/* instance handle */
extern HINSTANCE hInst;

extern int SerialNo;

#define IdBreakTimer 1
#define IdDelayTimer 2
#define IdProtoTimer 3
#define IdDblClkTimer 4
#define IdScrollTimer 5
#define IdComEndTimer 6
#define IdCaretTimer 7
#define IdPrnStartTimer 8
#define IdPrnProcTimer 9

  /* Window Id */
#define IdVT 1
#define IdTEK 2

  /* Talker mode */
#define IdTalkKeyb 0
#define IdTalkCB 1
#define IdTalkFile 2
#define IdTalkQuiet 3

  /* Character sets */
#define IdASCII 0
#define IdKatakana 1
#define IdKanji 2
#define IdSpecial 3

  /* Color attribute bit masks */
#define Attr2Fore 0x08
#define Attr2ForeMask 0x07
#define Attr2Back 0x80
#define Attr2BackMask 0x70
#define SftAttrBack 4

  /* Color codes */
#define IdBack   0
#define IdRed    1
#define IdGreen  2
#define IdYellow 3
#define IdBlue   4
#define IdMagenta 5
#define IdCyan   6
#define IdFore   7

  /* Kermit function id */
#define IdKmtReceive 1
#define IdKmtGet 2
#define IdKmtSend 3
#define IdKmtFinish 4

  /* XMODEM function id */
#define IdXReceive 1
#define IdXSend 2

  /* ZMODEM function id */
#define IdZReceive 1
#define IdZSend 2
#define IdZAuto 3

  /* B-Plus function id */
#define IdBPReceive 1
#define IdBPSend 2
#define IdBPAuto 3

  /* Quick-VAN function id */
#define IdQVReceive 1
#define IdQVSend 2

#define HostNameMaxLength 80

  /* internal WM_USER messages */
#define WM_USER_ACCELCOMMAND WM_USER+1
#define WM_USER_CHANGEMENU WM_USER+2
#define WM_USER_CLOSEIME WM_USER+3
#ifdef TERATERM32
#define WM_USER_COMMNOTIFY WM_USER+4
#else
#define WM_USER_COMMNOTIFY WM_COMMNOTIFY
#endif
#define WM_USER_COMMOPEN WM_USER+5
#define WM_USER_COMMSTART WM_USER+6
#define WM_USER_DLGHELP2 WM_USER+7
#define WM_USER_GETHOST WM_USER+8
#define WM_USER_FTCANCEL WM_USER+9
#define WM_USER_PROTOCANCEL WM_USER+10
#define WM_USER_CHANGETBAR WM_USER+11
#define WM_USER_KEYCODE WM_USER+12
#define WM_USER_GETSERIALNO WM_USER+13

#define WM_USER_DDEREADY WM_USER+21
#define WM_USER_DDECMNDEND WM_USER+22
#define WM_USER_DDECOMREADY WM_USER+23
#define WM_USER_DDEEND WM_USER+24

  /* port type ID */
#define IdTCPIP 1
#define IdSerial 2
#define IdFile  3

  /* XMODEM option */
#define XoptCheck 1
#define XoptCRC  2
#define Xopt1K   3

  /* Language */
#define IdEnglish 1
#define IdJapanese 2
#define IdRussian 3

// log flags (used in ts.LogFlag) 
#define LOG_TEL	1
#define LOG_KMT	2
#define LOG_X	4
#define LOG_Z	8
#define LOG_BP	16
#define LOG_QV	32

// file transfer flags (used in ts.FTFlag)
#define FT_ZESCCTL	1
#define FT_ZAUTO	2
#define FT_BPESCCTL	4
#define FT_BPAUTO	8
#define FT_RENAME	16

// menu flags (used in ts.MenuFlag)
#define MF_NOSHOWMENU	1
#define MF_NOPOPUP		2
#define MF_NOLANGUAGE	4
#define MF_SHOWWINMENU  8

// Terminal flags (used in ts.TermFlag)
#define TF_FIXEDJIS	1
#define TF_AUTOINVOKE	2
#define TF_CTRLINKANJI	8
#define TF_ALLOWWRONGSEQUENCE 16
#define TF_ACCEPT8BITCTRL 32
#define TF_ENABLESLINE	64
#define TF_BACKWRAP	128

// ANSI color flags (used in ts.ColorFlag)
#define CF_FULLCOLOR	1
#define CF_USETEXTCOLOR 2

// port flags (used in ts.PortFlag)
#define PF_CONFIRMDISCONN 1
#define PF_BEEPONCONNECT  2

#define IdCR   1
#define IdCRLF 2

  /* Terminal ID */
#define IdVT100 1
#define IdVT100J 2
#define IdVT101 3
#define IdVT102 4
#define IdVT102J 5
#define IdVT220J 6
#define IdVT282 7
#define IdVT320 8
#define IdVT382 9

  /* Kanji Code ID */
#define IdSJIS 1
#define IdEUC 2
#define IdJIS 3

// Russian code sets
#define IdWindows	1
#define IdKOI8		2
#define Id866		3
#define IdISO		4

  /* KanjiIn modes */
#define IdKanjiInA 1
#define IdKanjiInB 2
  /* KanjiOut modes */
#define IdKanjiOutB 1
#define IdKanjiOutJ 2
#define IdKanjiOutH 3

#define TermWidthMax 300
#define TermHeightMax 200

  /* Cursor shapes */
#define IdBlkCur 1
#define IdVCur 2
#define IdHCur 3

#define IdBS 1
#define IdDEL 2

  /* Serial port ID */
#define IdCOM1 1
#define IdCOM2 2
#define IdCOM3 3
#define IdCOM4 4
  /* Baud rate ID */
#define IdBaud110 1
#define IdBaud300 2
#define IdBaud600 3
#define IdBaud1200 4
#define IdBaud2400 5
#define IdBaud4800 6
#define IdBaud9600 7
#define IdBaud14400 8
#define IdBaud19200 9
#define IdBaud38400 10
#define IdBaud57600 11
#define IdBaud115200 12

  /* Parity ID */
#define IdParityEven 1
#define IdParityOdd 2
#define IdParityNone 3
  /* Data bit ID */
#define IdDataBit7 1
#define IdDataBit8 2
  /* Stop bit ID */
#define IdStopBit1 1
#define IdStopBit2 2
  /* Flow control ID */
#define IdFlowX 1
#define IdFlowHard 2
#define IdFlowNone 3

/* GetHoerm internal key codes */
#define IdUp     1
#define IdDown   2
#define IdRight  3
#define IdLeft   4
#define Id0      5
#define Id1      6
#define Id2      7
#define Id3      8
#define Id4      9
#define Id5     10
#define Id6     11
#define Id7     12
#define Id8     13
#define Id9     14
#define IdMinus 15
#define IdComma 16
#define IdPeriod 17
#define IdEnter 18
#define IdPF1   19
#define IdPF2   20
#define IdPF3   21
#define IdPF4   22
#define IdFind  23
#define IdInsert 24
#define IdRemove 25
#define IdSelect 26
#define IdPrev  27
#define IdNext  28
#define IdHold  29
#define IdPrint 30
#define IdBreak 31
#define IdF6    32
#define IdF7    33
#define IdF8    34
#define IdF9    35
#define IdF10   36
#define IdF11   37
#define IdF12   38
#define IdF13   39
#define IdF14   40
#define IdHelp  41
#define IdDo    42
#define IdF17   43
#define IdF18   44
#define IdF19   45
#define IdF20   46
#define IdUDK6  47
#define IdUDK7  48
#define IdUDK8  49
#define IdUDK9  50
#define IdUDK10 51
#define IdUDK11 52
#define IdUDK12 53
#define IdUDK13 54
#define IdUDK14 55
#define IdUDK15 56
#define IdUDK16 57
#define IdUDK17 58
#define IdUDK18 59
#define IdUDK19 60
#define IdUDK20 61
#define IdXF1	62
#define IdXF2	63
#define IdXF3	64
#define IdXF4	65
#define IdXF5	66
#define IdCmdEditCopy 67
#define IdCmdEditPaste 68
#define IdCmdEditPasteCR 69
#define IdCmdEditCLS 70
#define IdCmdEditCLB 71
#define IdCmdCtrlOpenTEK 72
#define IdCmdCtrlCloseTEK 73
#define IdCmdLineUp 74
#define IdCmdLineDown 75
#define IdCmdPageUp 76
#define IdCmdPageDown 77
#define IdCmdBuffTop 78
#define IdCmdBuffBottom 79
#define IdCmdNextWin 80
#define IdCmdPrevWin 81
#define IdCmdLocalEcho 82
#define IdUser1 83
#define NumOfUserKey 99
#define IdKeyMax IdUser1+NumOfUserKey-1

// key code for macro commands
#define IdCmdDisconnect 1000
#define IdCmdLoadKeyMap 1001
#define IdCmdRestoreSetup 1002

#define KeyStrMax 1023

// (user) key type IDs
#define IdBinary 0  // transmit text without any modification
#define IdText   1  // transmit text with new-line & DBCS conversions
#define IdMacro  2  // activate macro
#define IdCommand 3 // post a WM_COMMAND message

/* Control Characters */

#define NUL 0x00
#define SOH 0x01
#define STX 0x02
#define ETX 0x03
#define EOT 0x04
#define ENQ 0x05
#define ACK 0x06
#define BEL 0x07
#define BS  0x08
#define HT  0x09
#define LF  0x0A
#define VT  0x0B
#define FF  0x0C
#define CR  0x0D
#define SO  0x0E
#define SI  0x0F
#define DLE 0x10
#define DC1 0x11
	#define XON 0x11
#define DC2 0x12
#define DC3 0x13
	#define XOFF 0x13
#define DC4 0x14
#define NAK 0x15
#define SYN 0x16
#define ETB 0x17
#define CAN 0x18
#define EM  0x19
#define SUB 0x1A
#define ESC 0x1B
#define FS  0x1C
#define GS  0x1D
#define RS  0x1E
#define US  0x1F

#define SP  0x20

#define DEL 0x7F

#define IND 0x84
#define NEL 0x85
#define SSA 0x86
#define ESA 0x87
#define HTS 0x88
#define HTJ 0x89
#define VTS 0x8A
#define PLD 0x8B
#define PLU 0x8C
#define RI  0x8D
#define SS2 0x8E
#define SS3 0x8F
#define DCS 0x90
#define PU1 0x91
#define PU2 0x92
#define STS 0x93
#define CCH 0x94
#define MW  0x95
#define SPA 0x96
#define EPA 0x97
/*#define SOS 0x98*/


#define CSI 0x9B
#define ST  0x9C
#define OSC 0x9D
#define PM  0x9E
#define APC 0x9F

#define InBuffSize 1024
#define OutBuffSize 1024

#define ID_FILE 0
#define ID_EDIT 1
#define ID_SETUP 2
#define ID_CONTROL 3
#define ID_HELPMENU 4
#define ID_WINDOW_1 50801
#define ID_WINDOW_WINDOW 50810

#define ID_TRANSFER 4
#define ID_SHOWMENUBAR 995

#define BuffXMax 300
#define BuffYMax 100000
#define BuffSizeMax 8000000

HDC PrnBox(HWND HWin, LPBOOL Sel);
BOOL PrnStart(LPSTR DocumentName);
void PrnStop();

#define IdPrnCancel 0
#define IdPrnScreen 1
#define IdPrnSelectedText 2
#define IdPrnScrollRegion 4
#define IdPrnFile 8

int VTPrintInit(int PrnFlag);
void PrnSetAttr(BYTE Attr, BYTE Attr2);
void PrnOutText(PCHAR Buff, int Count);
void PrnNewLine();
void VTPrintEnd();

void PrnFileDirectProc();
void PrnFileStart();
void OpenPrnFile();
void ClosePrnFile();
void WriteToPrnFile(BYTE b, BOOL Write);

void InitBuffer();
void LockBuffer();
void UnlockBuffer();
void FreeBuffer();
void BuffReset();
void BuffScroll(int Count, int Bottom);
void BuffInsertSpace(int Count);
void BuffEraseCurToEnd();
void BuffEraseHomeToCur();
void BuffInsertLines(int Count, int YEnd);
void BuffEraseCharsInLine(int XStart, int Count);
void BuffDeleteLines(int Count, int YEnd);
void BuffDeleteChars(int Count);
void BuffEraseChars(int Count);
void BuffFillWithE();
void BuffDrawLine(BYTE Attr, BYTE Attr2, int Direction, int C);
void BuffEraseBox(int XStart, int YStart, int XEnd, int YEnd);
void BuffCBCopy(BOOL Table);
void BuffPrint(BOOL ScrollRegion);
void BuffDumpCurrentLine(BYTE TERM);
void BuffPutChar(BYTE b, BYTE Attr, BYTE Attr2, BOOL Insert);
void BuffPutKanji(WORD w, BYTE Attr, BYTE Attr2, BOOL Insert);
void BuffUpdateRect(int XStart, int YStart, int XEnd, int YEnd);
void UpdateStr();
void MoveCursor(int Xnew, int Ynew);
void MoveRight();
void BuffSetCaretWidth();
void BuffScrollNLines(int n);
void BuffClearScreen();
void BuffUpdateScroll();
void CursorUpWithScroll();
void BuffDblClk(int Xw, int Yw);
void BuffTplClk(int Yw);
void BuffStartSelect(int Xw, int Yw, BOOL Box);
void BuffChangeSelect(int Xw, int Yw, int NClick);
void BuffEndSelect();
void BuffChangeWinSize(int Nx, int Ny);
void BuffChangeTerminalSize(int Nx, int Ny);
void ChangeWin();
void ClearBuffer();
void SetTabStop();
void MoveToNextTab();
void ClearTabStop(int Ps);
void ShowStatusLine(int Show);

PCHAR CBOpen(LONG MemSize);
void CBClose();
void CBStartPaste(HWND HWin, BOOL AddCR,
		  int BuffSize, PCHAR DataPtr, int DataSize);
void CBSend();
void CBEndPaste();

#endif


--- NEW FILE: cdrom.h ---
#ifndef __cdrom_h_
#define __cdrom_h_

#ifndef __FreeBSD__
#include <mntent.h>
#else
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
#include <sys/file.h>
#include <sys/cdio.h>
#endif /* __FreeBSD__ */


#include <sys/ioctl.h>
#include <signal.h>
#include <fcntl.h>

#ifndef __FreeBSD__
#include <linux/cdrom.h>
#include <linux/errno.h>
#endif

#ifndef MODULE_CDROM
extern void	set_cd_device (Window *, char *, int);
extern void cd_stop (char *, char *, char *, char *);
extern void cd_eject (char *, char *, char *, char *);
extern void cd_play (char *, char *, char *, char *);
extern void cd_list (char *, char *, char *, char *);
extern void cd_volume (char *, char *, char *, char *);
extern void cd_pause (char *, char *, char *, char *);
extern void cd_help (char *, char *, char *, char *);
#endif

#ifndef __FreeBSD__
struct cdrom_etocentry 
{
	u_char	cdte_track;
	u_char	cdte_adr	:4;
	u_char	cdte_ctrl	:4;
	u_char	cdte_format;
	union cdrom_addr cdte_addr;
	u_char	cdte_datamode;
	int avoid;
	int length;
	int m_length;
	int m_start;
};
#else

struct cdrom_etocentry
{
	u_char m_length;
	u_char m_start;
	int avoid;
};
	
#define CDROMSTOP CDIOCSTOP
#define CDROMEJECT CDIOCEJECT
#define CDROMREADTOCHDR CDIOREADTOCHEADER
#define CDROMVOLCTRL CDIOCSETVOL
#define CDROMPAUSE CDIOCPAUSE
#define CDROMRESUME CDIOCRESUME
#define CDROMVOLREAD CDIOCGETVOL
#endif /* __FreeBSD__ */

#endif /* cdrom.h */

--- NEW FILE: notify.h ---
/*
 * notify.h: header for notify.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: notify.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __notify_h_
#define __notify_h_

	void	show_notify_list (int);
	BUILT_IN_COMMAND(notify);
	void	do_notify (void);
	void	notify_mark (char *, char *, int, int);
	void	save_notify (FILE *);
	void	set_notify_handler (Window *, char *, int);
	void	make_notify_list (int);
	int	hard_uh_notify (int, char *, char *, char *);
extern	char	*get_notify_nicks (int, int, char *, int);
	void	add_delay_notify (int);
	void	notify_count (int, int *, int *);
	void	rebuild_notify_ison (int);
	void	rebuild_all_ison (void);
	void	save_watch(FILE *);
	BUILT_IN_COMMAND(watchcmd);
	void	show_watch_list (int);
	void	make_watch_list (int);
	void	show_watch_notify (char *, int, char **);
	void	send_watch (int);
	char	*get_watch_nicks (int, int, char *, int);
				
#endif /* __notify_h_ */

--- NEW FILE: notice.h ---

#ifndef _NOTICE_H
#define _NOTICE_H

#ifdef WANT_OPERVIEW
#undef NEWNET_IRCOP

#define NICK_COLLIDE	0x000001
#define NICK_KILL	0x000002
#define IP_MISMATCH	0x000004
#define HACK_OPS	0x000008
#define IDENTD		0x000010
#define FAKE_MODE	0x000020
#define UNAUTHS		0x000040
#define TOO_MANY	0x000080
#define TRAFFIC		0x000100
#define REHASH		0x000200
#define KLINE		0x000400
#define POSSIBLE_BOT	0x000800
#define OPER_MODE	0x001000
#define SQUIT		0x002000
#define SERVER_CONNECT	0x004000
#define CLIENT_CONNECT	0x008000
#define TERM_FLOOD	0x010000
#define INVALID_USER	0x020000
#define STATS_REQUEST	0x040000
#define NICK_FLOODING	0x080000
#define KILL_ACTIVE	0x100000
#define SERVER_CRAP	0x200000

void	s_watch (char *, char *, char *, char *);
void	ov_window (char *, char *, char *, char *);
void	setup_ov_mode (int, int, int);
#endif


#endif

--- NEW FILE: dcc.h ---
/*
 * dcc.h: Things dealing client to client connections. 
 *
 * Copyright(c) 1998 Colten Edwards 
 *
 */

#ifndef __dcc_h_
#define __dcc_h_

	/* 
	 * these are all used in the bot_link layer. the dcc_printf is used in
	 * a few other places as well. ie dcc.c
	 */
	int	BX_dcc_printf (int, char *, ...);
	void	tandout_but (int, char *, ...);
	void	chanout_but (int, char *, ...);
	int	handle_tcl_chan (int, char *, char *, char *);
	int	tand_chan (int, char *);
	int	tand_zapf (int, char *);
	int	tand_zapfbroad (int, char *);
	int	handle_dcc_bot (int, char *);
	int	tandem_join (int, char *);
	int	tandem_part (int, char *);
	int	send_who_to (int, char *, int);
	int	tand_who (int, char *);
	int	tand_whom (int, char *);
	int	tell_who (int, char *);
	int	send_who (int, char *);
	int	tell_whom (int, char *);
	int	send_whom (int, char *);
	int	tand_priv (int, char *);
	int	tand_boot (int, char *);
	int	tand_privmsg (int, char *);
	int	tand_part (int, char *);
	int	tand_join (int, char *);
	int	tand_clink (int, char *);
	int	tand_command (int, char *);
	int	cmd_cmsg (int, char *);
	int	cmd_cboot (int, char *);
	int	cmd_act (int, char *);
	int	cmd_help (int, char *);
	int	cmd_msg (int, char *);
	int	cmd_say (int, char *);
	int	cmd_tcl (int, char *);
	int	cmd_chat (int, char *);
	int	cmd_quit (int, char *);
	int	cmd_invite (int, char *);
	int	cmd_echo (int, char *);
	int	cmd_boot (int, char *);
	int	cmd_ops (int, char *);
	int	cmd_adduser (int, char *);
	int	cmd_ircii (int, char *);
	int	cmd_whoami (int, char *);
	int	send_command (int, char *);
	
	int	dcc_ftpcommand (char *, char *);
	

/* 
 * these definitions are mostly used by ircII as well 
 * I expanded the flags to a full 32 bits to allow for future
 * expansion. 
 */
#define DCC_PACKETID  0xfeab		/* used to figure out endianess 
					 * as well as identify the resend
					 * packet 
					 */
#define MAX_DCC_BLOCK_SIZE 16384	/* 
					 * this is really arbritrary value.
					 * we can actually make this a lot
					 * larger and things will still work
					 * as expected. The network layer places
					 * a limit however. 
					 */

#define DCC_CHAT	0x00000001

#define DCC_FILEOFFER	0x00000002
#define DCC_FILEREAD	0x00000003

#define	DCC_RAW_LISTEN	0x00000004
#define	DCC_RAW		0x00000005

#define DCC_REFILEOFFER	0x00000006
#define DCC_REFILEREAD	0x00000007

#define DCC_BOTMODE	0x00000008
#define DCC_FTPOPEN	0x00000009
#define DCC_FTPGET	0x0000000a
#define DCC_FTPSEND	0x0000000b
#define DCC_FTPCOMMAND	0x0000000c
#define DCC_TYPES	0x000000ff

#define DCC_WAIT	0x00010000
#define DCC_ACTIVE	0x00020000
#define DCC_OFFER	0x00040000
#define DCC_DELETE	0x00080000
#define DCC_TWOCLIENTS	0x00100000

#ifdef NON_BLOCKING_CONNECTS
#define DCC_CNCT_PEND	0x00200000
#endif

#ifdef HAVE_SSL
#define DCC_SSL		0x04000000
#endif

#define DCC_QUEUE	0x00400000
#define DCC_TDCC	0x00800000
#define DCC_BOTCHAT	0x01000000
#define DCC_ECHO	0x02000000
#define DCC_STATES	0xffffff00


#define DCC_COMMAND(x) void x (char *command, char *args)

	int	check_dcc_list (char *);
	int	dcc_exempt_save (FILE *);

	DCC_COMMAND(BX_dcc_filesend);
	DCC_COMMAND(BX_dcc_resend);
	DCC_COMMAND(dcc_stats);
	DCC_COMMAND(dcc_chat);
	DCC_COMMAND(dcc_ftpopen);
	DCC_COMMAND(dcc_glist);
	DCC_COMMAND(dcc_chatbot);
	DCC_COMMAND(dcc_resume);
	DCC_COMMAND(dcc_rename);

	int	BX_get_active_count();
	int	dcc_ftpcommand(char *, char *);
	void	process_dcc(char *);
	int	dcc_activechat(char *);	/* identify all active chat dcc's */
	int	dcc_activebot(char *);	/* identify all active bot's */
	int	dcc_activeraw(char *);  /* identify all active raw connects */
	void	dcc_chat_transmit(char *, char *, char *, char *, int);
	void	dcc_bot_transmit(char *, char *, char *);
	void	dcc_raw_transmit(char *, char *, char *);

	void	register_dcc_type(char *, char *, char *, char *, char *, char *, char *, char *, void (*func)(int));

	void	dcc_reject(char *, char *, char *);
	char	*dcc_raw_connect(char *, unsigned short);
	char	*dcc_raw_listen(int port);
	void	close_all_dcc(void);
	void	dcc_sendfrom_queue(void);
	void	dcc_check_idle(void);
	int	check_dcc_socket(int);
	char	*get_dcc_info(SocketList *, DCC_int *, int);
	void	init_dcc_table(void);
	int BX_remove_all_dcc_binds(char *);
	int BX_remove_dcc_bind(char *, int);
	
	
	int	BX_add_dcc_bind(char *, char *, void *, void *, void *, void *, void *);

	SocketList *BX_find_dcc(char *, char *, char *, int, int, int, int);	
	void	BX_erase_dcc_info(int, int, char *, ...);
	DCC_int	*BX_dcc_create(char *, char *, char *, unsigned long, int, int, unsigned long, void (*func)(int));
	int	close_dcc_number(int);
	
	char *	equal_nickname (const char *);
	
#define DCC_STRUCT_TYPE  0xdcc0dcc0

#endif /* __dcc_h_ */

--- NEW FILE: ircaux.h ---
/*
 * ircaux.h: header file for ircaux.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
 *
 * @(#)$Id: ircaux.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _IRCAUX_H_
#define _IRCAUX_H_

#include "irc.h"
#include "irc_std.h"
#include <stdio.h>
#ifdef WANT_TCL
#undef USE_TCLALLOC
#include <tcl.h>
#endif

typedef int comp_len_func (char *, char *, int);
typedef int comp_func (char *, char *);

extern unsigned char stricmp_table[];


char *	BX_check_nickname 		(char *);
char *	BX_next_arg 		(char *, char **);
char *	BX_new_next_arg 		(char *, char **);
char *	BX_new_new_next_arg 	(char *, char **, char *);
char *	BX_last_arg 		(char **);
char *	BX_expand_twiddle 		(char *);
char *	BX_upper 			(char *);
char *	BX_lower 			(char *);
char *	BX_sindex			(register char *, char *);
char *	BX_rsindex 		(register char *, char *, char *, int);
char *	BX_path_search 		(char *, char *);
char *	BX_double_quote 		(const char *, const char *, char *);
char *	quote_it 		(const char *, const char *, char *);

char *	n_malloc_strcpy		(char **, const char *, const char *, const char *, const int);
char *	BX_malloc_str2cpy		(char **, const char *, const char *);
char *	n_malloc_strcat 	(char **, const char *, const char *, const char *, const int);

char *	BX_m_s3cat_s 		(char **, const char *, const char *);
char *	BX_m_s3cat 		(char **, const char *, const char *);
char *	BX_m_3cat 			(char **, const char *, const char *);
char *	BX_m_e3cat 		(char **, const char *, const char *);
char *	BX_m_2dup 			(const char *, const char *);
char *	BX_m_3dup 			(const char *, const char *, const char *);
char *	BX_m_opendup 		(const char *, ...);
char *	n_m_strdup 		(const char *, const char *, const char *, const int);
char *	BX_malloc_sprintf 		(char **, const char *, ...);
char *	BX_m_sprintf 		(const char *, ...);
int	BX_is_number 		(const char *);
char *	BX_my_ctime 		(time_t);

#if 0
#define my_stricmp(x, y) strcasecmp(x, y) /* unable to use these for reasons of case sensitivity and finish */
#define my_strnicmp(x, y, n) strncasecmp(x, y, n)
#else
int	BX_my_stricmp 	(const unsigned char *, const unsigned char *);
int	BX_my_strnicmp	(const unsigned char *, const unsigned char *, size_t);
#endif

int	BX_my_strnstr 		(const unsigned char *, const unsigned char *, size_t);
int	BX_scanstr 		(char *, char *);
void	really_free 		(int);
char *	BX_chop 			(char *, int);
char *	BX_strmcpy 		(char *, const char *, int);
char *	BX_strmcat 		(char *, const char *, int);
char *	strmcat_ue 		(char *, const char *, int);
char *	n_m_strcat_ues 		(char **, char *, int, const char *, const char *, const int);
char *	BX_stristr 		(const char *, const char *);
char *	BX_rstristr 		(char *, char *);
FILE *	BX_uzfopen 		(char **, char *, int);
int	BX_end_strcmp 		(const char *, const char *, int);
void	BX_ircpanic		(char *, ...);
int	fw_strcmp 		(comp_len_func *, char *, char *);
int	lw_strcmp 		(comp_func *, char *, char *);
int	open_to 		(char *, int, off_t);
struct timeval BX_get_time 	(struct timeval *);
double 	BX_time_diff 		(struct timeval, struct timeval);
char *	BX_plural 			(int);
int	BX_time_to_next_minute 	(void);
char *	BX_remove_trailing_spaces 	(char *);
char *	BX_my_ltoa			(long);
char *	BX_strformat 		(char *, const char *, int, char);
char *	chop_word 		(char *);
int	BX_splitw 			(char *, char ***);
char *	BX_unsplitw 		(char ***, int);
int	BX_check_val 		(char *);
char *	BX_strextend 		(char *, char, int);
char *	strext			(char *, char *);
char *	BX_pullstr 		(char *, char *);
int 	BX_empty 			(const char *);
char *	safe_new_next_arg 	(char *, char **);
char *	BX_MatchingBracket 	(register char *, register char, register char);
int	BX_word_count 		(char *);
int	BX_parse_number 		(char **);
char *	BX_remove_brackets 	(const char *, const char *, int *);
u_long	hashpjw 		(char *, u_long);
char *	BX_m_dupchar 		(int);
char *	BX_strmccat		(char *, char, int);
off_t	file_size		(char *);
int	is_root			(char *, char *, int);
size_t	BX_streq			(const char *, const char *);
size_t	BX_strieq			(const char *, const char *);
char *	n_m_strndup		(const char *, size_t, const char *, const char *, const int);
char *	BX_on_off 			(int);
char *	BX_rfgets			(char *, int, FILE *);
char *  BX_strmopencat             (char *, int, ...);
long 	BX_my_atol			(const char *);
char *	s_next_arg		(char **);
char *	BX_next_in_comma_list	(char *, char **);
void	BX_strip_control		(const char *, char *);
int	BX_figure_out_address	(char *, char **, char **, char **, char **, int *);
int	count_char		(const unsigned char *, const unsigned char);
char *	BX_strnrchr		(char *, char, int);
void	BX_mask_digits		(char **);
const char *BX_strfill		(char, int);
char *	BX_ov_strcpy		(char *, const char *);
char *	BX_strpcat			(char *, const char *, ...);
char *  BX_strmpcat		(char *, size_t, const char *, ...);
char *	chomp			(char *);
size_t	BX_ccspan			(const char *, int);
u_char *BX_strcpy_nocolorcodes	(u_char *, const u_char *);

u_long	BX_random_number		(u_long);
char *	get_userhost		(void);

char *	urlencode		(const char *);
char *	urldecode		(char *);

/* From words.c */
#define SOS -32767
#define EOS 32767
char	*BX_search			(register char *, char **, char *, int);
char	*BX_move_to_abs_word	(const register char *, char **, int);
char	*BX_move_word_rel		(const register char *, char **, int);
char	*BX_extract		(char *, int, int);
char	*BX_extract2		(const char *, int, int);
int	BX_wild_match		(register const unsigned char *, register const unsigned char *);

/* Used for connect_by_number */
#define SERVICE_SERVER 0
#define SERVICE_CLIENT 1
#define PROTOCOL_TCP 0
#define PROTOCOL_UDP 1

/* Used from network.c */
int			BX_connect_by_number (char *, unsigned short *, int, int, int);
struct sockaddr_foobar *	BX_lookup_host(const char *);
char *			BX_host_to_ip (const char *);
char *			BX_ip_to_host (const char *);
char *			BX_one_to_another (const char *);
int			BX_set_blocking (int);
int			BX_set_non_blocking (int);
int			my_accept (int, struct sockaddr *, int *);
int			lame_resolv (const char *, struct sockaddr_foobar *);

#define my_isspace(x) \
	((x) == 9 || (x) == 10 || (x) == 11 || (x) == 12 || (x) == 13 || (x) == 32)
  
#define my_isdigit(x) \
(*x >= '0' && *x <= '9') || \
((*x == '-'  || *x == '+') && (x[1] >= '0' && x[1] <= '9'))

#define LOCAL_COPY(y) strcpy(alloca(strlen((y)) + 1), y)


#define	_1KB	((double) 1000)
#define _1MEG	(_1KB * _1KB)
#define _1GIG	(_1KB * _1KB * _1KB)
#define _1TER	(_1KB * _1KB * _1KB * _1KB)
#define _1ETA	(_1KB * _1KB * _1KB * _1KB * _1KB)

#if 0
#define	_1MEG	(1024.0*1024.0)
#define	_1GIG	(1024.0*1024.0*1024.0)
#define	_1TER	(1024.0*1024.0*1024.0*1024.0)
#define	_1ETA	(1024.0*1024.0*1024.0*1024.0*1024.0)
#endif

#define	_GMKs(x)	( ((double)x > _1ETA) ? "eb" : \
			(((double)x > _1TER) ? "tb" : (((double)x > _1GIG) ? "gb" : \
			(((double)x > _1MEG) ? "mb" : (((double)x > _1KB)? "kb" : "bytes")))))

#define	_GMKv(x)	(((double)x > _1ETA) ? \
			((double)x/_1ETA) : (((double)x > _1TER) ? \
			((double)x/_1TER) : (((double)x > _1GIG) ? \
			((double)x/_1GIG) : (((double)x > _1MEG) ? \
			((double)x/_1MEG) : (((double)x > _1KB) ? \
			((double)x/_1KB): (double)x)))) )

void	*n_malloc 	(size_t, const char *, const char *, const int);
void	*n_realloc	(void **, size_t, const char *, const char *, const int);

void	*n_free 	(void **, const char *, const char *, const int);

#define MODULENAME NULL

#define new_malloc(x) n_malloc(x, MODULENAME, __FILE__, __LINE__)
#define new_free(x) n_free((void **)(x), MODULENAME, __FILE__, __LINE__)

#define RESIZE(x, y, z) n_realloc     ((void **)& (x), sizeof(y) * (z), MODULENAME, __FILE__, __LINE__)
#define malloc_strcpy(x, y) n_malloc_strcpy((char **)x, (char *)y, MODULENAME, __FILE__, __LINE__)
#define malloc_strcat(x, y) n_malloc_strcat((char **)x, (char *)y, MODULENAME, __FILE__, __LINE__)
#define m_strdup(x) n_m_strdup(x, MODULENAME, __FILE__, __LINE__)
#define m_strcat_ues(x, y, z) n_m_strcat_ues(x, y, z, MODULENAME, __FILE__, __LINE__)
#define m_strndup(x, y) n_m_strndup(x, y, MODULENAME, __FILE__, __LINE__)

char	*encode			(const char *, int);
char	*decode			(const char *);
char	*BX_cryptit		(const char *);
int	checkpass		(const char *, const char *);


/* Used for the inbound mangling stuff */

#define MANGLE_ESCAPES		1 << 0
#define MANGLE_ANSI_CODES	1 << 1
#define STRIP_COLOR		1 << 2
#define STRIP_REVERSE		1 << 3
#define STRIP_UNDERLINE		1 << 4
#define STRIP_BOLD		1 << 5
#define STRIP_BLINK		1 << 6
#define STRIP_ROM_CHAR          1 << 7
#define STRIP_ND_SPACE          1 << 8
#define STRIP_ALL_OFF		1 << 9
#define STRIP_ALT_CHAR		1 << 10
#define PRE_MANGLE		1 << 11

extern	int     outbound_line_mangler;
extern	int     inbound_line_mangler;
extern	int	logfile_line_mangler;
extern	int	operlog_line_mangler;

size_t	BX_mangle_line	(char *, int, size_t);
int	BX_charcount		(const char *, char);
char	*BX_stripdev		(char *);
char	*convert_dos		(char *);
char	*convert_unix		(char *);
int	is_dos			(char *);
void	strip_chars		(char *, char *, char);
char	*longcomma		(long);
char	*ulongcomma		(unsigned long);

#define SAFE(x) (((x) && *(x)) ? (x) : empty_string)

/* Used in compat.c */
#ifndef HAVE_TPARM
	char 	*tparm (const char *, ...);
#endif

#ifndef HAVE_STRTOUL
	unsigned long 	strtoul (const char *, char **, int);
#endif

	char *	bsd_getenv (const char *);
	int	bsd_putenv (const char *);
	int	bsd_setenv (const char *, const char *, int);
	void	bsd_unsetenv (const char *);

#ifndef HAVE_INET_ATON
	int	inet_aton (const char *, struct in_addr *);
#endif

#ifndef HAVE_STRLCPY
	size_t	strlcpy (char *, const char *, size_t);
#endif

#ifndef HAVE_STRLCAT
	size_t	strlcat (char *, const char *, size_t);
#endif

#ifndef HAVE_VSNPRINTF
	int	vsnprintf (char *, size_t, const char *, va_list);
#endif

#ifndef HAVE_SNPRINTF
	int	snprintf (char *, size_t, const char *, ...);
#endif

#ifndef HAVE_SETSID
	int	setsid (void);
#endif

#endif /* _IRCAUX_H_ */

--- NEW FILE: translat.h ---
/*
 * Global stuff for translation tables.
 *
 * Tomten, tomten at solace.hsh.se / tomten at lysator.liu.se
 *
 * @(#)$Id: translat.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __translat_h_
#define __translat_h_

	void	set_translation (Window *, char *, int);
	void	enter_digraph (char, char *);
	unsigned char	get_digraph (unsigned char);
	void	digraph (char *, char *, char *, char *);
	void	save_digraphs (FILE *);

extern	unsigned char	transToClient[256];
extern	unsigned char	transFromClient[256];
extern	char	translation;

#define DIG_TABLE_SIZE 256
extern	unsigned char	dig_table_lo[DIG_TABLE_SIZE];
extern	unsigned char	dig_table_hi[DIG_TABLE_SIZE];
extern	unsigned char	dig_table_di[DIG_TABLE_SIZE];

extern	char	digraph_hit;
extern	unsigned char	digraph_first;

#endif /* __translat_h_ */

--- NEW FILE: misc.h ---
/* 
 * Copyright Colten Edwards 1997.
 * various miscellaneous routines needed for irc functions
 */
 
#ifndef _misc_h
#define _misc_h

#define KICKLIST		0x01
#define LEAVELIST		0x02
#define JOINLIST		0x03
#define CHANNELSIGNOFFLIST	0x04
#define PUBLICLIST		0x05
#define PUBLICOTHERLIST		0x06
#define PUBLICNOTICELIST	0x07
#define NOTICELIST		0x08
#define TOPICLIST		0x09
#define MODEOPLIST		0x0a
#define MODEDEOPLIST		0x0b
#define MODEBANLIST		0x0c
#define MODEUNBANLIST		0x0d
#define NICKLIST		0x0e
#define MODEHOPLIST		0x0f
#define MODEDEHOPLIST		0x10
#define MODEEBANLIST		0x11
#define MODEUNEBANLIST		0x12

enum color_attributes {	
	BLACK = 0, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE, 
	BLACKB, BLUEB, GREENB, CYANB, REDB, MAGENTAB, YELLOWB, WHITEB,NO_COLOR, 
	BACK_BLACK, BACK_RED, BACK_GREEN, BACK_YELLOW,
	BACK_BLUE, BACK_MAGENTA, BACK_CYAN, BACK_WHITE, 
	BACK_BBLACK, BACK_BRED, BACK_BGREEN, BACK_BYELLOW,
	BACK_BBLUE, BACK_BMAGENTA, BACK_BCYAN, BACK_BWHITE, 
	REVERSE_COLOR, BOLD_COLOR, BLINK_COLOR, UNDERLINE_COLOR
};

#define DONT_CARE 3	
#define NEED_OP 1
#define NO_OP 0
	
extern char *color_str[];
extern	int	split_watch;
void	clear_link (irc_server **);
extern  irc_server *tmplink, *server_last;

#ifndef BITCHX_LITE
#define MAX_LAST_MSG 10
#else
#define MAX_LAST_MSG 2
#endif

extern LastMsg last_msg[MAX_LAST_MSG+1];
extern LastMsg last_dcc[MAX_LAST_MSG+1];
extern LastMsg last_sent_dcc[MAX_LAST_MSG+1];
extern LastMsg last_notice[MAX_LAST_MSG+1];
extern LastMsg last_servermsg[MAX_LAST_MSG+1];
extern LastMsg last_sent_msg[MAX_LAST_MSG+1];
extern LastMsg last_sent_notice[MAX_LAST_MSG+1];
extern LastMsg last_sent_topic[2];
extern LastMsg last_sent_wall[2];
extern LastMsg last_topic[2];
extern LastMsg last_wall[MAX_LAST_MSG+1];
extern LastMsg last_invite_channel[2];
extern LastMsg last_ctcp[2];
extern LastMsg last_sent_ctcp[2];



	void	update_stats	(int, char *, NickList *, ChannelList *, int);
	int	check_split	(char *, char *, char *);
	void	BX_userage		(char *, char *);
	void	stats_k_grep_end (void);
	char	*stripansicodes (const unsigned char *);
	char	*stripansi	(unsigned char *);
	NickTab	*BX_gettabkey (int, int, char *);
	void	BX_addtabkey (char *, char *, int);
	void	clear_array (NickTab **, char *);
	char	*BX_random_str (int, int);
	int	check_serverlag (void);
	void	auto_away (unsigned long);
ChannelList *	BX_prepare_command (int *, char *, int);
	int	rename_file (char *, char **);
	void	putlog (int, ...);

	void	add_mode_buffer ( char *, int);
	void	flush_mode (ChannelList *);
	void	flush_mode_all (ChannelList *);
	void	add_mode (ChannelList *, char *, int, char *, char *, int);
	int	delay_flush_all (void *, char *);
	char	*clear_server_flags (char *);
	char	*ban_it (char *, char *, char *, char *);

	void	log_toggle (int, ChannelList *);

	char	*cluster (char *);
	int	caps_fucknut (register unsigned char *);

	void    do_reconnect (char *);

	int	are_you_opped (char *);
	void	error_not_opped (char *);

	char	*get_reason (char *, char *);
	char	*get_realname(char *);
	char	*get_signoffreason (char *);
	int	isme (char *);

	char 		*BX_convert_output_format (const char *, const char *, ...);
	char 		*convert_output_format2 (const char *);
	void		add_last_type (LastMsg *, int, char *, char *, char *, char *);
	int		check_last_type (LastMsg *, int, char *, char *);
	int		matchmcommand (char *, int);
	char		*convert_time (time_t);
	char		*BX_make_channel(char *);	


	int		timer_unban (void *, char *);
	void		check_server_connect (int);
	char		*country(char *);
	int		do_newuser (char *, char *, char *);
	int		char_fucknut (register unsigned char *, char, int);
	BanList		*ban_is_on_channel(register char *, register ChannelList *);
	BanList		*eban_is_on_channel(register char *, register ChannelList *);
	void		check_orig_nick(char *);

	char		*do_nslookup (char *, char *, char *, char *, int, void (*func)(), char *);
	void		set_nslookupfd(fd_set *);
	long		print_nslookup(fd_set *);
	void		ns_init(void);
	void		auto_nslookup();
	int		freadln(FILE *, char *);


	void		BX_close_socketread(int);
	int		BX_add_socketread(int, int, unsigned long, char *, void (*func_read)(int), void (*func_write)(int));
	int		BX_check_socket(int);
	void		set_socket_read (fd_set *, fd_set *);
	void		scan_sockets (fd_set *, fd_set *);
	void		read_clonelist(int);
	void		read_clonenotify(int);
	void		read_netfinger(int);
	int		BX_write_sockets(int, unsigned char *, int, int);
	int		BX_read_sockets(int, unsigned char *, int);
	unsigned long	BX_set_socketflags(int, unsigned long);
	void		*BX_get_socketinfo(int);
	void		BX_set_socketinfo(int, void *);
	unsigned long	BX_get_socketflags(int);
	char		*get_socketserver(int);
	SocketList	*BX_get_socket(int);
	void		BX_add_sockettimeout(int, time_t, void *);
	int		BX_get_max_fd(void);
	int		BX_set_socketwrite(int);
	
#ifdef GUI
	void		scan_gui(fd_set *);
#endif		

#ifdef WANT_NSLOOKUP
/*
 * alib.h (C)opyright 1992 Darren Reed.
 */
#define	ARES_INITLIST	1
#define	ARES_CALLINIT	2
#define ARES_INITSOCK	4
#define ARES_INITDEBG	8
#define ARES_INITCACH    16

#define MAXPACKET	1024
#define MAXALIASES	35
#define MAXADDRS	35

#define	RES_CHECKPTR	0x0400

struct	hent {
	char	*h_name;	/* official name of host */
	char	*h_aliases[MAXALIASES];	/* alias list */
	int	h_addrtype;	/* host address type */
	int	h_length;	/* length of address */
	/* list of addresses from name server */
	struct	in_addr	h_addr_list[MAXADDRS];
#define	h_addr	h_addr_list[0]	/* address, for backward compatiblity */
};

struct	resinfo {
	char	*ri_ptr;
	int	ri_size;
};

struct	reslist {
	int	re_id;
	char	re_type;
	char	re_retries;
	char	re_resend;	/* send flag. 0 == dont resend */
	char	re_sends;
	char	re_srch;
	int	re_sent;
	u_long	re_sentat;
	u_long	re_timeout;
	struct	in_addr	re_addr;
	struct	resinfo	re_rinfo;
	struct	hent re_he;
	struct	reslist	*re_next, *re_prev;
	char	re_name[65];
	char	*nick;
	char	*host;
	char	*user;
	char	*channel;
	char	*command;
	int	server;
	void	(*func)();
};

struct	hostent	*ar_answer(char *, int, void (*func)(struct reslist *) );
void    ar_close(void);
int     ar_delete(char *, int);
int     ar_gethostbyname(char *, char *, int, char *, char *, char *, char *, int, void (*func)(), char *);
int     ar_gethostbyaddr(char *, char *, int, char *, char *, char *, char *, int, void (*func)(), char *);
int     ar_init(int);
int     ar_open(void);
long    ar_timeout(time_t, char *, int, void (*func)(struct reslist *) );
void	ar_rename_nick(char *, char *, int);
#endif

#ifndef	MIN
#define	MIN(a,b)	((a) > (b) ? (b) : (a))
#endif

#define getrandom(min, max) ((rand() % (int)(((max)+1) - (min))) + (min))


extern char *auto_str;
	
#endif

--- NEW FILE: bitchx ---

char compile_time_options[] = {
 
					'a',
#ifdef NO_BOTS
 					'b',
#endif /* NO_BOTS */
 
#ifdef BITCHX_DEBUG
 					'd',
#endif /* BITCHX_DEBUG */
 
#ifdef EXEC_COMMAND
 					'e',
#endif /* EXEC_COMMAND */
 
#ifdef INCLUDE_GLOB_FUNCTION
 					'g',
#endif /* INCLUDE_GLOB_FUNCTION */
#ifdef WANT_HEBREW
					'h',
#endif
 
#ifdef MIRC_BROKEN_DCC_RESUME
					'i',
#endif /* MIRC_BROKEN_DCC_RESUME */

#ifdef HACKED_DCC_WARNING
					'k',
#endif /* HACKED_DCC_WARNING */

#ifdef WANT_DLL
					'l',
#endif

#ifdef STRIP_EXTRANEOUS_SPACES
					's',
#endif /* STRIP_EXTRANEOUS_SPACES */

#ifdef WANT_TCL
					't',
#endif

#ifdef UNAME_HACK
 					'u',
#endif /* UNAME_HACK */
 
#ifdef ALLOW_STOP_IRC
					'z',
#endif /* ALLOW_STOP_IRC */

					'\0'
};

--- NEW FILE: gui.h ---

#ifndef _GUI_H_
#define _GUI_H_
#ifdef GUI

#define         GUISUBMENU             1
#define         GUIMENUITEM            (1 << 1)
#define         GUIIAMENUITEM          (1 << 2)
#define         GUIDEFMENUITEM         (1 << 3)
#define         GUIBRKMENUITEM         (1 << 4)
#define         GUISEPARATOR           (1 << 5)
#define         GUISHARED              (1 << 6)
#define         GUIBRKSUBMENU          (1 << 7)
#define         GUICHECKEDMENUITEM     (1 << 8)
#define         GUINDMENUITEM          (1 << 9)
#define         GUICHECKMENUITEM       (1 << 10)

#ifdef __EMXPM__
#include "PMbitchx.h"
#elif defined(GTK)
#include "gtkbitchx.h"
#elif defined(WIN32)
#include "winbitchx.h"
#endif

#define EVNONE    	0
#define EVMENU    	1
#define EVFOCUS   	2
#define EVREFRESH 	3
#define EVSTRACK  	4
#define EVSUP     	5
#define EVSDOWN   	6
#define EVSUPPG   	7
#define EVSDOWNPG 	8
#define EVKEY     	9
#define EVFILE    	10
#define EVTITLE		11
#define EVPASTE		12
#define EVDELETE	13

#define COLOR_INACTIVE	0
#define COLOR_ACTIVE	1
#define COLOR_HIGHLIGHT	2

#include "struct.h"
/* These are all the functions that each GUI module must provide for 
   a clean port to other GUI OSes. 

   gui_init() - main initialization routine.
   */
void gui_init(void);
void gui_clreol(void);
void gui_gotoxy(int col, int row);
void gui_clrscr(void);
void gui_left(int num);
void gui_right(int num);
void gui_scroll(int top, int bot, int n);
void gui_flush(void);
void gui_puts(unsigned char *buffer);
void gui_new_window(Screen *new, Window *win);
void gui_kill_window(Screen *killscreen);
void gui_settitle(char *titletext, Screen *screen);
void gui_font_dialog(Screen *screen);
void gui_file_dialog(char *type, char *path, char *title, char *ok, char *apply, char *code, char *szButton);
void gui_properties_notebook(void);
void gui_msgbox(void);
void gui_popupmenu(char *menuname);
void gui_paste(char *args);
void gui_setfocus(Screen *screen);
void gui_scrollerchanged(Screen *screen, int position);
void gui_query_window_info(Screen *screen, char *fontinfo, int *x, int *y, int *cx, int *cy);
void gui_play_sound(char *filename);
void gui_get_sound_error(int errnum, char *errstring);
void gui_menu(Screen *screen, char *addmenu);
void gui_exit(void);
void gui_screen(Screen *new);
void gui_resize(Screen *new);
int gui_send_mci_string(char *mcistring, char *retstring);
int gui_isset(Screen *screen, fd_set *rd, int what);
int gui_putc(int c);
int gui_read(Screen *screen, char *buffer, int maxbufsize);
int gui_screen_width(void);
int gui_screen_height(void);
void gui_setwindowpos(Screen *screen, int x, int y, int cx, int cy, int top, int bottom, int min, int max, int restore, int activate, int size, int position);
void gui_font_init(void);
void gui_font_set(char *font, Screen *screen);
void BX_gui_mutex_lock(void);
void BX_gui_mutex_unlock(void);
int gui_setmenuitem(char *menuname, int refnum, char *what, char *param);
void gui_remove_menurefs(char *menu);
void gui_mdi(Window *, char *, int);
void gui_update_nicklist(char *);
void gui_nicklist_width(int, Screen *);
void gui_startup(int argc, char *argv[]);
void gui_about_box(char *about_text);
void gui_activity(int color);
void gui_setfileinfo(char *filename, char *nick, int server);
void gui_setfd(fd_set *rd);

/* These are just miscellaneous GUI function declarations */
MenuStruct *findmenu(char *menuname);
void sendevent(unsigned int event, unsigned int window);

/* A fix for different systems declaring tputs differently */
#ifdef GTK
#ifdef __sun__
int      gtkputs (const char *str, int n, int (*blah)(int));
#else
int      gtkputs __P((const char *str, int n, int (*blah)(int)));
#endif
#define tputs gtkputs
#endif

#define current_screen      last_input_screen
#define INPUT_BUFFER        current_screen->input_buffer
#define ADD_TO_INPUT(x)     strmcat(INPUT_BUFFER, (x), INPUT_BUFFER_SIZE);

#endif
#endif

--- NEW FILE: alist.h ---
/*
 * alist.h -- resizeable arrays
 * Copyright 1997 EPIC Software Labs
 */

#ifndef __alist_h__
#define __alist_h__

#include "irc.h"
#include "ircaux.h"

/*
 * Anyone have any ideas how to optimize this further?
 */

#ifdef _cs_alist_hash_
static __inline u_32int_t 	cs_alist_hash (const char *s, u_32int_t *mask)
{
	register u_32int_t	x = 0;
#if 0
	register char *p = (char *)s;
	register int len = 4;

	for (; *p && len != -1; p++, len--)
		x = (x >> 4) + *p << 24, *mask = *mask << 4 && 0xff;
#else
	if (s[0] != 0)
	{
		if (s[1] == 0)
			x = (s[0] << 24), 
				*mask = 0xff000000;
		else if (s[2] == 0)
			x = (s[0] << 24) | (s[1] << 16), 
				*mask = 0xffff0000;
		else
			x = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3], 
				(*mask = 0xffffff00 | (s[3] ? 0xff : 0x00));
	}
#endif
	return x;
}
#endif

#ifdef _ci_alist_hash_
static __inline u_32int_t 	ci_alist_hash (const char *s, u_32int_t *mask)
{
	register u_32int_t	x = 0;
#if 0
	register char *p = (char *)s;
	register int len = 4;

	for (; *p && len != -1; p++, len--)
		x = (x << 4) + toupper(*p);
#else
	if (s[0] != 0)
	{
		if (s[1] == 0)
			x = (stricmp_table[(int)s[0]] << 24), 
				*mask = 0xff000000;
		else if (s[2] == 0)
			x = (stricmp_table[(int)s[0]] << 24) | (stricmp_table[(int)s[1]] << 16), 
				*mask = 0xffff0000;
		else
			x = (stricmp_table[(int)s[0]] << 24) | (stricmp_table[(int)s[1]] << 16) | (stricmp_table[(int)s[2]] << 8) | stricmp_table[(int)s[3]], 
				(*mask = 0xffffff00 | (s[3] ? 0xff : 0x00));
	}
#endif
	return x;
}
#endif

/*
 * Everything that is to be filed with this system should have an
 * identifying name as the first item in the struct.
 */
typedef struct
{
	char *name;
	u_32int_t hash;	
} Array_item;

typedef int (*alist_func) (const char *, const char *, size_t);
typedef enum {
	HASH_INSENSITIVE,
	HASH_SENSITIVE
} hash_type;

/*
 * This is the actual list, that contains structs that are of the
 * form described above.  It contains the current size and the maximum
 * size of the array.
 */
typedef struct
{
	Array_item **list;
	int max;
	int total_max;
	alist_func func;
	hash_type hash;
} Array;

Array_item *BX_add_to_array	(Array *, Array_item *);
Array_item *BX_remove_from_array	(Array *, char *);
Array_item *BX_array_pop		(Array *, int);

Array_item *BX_remove_all_from_array (Array *, char *);
Array_item *BX_array_lookup	(Array *, char *, int wild, int delete);
Array_item *BX_find_array_item	(Array *, char *, int *cnt, int *loc);

void *BX_find_fixed_array_item	(void *Array, size_t size, int siz, char *, int *cnt, int *loc);

#endif

--- NEW FILE: lastlog.h ---
/*
 * lastlog.h: header for lastlog.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: lastlog.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __lastlog_h_
#define __lastlog_h_

#define LOG_NONE	0x00000000
#define LOG_CURRENT	0x00000000
#define LOG_CRAP	0x00000001
#define LOG_PUBLIC	0x00000002
#define LOG_MSG		0x00000004
#define LOG_NOTICE	0x00000008
#define LOG_WALL	0x00000010
#define LOG_WALLOP	0x00000020
#define LOG_NOTES	0x00000040
#define LOG_OPNOTE	0x00000080
#define	LOG_SNOTE	0x00000100
#define	LOG_ACTION	0x00000200
#define	LOG_DCC		0x00000400
#define LOG_CTCP	0x00000800
#define	LOG_USER1	0x00001000
#define LOG_USER2	0x00002000
#define LOG_USER3	0x00004000
#define LOG_USER4	0x00008000
#define LOG_USER5	0x00010000
#define LOG_BEEP	0x00020000
#define LOG_TCL		0x00040000
#define LOG_SEND_MSG	0x00080000
#define LOG_KILL	0x00100000
#define LOG_MODE_USER	0x00200000
#define LOG_MODE_CHAN	0x00400000
#define LOG_KICK	0x00800000
#define LOG_KICK_USER	0x01000000
#define LOG_PART	0x02000000
#define LOG_INVITE	0x04000000
#define LOG_JOIN	0x08000000
#define LOG_TOPIC	0x10000000
#define LOG_HELP	0x20000000
#define LOG_NOTIFY	0x40000000
#define LOG_DEBUG	0x80000000

#define LOG_ALL (LOG_CRAP | LOG_PUBLIC | LOG_MSG | LOG_NOTICE | LOG_WALL | \
		LOG_WALLOP | LOG_NOTES | LOG_OPNOTE | LOG_SNOTE | LOG_ACTION | \
		LOG_CTCP | LOG_DCC | LOG_USER1 | LOG_USER2 | LOG_USER3 | \
		LOG_USER4 | LOG_USER5 | LOG_BEEP | LOG_TCL | LOG_SEND_MSG | \
		LOG_MODE_USER | LOG_MODE_CHAN | LOG_KICK_USER | LOG_KICK | \
		LOG_PART | LOG_INVITE | LOG_JOIN | LOG_TOPIC | LOG_HELP | \
		LOG_KILL | LOG_NOTIFY)

# define LOG_DEFAULT	LOG_NONE

	void	set_lastlog_level (Window *, char *, int);
unsigned long	BX_set_lastlog_msg_level (unsigned long);
	void	set_lastlog_size (Window *, char *, int);
	void	set_notify_level (Window *, char *, int);
	void	set_msglog_level (Window *, char *, int);
	void	set_new_server_lastlog_level(Window *, char *, int);
	
	BUILT_IN_COMMAND(lastlog);

	void	add_to_lastlog (Window *, const char *);
	char	*bits_to_lastlog_level (unsigned long);
unsigned long	real_lastlog_level (void);
unsigned long	real_notify_level (void);
unsigned long	parse_lastlog_level (char *, int);
	int	islogged (Window *);
extern	void	remove_from_lastlog (Window *);
extern	int	grab_http (char *, char *, char *);

BUILT_IN_FUNCTION(function_line);
BUILT_IN_FUNCTION(function_lastlog);

extern unsigned long beep_on_level;
extern unsigned long new_server_lastlog_level;

	void	set_beep_on_msg(Window *, char *, int);
	Lastlog *get_lastlog_current_head(Window *);
	void	free_lastlog(Window *);
	int	logmsg(unsigned long, char *, int, char *, ...);
	void	reset_hold_mode(Window *);
		  				
#endif /* __lastlog_h_ */

--- NEW FILE: flood.h ---
/*
 * flood.h: header file for flood.c
 *
 * @(#)$Id: flood.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __flood_h_
#define __flood_h_

	int	BX_check_flooding (char *, int, char *, char *);
	int	BX_is_other_flood (ChannelList *, NickList *, int, int *);
	int	BX_flood_prot (char *, char *, char *, int, int, char *);
	void	clean_flood_list (void);		

#define MSG_FLOOD 	0x0001
#define PUBLIC_FLOOD 	0x0002
#define NOTICE_FLOOD	0x0004
#define WALL_FLOOD	0x0008
#define WALLOP_FLOOD	0x0010
#define CTCP_FLOOD	0x0020
#define INVITE_FLOOD	0x0040
#define CDCC_FLOOD	0x0080
#define CTCP_ACTION_FLOOD	0x0100
#define NICK_FLOOD	0x0200
#define DEOP_FLOOD	0x0400
#define KICK_FLOOD	0x0800
#define JOIN_FLOOD	0x1000

#include "hash.h"
#define FLOOD_HASHSIZE 31
extern HashEntry no_flood_list[FLOOD_HASHSIZE];

#endif /* __flood_h_ */

--- NEW FILE: funny.h ---
/*
 * funny.h: header for funny.c
 *
 * written by michael sandrof
 *
 * copyright(c) 1990 
 *
 * see the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: funny.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __funny_h_
#define __funny_h_

#define FUNNY_PUBLIC 1
#define FUNNY_PRIVATE 2
#define FUNNY_TOPIC  4
#define FUNNY_WIDE   8
#define FUNNY_USERS  16
#define FUNNY_NAME   32

	void	set_funny_flags (int, int, int);
	void	funny_set_ignore_mode (void);
	int	funny_is_ignore_channel (void);
	void	funny_set_ignore_channel (char *);
	void	funny_match (char *);
	void	reinstate_user_modes (void);
	void	funny_print_widelist (void);
	void	funny_list (char *, char **);
	void	funny_mode (char *, char **);
	void	funny_namreply (char *, char **);
	void	update_user_mode (char *);

#endif /* __funny_h_ */

--- NEW FILE: exec.h ---
/*
 * exec.h: header for exec.c 
 *
 * Copyright 1990 Michael Sandrof
 * Copyright 1997 EPIC Software Labs
 * See the Copyright file for license information
 */

#ifndef __exec_h__
#define	__exec_h__

	void	execcmd 		(char *, char *, char *, char *);
	void	do_processes		(fd_set *);
	int	get_child_exit		(pid_t);
	void	clean_up_processes	(void);
	int	text_to_process		(int, const char *, int);
	void	exec_server_delete 	(int);
	void	add_process_wait	(int, const char *);
	int	get_process_index	(char **);  /* XXXX */
	int	is_valid_process	(const char *);
	int	process_is_running	(char *);
        int     logical_to_index        (const char *logical);
        void	kill_process		(int, int);

#endif /* _EXEC_H_ */

--- NEW FILE: parse.h ---
/*
 * parse.h
 *
 * written by matthew green
 * copyright (c) 1993
 *
 * @(#)$Id: parse.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __parse_h_
#define __parse_h_

typedef struct {
	const char	*command;
	void 		(*inbound_handler) (char *, char **);
	void		(*outbound_handler) (char *);
	int		flags;
	unsigned long	bytes;
	unsigned long	count;
} protocol_command;
extern 	protocol_command rfc1459[];
extern	int		 num_protocol_cmds;

#define PROTO_NOQUOTE 	1 << 0
#define PROTO_DEPREC	1 << 1



	char	*BX_PasteArgs (char **, int);
	int	BX_BreakArgs (char *, char **, char **, int);
	void	parse_server (char *);
	void	irc2_parse_server (char *);
	int	annoy_kicks (int, char *, char *, char *, NickList *);
	int	ctcp_flood_check (char *, char *, char *);
	void	load_scripts (void);
	int	check_auto_reply (char *);
					
extern	char	*FromUserHost;
extern	char	*last_split_server;
extern	char	*last_split_from;
extern	int	in_server_ping;
extern	int	doing_privmsg;

#define WAIT_WHO 0
#define WAIT_BANS 1
#define WAIT_MODE 2

#define MAXPARA 15


#endif /* __parse_h_ */

--- NEW FILE: hook.h ---
/*
 * hook.h.proto: header for hook.c
 * 
 * Generated from hook.h.proto automatically by the Makefile
 *
 * @(#)$Id: hook.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __hook_h_
# define __hook_h_

enum HOOK_TYPES {
	ACTION_LIST,
	BANS_LIST,
	BANS_FOOTER_LIST,
	BANS_HEADER_LIST,
	CDCC_NOTE_LIST,
	CDCC_PACK_LIST,
	CDCC_POSTPACK_LIST,
	CDCC_PREPACK_LIST,
	CDCC_QUEUE_LIST,
	CDCC_QUEUEH_LIST,
	CDCC_SEND_NICK_LIST,
	CDCC_STATS_LIST,
	CHANOP_LIST,
	CHANNEL_NICK_LIST,
	CHANNEL_SIGNOFF_LIST,
	CHANNEL_STATS_LIST,
	CHANNEL_SWITCH_LIST,
	CHANNEL_SYNCH_LIST,
	CLONE_LIST,
	CONNECT_LIST,
	CTCP_LIST,
	CTCP_REPLY_LIST,
	DCC_CHAT_LIST,
	DCC_CONNECT_LIST,
	DCC_ERROR_LIST,
	DCC_HEADER_LIST,
	DCC_LOST_LIST,
	DCC_OFFER_LIST,
	DCC_POST_LIST,
	DCC_RAW_LIST,
	DCC_REQUEST_LIST,
	DCC_STAT_LIST,
	DCC_STATF_LIST,
	DCC_STATF1_LIST,
	DCC_TRANSFER_STAT_LIST,
	DCC_UPDATE_LIST,
	DEBUG_LIST,
	DESYNC_MESSAGE_LIST,
	DISCONNECT_LIST,
	EBANS_LIST,
	EBANS_FOOTER_LIST,
	EBANS_HEADER_LIST,
	ENCRYPTED_NOTICE_LIST,
	ENCRYPTED_PRIVMSG_LIST,
	EXEC_LIST,
	EXEC_ERRORS_LIST,
	EXEC_EXIT_LIST,
	EXEC_PROMPT_LIST,
	EXIT_LIST,
	FLOOD_LIST,
	FTP_LIST,
	HELP_LIST,
	HELPSUBJECT_LIST,
	HELPTOPIC_LIST,
	HOOK_LIST,
	IDLE_LIST,
	INPUT_LIST,
	INVITE_LIST,
	JOIN_LIST,
	JOIN_ME_LIST,
	KICK_LIST,
	LEAVE_LIST,
	LEAVE_ME_LIST,
	LIST_LIST,
	LLOOK_ADDED_LIST,
	LLOOK_JOIN_LIST,
	LLOOK_SPLIT_LIST,
	MAIL_LIST,
	MODE_LIST,
	MODE_STRIPPED_LIST,
	MODULE_LIST,
	MSG_LIST,
	MSG_GROUP_LIST,
	MSGLOG_LIST,
	NAMES_LIST,
	NETSPLIT_LIST,
	NICK_COMP_LIST,
	NICKNAME_LIST,
	NOTE_LIST,
	NOTICE_LIST,
	NOTIFY_LIST,
	NOTIFY_HEADER_LIST,
	NOTIFY_SIGNOFF_LIST,
	NOTIFY_SIGNON_LIST,
	NSLOOKUP_LIST,
	ODD_SERVER_STUFF_LIST,
	PASTE_LIST,
	PUBLIC_LIST,
	PUBLIC_AR_LIST,
	PUBLIC_MSG_LIST,
	PUBLIC_NOTICE_LIST,
	PUBLIC_OTHER_LIST,
	PUBLIC_OTHER_AR_LIST,
	RAW_IRC_LIST,
	REDIRECT_LIST,
	REPLY_AR_LIST,
	SAVEFILE_LIST,
	SAVEFILEPOST_LIST,
	SAVEFILEPRE_LIST,
	SEND_ACTION_LIST,
	SEND_CTCP_LIST,
	SEND_DCC_CHAT_LIST,
	SEND_MSG_LIST,
	SEND_NOTICE_LIST,
	SEND_PUBLIC_LIST,
	SEND_TO_SERVER_LIST,
	SERVER_NOTICE_FAKES_LIST,
	SERVER_NOTICE_FAKES_MYCHANNEL_LIST,
	SERVER_NOTICE_FOREIGN_KILL_LIST,
	SERVER_NOTICE_KILL_LIST,
	SERVER_NOTICE_LIST,
	SERVER_NOTICE_LOCAL_KILL_LIST,
	SERVER_NOTICE_SERVER_KILL_LIST,
	SET_LIST,
	SHITLIST_LIST,
	SHITLIST_FOOTER_LIST,
	SHITLIST_HEADER_LIST,
	SHOWIDLE_FOOTER_LIST,
	SHOWIDLE_HEADER_LIST,
	SHOWIDLE_LIST,
	SIGNOFF_LIST,
	SILENCE_LIST,
	SOCKET_LIST,
	SOCKET_NOTIFY_LIST,
	STAT_LIST,
	STAT_FOOTER_LIST,
	STAT_HEADER_LIST,
	STATUS_UPDATE_LIST,
	SWITCH_CHANNELS_LIST,
	TIMER_LIST,
	TIMER_HOUR_LIST,
	TOPIC_LIST,
	URLGRAB_LIST,
	USAGE_LIST,
	USERLIST_LIST,
	USERLIST_FOOTER_LIST,
	USERLIST_HEADER_LIST,
	USERS_LIST,
	USERS_FOOTER_LIST,
	USERS_HEADER_LIST,
	USERS_IP_LIST,
	USERS_SERVER_LIST,
	USERS_SERVER_HEADER_LIST,
	WALL_LIST,
	WALLOP_LIST,
	WATCH_LIST,
	WHO_LIST,
	WHOLEFT_LIST,
	WHOLEFT_FOOTER_LIST,
	WHOLEFT_HEADER_LIST,
	WIDELIST_LIST,
	WINDOW_LIST,
	WINDOW_CREATE_LIST,
	WINDOW_FOCUS_LIST,
	WINDOW_KILL_LIST,
	WINDOW_SWAP_LIST,
	YELL_LIST,
	ZZZ_ALWAYS_COMES_LAST_IN_THIS_LIST
};

#define NUMBER_OF_LISTS ZZZ_ALWAYS_COMES_LAST_IN_THIS_LIST

	int	BX_do_hook 		(int, char *, ...);
	void	flush_on_hooks 		(void);
	void	unload_on_hooks		(char *);
	BUILT_IN_COMMAND(shookcmd);
	BUILT_IN_COMMAND(oncmd);
	void	save_hooks 		(FILE *, int);
	void	do_stack_on		(int, char *);
extern	HookFunc hook_functions[];

#endif /* __hook_h_ */

--- NEW FILE: server.h ---
/*
 * server.h: header for server.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: server.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __server_h_
#define __server_h_
  
/* for ChannelList */
#include "who.h"
#include "names.h"
#include "struct.h"
#include "ssl.h"

/*
 * type definition to distinguish different
 * server versions
 */
#define Server2_7	0
#define Server2_8	1
#define Server2_9	2
#define Server2_10	3
#define Server2_8ts4	4
#define Server2_8hybrid 5
#define Server2_8hybrid6 6
#define Server2_8comstud 7

#define Server_u2_8     10
#define Server_u2_9     11
#define Server_u2_10	12
#define Server_u3_0     13

struct notify_stru;

typedef struct _queued_send
{
	struct _queued_send *next;
	int	server;
	int	des;
	char	*buffer;
} QueueSend;

typedef struct _sping_ {
	struct _sping_ *next;
	char *sname;
#ifdef HAVE_GETTIMEOFDAY
	struct timeval in_sping;
#else
	time_t in_sping;
#endif
} Sping;


/* Server: a structure for the server_list */
typedef	struct
{
	char	*name;			/* the name of the server */
	char	*itsname;		/* the server's idea of its name */
	char	*password;		/* password for that server */
	char	*snetwork;
	char	*cookie;		/* TS4 op cookie */
	int	port;			/* port number on that server */

	char	*nickname;		/* nickname for this server */
	char    *s_nickname;            /* last NICK command sent */
	char    *d_nickname;            /* Default nickname to use */
	char	*userhost;
	int     fudge_factor;           /* How much s_nickname's fudged */
	int     nickname_pending;       /* Is a NICK command pending? */
	int     orignick_pending;       /* Is a ORIGNICK command pending? */
	int     server_change_pending;  /* We are waiting for a server change */

	char	*away;			/* away message for this server */
	time_t  awaytime;
	int	operator;		/* true if operator */
	int	server2_8;
	int	version;		/* the version of the server -
					 * defined above */
	char	*version_string;	/* what is says */
	int	whois;			/* true if server sends numeric 318 */
	long	flags;			/* Various flags */
	long	flags2;
	int	login_flags;		/* server login flags */
	char	*umodes;
	char    umode[80];		/* User Mode storage */ 
	int	connected;		/* true if connection is assured */
	int	write;			/* write descriptor */
	int	read;			/* read descriptior */
	int	eof;			/* eof flag for server */
	int	motd;			/* motd flag (used in notice.c) */
	int	sent;			/* set if something has been sent,
					 * used for redirect */
	int	lag;			/* indication of lag from server CDE*/
	time_t	lag_time;		/* time ping sent to server CDE */
	time_t	last_msg;		/* last mesg recieved from the server CDE */

	time_t		last_sent;	/* last mesg time sent */
	QueueSend 	*queue;		/* queue of lines to send to a server */	

	char	*buffer;		/* buffer of what dgets() doesn't get */


	WhoEntry	*who_queue;	/* Who queue */
	IsonEntry	*ison_queue;	/* Ison queue */
	UserhostEntry	*userhost_queue;/* Userhost queue */

	NotifyList	notify_list;	/* Notify list for this server */
	NotifyList	watch_list;	/* Watch list for this server */
	int		watch;		/* dalnet watch. available */
	int	copy_from;		/* server to copy the channels from
					 * when (re)connecting */
	int	ctcp_dropped;		/* */
	int	ctcp_not_warned;	/* */
	time_t	ctcp_last_reply_time;	/* used to limit flooding */

	struct sockaddr_foobar local_addr;      /* ip address of this connection */
	struct sockaddr_foobar uh_addr;		/* ip address of this connection */
	struct sockaddr_foobar local_sockname; /* sockname of this connection */

	ChannelList	*chan_list;	/* list of channels for this server */
	int	in_delay_notify;
	int	link_look;
	time_t	link_look_time;
	int	trace_flags;
	int	in_who_kill;
	int	in_trace_kill;
	int	stats_flags;
	int	in_timed_server;

	char	*redirect;

	irc_server *tmplink;	/* list of linked servers */
	irc_server *server_last;/* list of linked servers */
	irc_server *split_link; /* list of linked servers */

	void	(*parse_server) (char *);	/* pointer to parser for this server */
	unsigned long ircop_flags;
	Sping	*in_sping;
	int reconnects;
	int reconnecting;
	int reconnect;
	int closing;
	int retries;
	int try_once;
	int old_server;
	int req_server;
	int server_change_refnum;
#ifdef NON_BLOCKING_CONNECTS
	int connect_wait;
	int c_server;
	int from_server;
#endif
	char *orignick;
	time_t connect_time;
#if defined(HAVE_SSL) && !defined(IN_MODULE)   
	SSL_CTX* ctx;
	int enable_ssl;
	int ssl_error;
	SSL* ssl_fd;
#endif
}	Server;

typedef struct ser_group_list
{
	struct ser_group_list	*next;
	char	*name;
	int	number;
}	SGroup;

typedef	unsigned	short	ServerType;

	int	find_server_group (char *, int);
	char *	find_server_group_name (int);

	void	BX_add_to_server_list (char *, int, char *, char *, char *, int, int);
	int	BX_build_server_list (char *);
	int	connect_to_server (char *, int, int);
	void	BX_get_connected (int, int);
	void	try_connect (int, int);
	int	BX_read_server_file (char *);
	void	BX_display_server_list (void);
	void	do_server (fd_set *, fd_set *);
	int	BX_connect_to_server_by_refnum (int, int);
	int	BX_find_server_refnum (char *, char **);
	
	void	BX_set_server_cookie (int, char *);
	char	*BX_get_server_cookie (int);
	
extern	int	attempting_to_connect;
/*extern	int	number_of_servers;*/
extern	int	connected_to_server;
extern	int	never_connected;
extern	int	primary_server;
extern	int	from_server;
extern 	int	last_server;
extern	int	parsing_server_index;

extern	SGroup	*server_group_list;

	void	servercmd (char *, char *, char *, char *);
	char	*BX_get_server_nickname (int);
	char	*BX_get_server_name (int);
	char	*BX_get_server_itsname (int);
	char	*get_server_pass (int);
	int	BX_find_in_server_list (char *, int);
	char	*BX_create_server_list (char *);
	void	BX_set_server_motd (int, int);
	int	BX_get_server_motd (int);
	int	BX_get_server_operator (int);
	int	BX_get_server_version (int);
	void	BX_close_server (int, char *);
	int	BX_is_server_connected (int);
	void	BX_flush_server (void);
	void	BX_set_server_operator (int, int);
	void	BX_server_is_connected (int, int);
	int	BX_parse_server_index (char *);
	void	BX_parse_server_info (char *, char **, char **, char **, char **);
	long	set_server_bits (fd_set *, fd_set *);
	void	BX_set_server_itsname (int, char *);
	void	BX_set_server_version (int, int);
	char	*BX_get_possible_umodes(int);
		
	int	BX_is_server_open (int);
	int	BX_get_server_port (int);
	
	int	BX_get_server_lag (int);
	void	BX_set_server_lag (int, int);
	time_t	get_server_lagtime (int);
	void	set_server_lagtime (int, time_t);
	
	char	*BX_set_server_password (int, char *);
	void	BX_set_server_nickname (int, char *);

	void	BX_set_server2_8 (int , int);
	int	BX_get_server2_8 (int);

	void	BX_close_all_server (void);
	void	disconnectcmd (char *, char *, char *, char *);
	char	*BX_get_umode (int);
	int	BX_server_list_size (void);

	void    BX_set_server_away                 (int, char *, int);
	char *  BX_get_server_away                 (int);
	time_t	get_server_awaytime		(int);
	void	set_server_awaytime		(int, time_t);

	void    server_redirect                 (int, char *);
	int     BX_check_server_redirect           (char *);
	char *	BX_get_server_network		(int);
	void	BX_server_disconnect		(int, char *);
	void	send_from_server_queue		(void);
	void	clear_sent_to_server		(int);
	int	sent_to_server			(int);
	void	BX_set_server_flag			(int, int, int);
	int	BX_get_server_flag			(int, int);
	char *	get_server_userhost		(int);
	void	got_my_userhost			(UserhostItem *item, char *nick, char *stuff);
	void	BX_set_server_version		(int, int);
	int	BX_get_server_version		(int);
	void	set_server_version_string	(int, const char *);
	char *	get_server_version_string	(int);

	void	BX_set_server_redirect		(int, const char *);
	char *	BX_get_server_redirect		(int);
		
	void	change_server_nickname		(int, char *);
	void	register_server			(int, char *);
	void	BX_fudge_nickname			(int, int);
	char	*BX_get_pending_nickname		(int);
	void	accept_server_nickname		(int, char *);
	void	BX_reset_nickname			(int);
	void	nick_command_is_pending		(int, int);
	void	orignick_is_pending		(int, int);
	int	is_orignick_pending		(int);

	void	set_server_ircop_flags		(int, unsigned long);
unsigned long	get_server_ircop_flags		(int);	
extern		void	start_identd		(void);

	void	set_server_in_timed		(int, int);
	int	get_server_in_timed		(int);
	time_t	get_server_lastmsg		(int);
	
	int	close_all_servers		(char *);
	void close_unattached_servers (void);
	void close_unattached_server(int);

	void	set_server_orignick		(int, char *);
	char	*get_server_orignick		(int);

ChannelList	*BX_get_server_channels		(int);
	void	BX_set_server_channels		(int, ChannelList *);		
	void	BX_add_server_channels		(int, ChannelList *);
	void	set_server_channels_server	(int);
	int	get_server_channels_server	(int);
	
	int	BX_get_server_trace_flag		(int);
	void	BX_set_server_trace_flag		(int, int);
	int	BX_get_server_stat_flag		(int);
	void	BX_set_server_stat_flag		(int, int);

	void	set_server_reconnect		(int, int);
	void	set_server_reconnecting		(int, int);
	void set_server_old_server		(int, int);
	void set_server_req_server		(int, int);
	void set_server_retries		(int, int);
	void set_server_try_once	(int, int);
	void set_server_change_refnum	(int, int);
	int	get_server_reconnect		(int);
	int	get_server_reconnecting		(int);
	int get_server_change_pending   (int);
#ifdef HAVE_SSL
	void set_server_ssl(int, int);
	int get_server_ssl(int);
#endif
    int is_server_valid(char *name, int server);

#if 0
#ifdef HAVE_GETTIMEOFDAY
struct	timeval	get_server_sping		(int);
	void	set_server_sping		(int, struct timeval);
#else
	time_t	get_server_sping		(int);
	void	set_server_sping		(int, time_t);
#endif
#endif
	Sping	*get_server_sping		(int, char *);
	void	clear_server_sping		(int, char *);
	void	set_server_sping		(int, Sping *);

	int	BX_get_server_trace_kill		(int);
	void	BX_set_server_trace_kill		(int, int);

	void	BX_set_server_last_ctcp_time	(int, time_t);
	time_t	BX_get_server_last_ctcp_time	(int);

	int	BX_get_server_linklook		(int);
	void	BX_set_server_linklook		(int, int);
	time_t	BX_get_server_linklook_time	(int);
	void	BX_set_server_linklook_time	(int, time_t);
	int	BX_get_server_read			(int);
	int	get_server_watch		(int);
	void	set_server_watch		(int, int);

	void	set_userhost_queue_top		(int, UserhostEntry *);
	UserhostEntry *userhost_queue_top	(int);

	void	set_ison_queue_top		(int, IsonEntry *);
	IsonEntry *ison_queue_top		(int);

	void	set_who_queue_top		(int, WhoEntry *);
	WhoEntry *who_queue_top			(int);

	void reconnect_server(int *, int *, time_t *);
	int finalize_server_connect(int, int, int);
	int next_server(int);
	void	do_idle_server (void);

/* XXXXX ick, gross, bad.  XXXXX */
void password_sendline (char *data, char *line);

	Server	*BX_get_server_list		(void);

	int	get_server_local_port		(int);
struct sockaddr_foobar	get_server_local_addr		(int);
struct sockaddr_foobar	get_server_uh_addr		(int);
NotifyItem	*get_server_notify_list		(int);
	void	BX_send_msg_to_nicks		(ChannelList *, int, char *);        
	void	BX_send_msg_to_channels		(ChannelList *, int, char *);        
	int	BX_is_server_queue			(void);
	int	save_servers			(FILE *);	        
	void	add_split_server		(char *, char *, int);
	irc_server *check_split_server		(char *);
	void	remove_split_server		(int, char *);
	void	clean_split_server_list		(int, time_t);
	void write_server_list(char *);
	void write_server_file (char *);
				
#define USER_MODE	0x0001
#define USER_MODE_A	USER_MODE << 0
#define USER_MODE_B	USER_MODE << 1
#define USER_MODE_C	USER_MODE << 2
#define USER_MODE_D	USER_MODE << 3
#define USER_MODE_E	USER_MODE << 4
#define USER_MODE_F	USER_MODE << 5
#define USER_MODE_G	USER_MODE << 6
#define USER_MODE_H	USER_MODE << 7
#define USER_MODE_I	USER_MODE << 8
#define USER_MODE_J	USER_MODE << 9
#define USER_MODE_K	USER_MODE << 10
#define USER_MODE_L	USER_MODE << 11
#define USER_MODE_M	USER_MODE << 12
#define USER_MODE_N	USER_MODE << 13
#define USER_MODE_O	USER_MODE << 14
#define USER_MODE_P	USER_MODE << 15
#define USER_MODE_Q	USER_MODE << 16
#define USER_MODE_R	USER_MODE << 17
#define USER_MODE_S	USER_MODE << 18
#define USER_MODE_T	USER_MODE << 19
#define USER_MODE_U	USER_MODE << 20
#define USER_MODE_V	USER_MODE << 21
#define USER_MODE_W	USER_MODE << 22
#define USER_MODE_X	USER_MODE << 23
#define USER_MODE_Y	USER_MODE << 24
#define USER_MODE_Z	USER_MODE << 25

#define LOGGED_IN	USER_MODE << 29
#define CLOSE_PENDING	USER_MODE << 30
#define CLOSING_SERVER  USER_MODE << 31
extern const char *umodes;

#define IMMED_SEND	0
#define QUEUE_SEND	1

#define LLOOK_SPLIT 0
#define CHAN_SPLIT 1

#endif /* __server_h_ */

--- NEW FILE: config.h ---
/*
 * 'new' config.h:
 *	A configuration file designed to make best use of the abilities
 *	of ircII, and trying to make things more intuitively understandable.
 *
 * Done by Carl v. Loesch <lynx at dm.unirm1.it>
 * Based on the 'classic' config.h by Michael Sandrof.
 * Copyright(c) 1991 - See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * Warning!  You will most likely have to make changes to your .ircrc file to
 * use this version of IRCII!  Please read the INSTALL and New2.2 files
 * supplied with the distribution for details!
 *
 * @(#)$Id: config.h,v 1.1.1.2 2003/07/26 07:00:32 root Exp $
 */

#ifndef __config_h_
#define __config_h_

#include "defs.h"

#define OFF	0
#define ON	1

/*
 * Set your favorite default server list here.  This list should be a
 * whitespace separated hostname:portnum:password list (with portnums and
 * passwords optional).  This IS NOT an optional definition. Please set this
 * to your nearest servers.  However if you use a seperate 'ircII.servers'
 * file and the ircII can find it, this setting is overridden.
 */
#ifndef DEFAULT_SERVER
/* 
 * some caution is required here. the \ is a continuation char and is required
 * on any servers you add into this list. also the very last server should not 
 * have a continuation char.
 *
 * List last updated: 03/24/01.  -dialtone.
 */
#define DEFAULT_SERVER  "[efnet] "\
				"irc.foxlink.net "\
				"irc.weblook2k.com "\
				"irc.wh.verio.net "\
				"irc.choopa.net "\
				"irc.easynews.com "\
				"irc.limelight.us "\
				"irc.desync.com "\
				"irc.nac.net "\
				"irc.mindspring.com "\
				"irc.secsup.org "\
				"irc.aol.com "\
				"irc.blessed.net "\
				"irc.homelien.no "\
				"irc.isprime.com "\
				"irc.servercentral.net "\
				"irc.umich.edu "\
			"[ircnet] "\
				"irc.webbernet.net "\
				"irc.stealth.net "\
				"irc.funet.fi "\
			"[dalnet] "\
				"irc.dal.net "\
			"[Undernet US] "\
				"irc.cic.net "\
				"irc.erols.com "\
				"irc3.concentric.net "\
				"irc.wwa.com "\
				"irc.oc.com "\
				"irc.wfire.net "\
				"irc.connectnet.com "\
			"[Undernet Canada] "\
				"step.polymtl.ca "\
				"oceanus.magic.ca "\
				"irc.direct.ca "\
			"[Undernet EU] "\
				"irc.tip.nl "\
				"th2-eth0.aladdin.net "\
				"ns.ensicaen.ismra.fr "\
				"irc.sol.no "\
				"alaska.mdv.gwdg.de "\
				"irc.iconz.co.nz "\
			"[nullnet] "\
				"irc.assault.org "\
				"irc.BitchX.com "\
				"irc.BitchX.org "\
				"irc.kythri.net "\
				"irc.shell-o-matic.net "\
			"[AfterNet] "\
				"irc.afternet.org "\
				"digitald.uk.afternet.org "\
				"boston.afternet.org "\
				"EU.afternet.org "\
				"US.afternet.org "\
				"infinet.ca.afternet.org "\
				"sanity.afternet.org "\
				"Frodo.AfterNet.org "\
				"Before-R.Afternet.Org "\
				"Agora.us.AfterNet.org "\
			"[opennet] "\
				"irc.securiflex.net "\
				"irc.sanitarium.org "\
				"ircd.fordys.co.uk "\
				"irc.unixbum.com "\
				"irc.aginet.com "\
				"irc.vulnerable.org "\
				"irc.got-rice.org "\
				"irc.BLUEZnet.com "\
				"irc.linux-2000.org "\
				"irc-w.clubi.net "\
				"irc.420.net "\
			"[eggdrop] "\
				"irc.eggdrop.net "\
				"raistlin.toledolink.com "\
			"[relicnet] "\
				"convicts.us.relic.net "\
			"[openprojects] "\
				"irc.freshmeat.net "\
				"irc.linux.com "\
				"irc.openprojects.net "\
			"[other] "\
				"irc.myweb.net "\
				"irc-rr.vitamina.ca "\
				"irc.phrozen.org "\
				"irc.openface.ca "\
				"irc.skie.net "\
				"irc.anynet.org "\
				"irc.slashnet.org "\
				"radon.slashnet.org "\
				"irc.dude-suit.net "\
				"irc.krushnet.org "\
				"irc.solarconnections.com"
#endif

/*
 * You must always define this. If you can't compile glob.c, let us know.
 */
#define NEED_GLOB

/* On some channels mass modes can be confusing and in some case
 * spectacular so in the interest of keeping sanity, Jordy added this
 * mode compressor to the client. It reduces the duplicate modes that
 * might occur on a channel.. it's explained in names.c much better.
 */
#define COMPRESS_MODES

/*
 * Uncomment the following if the gecos field of your /etc/passwd has other
 * information in it that you don't want as the user name (such as office
 * locations, phone numbers, etc).  The default delimiter is a comma, change
 * it if you need to. If commented out, the entire gecos field is used. 
 */
#define GECOS_DELIMITER ','

/*
 * MAIL_DELIMITER specifies the unique text that separates one mail message
 * from another in the mail spool file when using UNIX_MAIL.
 */
#define MAIL_DELIMITER "From "

/*
 * Uncomment the following to make ircII read a list of irc servers from
 * the ircII.servers file in the ircII library. This file should be
 * whitespace separated hostname:portnum*password (with the portnum and
 * password being optional). This server list will supercede the
 * DEFAULT_SERVER. 
*/
#if defined(WINNT) || defined(__EMX__)
#define SERVERS_FILE "irc-serv"
#else
#define SERVERS_FILE "ircII.servers"
#endif

/*
 * Certain versions of Tcl lib have a PLUS version which preloads the scripts
 * into the binary so that the script directory is not required to run the 
 * tcllib. This offers some benefit at the expense of a slightly larger binary.
 */
#undef TCL_PLUS

/*
 * we define the default network type for server groups. Do not just
 * undefine this.
 */
 #define DEFAULT_NETWORK "efnet"

/*
 * Below are the IRCII variable defaults.  For boolean variables, use 1 for
 * ON and 0 for OFF.  You may set string variable to NULL if you wish them to
 * have no value.  None of these are optional.  You may *not* comment out or
 * remove them.  They are default values for variables and are required for
 * proper compilation.
 */

#if !defined(__EMX__) && !defined(WINNT)
/* if this file has something in it, then we'll use it instead. */
#include "../.config.h"
#endif

#if !defined(_USE_LOCAL_CONFIG)
/* NO _USE_LOCAL_CONFIG so use these instead */

/* On some channels mass modes can be confusing and in some case
 * spectacular so in the interest of keeping sanity, Jordy added this
 * mode compressor to the client. It reduces the duplicate modes that
 * might occur on a channel.. it's explained in names.c much better.
 */
 #define COMPRESS_MODES


/*
 * Define this if you want the $glob() function to be in your client.
 * There is a case for having this functino and a case against having
 * this function:
 *
 * Pro: makes it easier to write scripts like xdcc, since they can easily
 *      get at the filenames in your xdcc directory
 * ConS8 with $unlink(), $rmdir(), etc, it makes it that much easier for
 *      a backdoor to do damage to your account.
 *
 * You will have to weigh the evidence and decide if you want to include it.
 */
#define INCLUDE_GLOB_FUNCTION

/* crisk graciously allowed me to include his hebrew modification to ircII
 * in the client. defining this variable to 1 allows that happen. It also
 * adds a HEBREW_TOGGLE variable which can turn this feature on/off
 */
#undef WANT_HEBREW

/* if you use cidentd the filename is called .authlie instead of .noident.
 * as well some modifications to the format of the file were made. So we 
 * require some pre-knowledge of what to expect. WinNT identd servers will 
 * also require this.
 */
/* one or the other of these. not both */
#undef CIDENTD
#undef WDIDENT

/* 
 * Define this if your using a hacked ident and want to fake your username.
 * maybe we could also use this to specify what file to write this hack to. 
 * Some examples are ~/.noident and ~/.authlie
 */
#undef IDENT_FAKE

/*
 * I moved this here because it seemed to be the most appropriate
 * place for it.  Define this if you want support for ``/window create''
 * and its related features.  If you dont want it, youll save some code,
 * and you wont need 'wserv', and if you do want it, you can have it in
 * all of its broken glory (no, i dont have plans to fix it =)
 * window create doesn't make any sense on Windows 95/NT.
 */
#if !defined(GUI) && defined(WINNT)
#undef WINDOW_CREATE
#else
#define WINDOW_CREATE
#endif

/*
 * Define this if you want an mIRC compatable /dcc resume capability.
 * Note that this BREAKS THE IRC PROTOCOL, and if you use this feature,
 * the behavior is NON COMPLIANT.  If this warning doesnt bother you,
 * and you really want this feature, then go ahead and #define this.
 */
#define MIRC_BROKEN_DCC_RESUME ON

/*
 * Set the following to 1 if you wish for IRCII not to disturb the tty's flow
 * control characters as the default.  Normally, these are ^Q and ^S.  You
 * may have to rebind them in IRCII.  Set it to 0 for IRCII to take over the
 * tty's flow control.
 */
#define USE_FLOW_CONTROL ON

/* 
 * Make ^Z stop the irc process by default, if undefined, ^Z will self-insert
 * by default
 */
#define ALLOW_STOP_IRC

/* And here is the port number for default client connections.  */
#define IRC_PORT 6667

/* 
 * If you define UNAME_HACK, the uname information displayed in the
 * CTCP VERSION info will appear as "*IX" irregardless of any other
 * settings.  Useful for paranoid users who dont want others to know
 * that theyre running a buggy SunOS machine. >;-)
 */
#undef UNAME_HACK

/* 
 * If you define ONLY_STD_CHARS, only "normal" characters will displayed.
 * This is recommended when you want to start BitchX in an xterm without
 * the usage of the special "vga"-font. 
 */
#undef ONLY_STD_CHARS

/*
 * Normally BitchX uses only the IBMPC (cp437) charset.
 * Define LATIN1, if you want to see the standard Latin1 characters
 * (i.e. Ä Ö Ü ä ö ü ß <-> "A "O "U "a "o "u \qs ).
 *
 * You will still be able to see ansi graphics, but there will be some
 * smaller problems (i.e. after a PageUp).
 *
 * If you use xterm there is no easy way to use both fonts at the same
 * time.  You have to decide if you use the standard (latin1) fonts or
 * vga.pcf (cp437).
 *
 * Is here there any solution to use both fonts nethertheless ?
 */
#undef LATIN1

/*
 * If you use LINUX and non ISO8859-1 fonts with custom screen mapping,
 * and if your see some pseudographics instead of your national characters,
 * define this to solve the problem.
 *
 */
#undef CHARSET_CUSTOM

/* 
 * If you want the non-ansi BitchX logo only define this ASCII_LOGO
 *
 * Note: On the console ansi graphics can be displayed just fine, even 
 * when you've defined LATIN1. The problem is that ansi graphics will look
 * ugly if you use the scroll up feature (PageUp/PageDown)
 */
#undef ASCII_LOGO

/* If you define REVERSE_WHITE_BLACK, then the format codes for black and
 * white color are revepsed. (%W, %w is bold black and black, %K, %k is bold
 * white and white). This way the default format-strings are readable on
 * a display with white background and black foreground.
 */ 
#undef REVERSE_WHITE_BLACK

/*
 * Define this if you want support for ircII translation tables.
 */
#define TRANSLATE

/*
 * WinNT and EMX probably need an ident server, so define this unless you have
 * an external one, or don't want ident support (bad idea).
 */
#if defined(WINNT) || defined(__EMX__)
#define WANT_IDENTD
#endif

/*
 * Define the name of your ircrc file here.
 */
#if defined(WINNT) || defined(__EMX__)
#define IRCRC_NAME "/irc-rc"
#else
#define IRCRC_NAME "/.ircrc"
#endif

#define DEFAULT_PING_TYPE 1
#define DEFAULT_MSGLOG ON
#define DEFAULT_AUTO_NSLOOKUP OFF
#define DEFAULT_ALT_CHARSET ON
#define DEFAULT_FLOOD_KICK ON
#define DEFAULT_FLOOD_PROTECTION ON
#define DEFAULT_CTCP_FLOOD_PROTECTION ON
#define DEFAULT_MAX_AUTOGET_SIZE 2000000
#define DEFAULT_LLOOK_DELAY 120
#define DEFAULT_ALWAYS_SPLIT_BIGGEST ON
#define DEFAULT_AUTO_UNMARK_AWAY OFF
#define DEFAULT_AUTO_WHOWAS OFF
#define DEFAULT_BANTIME 600
#define DEFAULT_BEEP ON
#define DEFAULT_BEEP_MAX 3
#define DEFAULT_BEEP_WHEN_AWAY OFF
#define DEFAULT_BOLD_VIDEO ON
#define DEFAULT_BLINK_VIDEO ON
#define DEFAULT_CHANNEL_NAME_WIDTH 10
#define DEFAULT_CLOCK ON
#define DEFAULT_CLOCK_24HOUR OFF
#define DEFAULT_COMMAND_MODE OFF
#define DEFAULT_COMMENT_HACK ON
#define DEFAULT_DCC_BLOCK_SIZE 2048
#define DEFAULT_DISPLAY ON
#define DEFAULT_DO_NOTIFY_IMMEDIATELY ON
#define DEFAULT_EIGHT_BIT_CHARACTERS ON
#define DEFAULT_EXEC_PROTECTION ON
#define DEFAULT_FLOOD_AFTER 4
#define DEFAULT_FLOOD_RATE 5
#define DEFAULT_FLOOD_USERS 10
#define DEFAULT_FLOOD_WARNING OFF
#define DEFAULT_FULL_STATUS_LINE ON
#define DEFAULT_HELP_PAGER ON
#define DEFAULT_HELP_PROMPT ON
#define DEFAULT_HIGH_BIT_ESCAPE OFF
#define DEFAULT_HIDE_PRIVATE_CHANNELS OFF
#define DEFAULT_HISTORY 100
#define DEFAULT_HOLD_MODE OFF
#define DEFAULT_HOLD_MODE_MAX 0
#define DEFAULT_INDENT ON
#define DEFAULT_INPUT_ALIASES OFF
#define DEFAULT_INSERT_MODE ON
#define DEFAULT_INVERSE_VIDEO ON
#define DEFAULT_LASTLOG 1000
#define DEFAULT_LOG OFF
#define DEFAULT_MAIL 2
#define DEFAULT_NO_CTCP_FLOOD ON
#define DEFAULT_NOTIFY_HANDLER "QUIET"
#define DEFAULT_NOTIFY_INTERVAL 60
#define DEFAULT_NOTIFY_LEVEL "ALL DCC"
#define DEFAULT_NOTIFY_ON_TERMINATION OFF
#define DEFAULT_NOTIFY_USERHOST_AUTOMATIC ON
#define DEFAULT_SCROLL_LINES ON
#define DEFAULT_SEND_IGNORE_MSG OFF
#define DEFAULT_SEND_OP_MSG ON
#define DEFAULT_SHELL_LIMIT 0
#define DEFAULT_SHOW_AWAY_ONCE ON
#define DEFAULT_SHOW_CHANNEL_NAMES ON
#define DEFAULT_SHOW_END_OF_MSGS OFF
#define DEFAULT_SHOW_NUMERICS OFF
#define DEFAULT_SHOW_STATUS_ALL OFF
#define DEFAULT_SHOW_WHO_HOPCOUNT OFF
#define DEFAULT_META_STATES 5
#define DEFAULT_IGNORE_TIME 600
#define DEFAULT_MAX_DEOPS 2
#define DEFAULT_MAX_IDLEKICKS 2
#define DEFAULT_NUM_BANMODES 4
#define DEFAULT_NUM_KICKS 1
#define DEFAULT_NUM_OF_WHOWAS 4
#define DEFAULT_NUM_OPMODES 4
#define DEFAULT_SEND_AWAY_MSG OFF
#define DEFAULT_SEND_CTCP_MSG ON
#define DEFAULT_SOCKS_PORT 1080
#define DEFAULT_AUTO_AWAY_TIME 600
#define DEFAULT_AUTO_RECONNECT ON
#define DEFAULT_AUTO_UNBAN 600
#define DEFAULT_CDCC ON
#define DEFAULT_CDCC_FLOOD_AFTER 3
#define DEFAULT_CDCC_FLOOD_RATE 4
#define DEFAULT_CTCP_DELAY 3
#define DEFAULT_CTCP_FLOOD_BAN ON
#define DEFAULT_DCC_AUTORENAME ON
#define DEFAULT_DCC_AUTORESUME OFF
#define DEFAULT_DCC_AUTORENAME_ON_NICKNAME OFF
#define DEFAULT_DCC_BAR_TYPE 0 /* 0 or 1 */
#define DEFAULT_DOUBLE_STATUS_LINE ON
#define DEFAULT_FTP_GRAB OFF
#define DEFAULT_HTTP_GRAB OFF
#define DEFAULT_HELP_WINDOW OFF
#define DEFAULT_NICK_COMPLETION ON
#define DEFAULT_NICK_COMPLETION_LEN 2
#define DEFAULT_NICK_COMPLETION_TYPE 0  /* 0 1 2 */
#define DEFAULT_NOTIFY ON
#define DEFAULT_QUEUE_SENDS 0
#define DEFAULT_MAX_SERVER_RECONNECT 2
#define DEFAULT_SERVER_GROUPS OFF
#define DEFAULT_WINDOW_DESTROY_PART OFF
#define DEFAULT_WINDOW_DESTROY_QUERY OFF
#define DEFAULT_SUPPRESS_SERVER_MOTD ON
#define DEFAULT_TAB ON
#define DEFAULT_TAB_MAX 8
#define DEFAULT_TIMESTAMP OFF
#define DEFAULT_TIMESTAMP_AWAYLOG_HOURLY ON
#define DEFAULT_TIMESTAMP_STR "%I:%M%p "
#define DEFAULT_UNDERLINE_VIDEO ON
#define DEFAULT_VERBOSE_CTCP ON
#define DEFAULT_DISPLAY_ANSI ON
#define DEFAULT_DISPLAY_PC_CHARACTERS 4
#define DEFAULT_DCC_AUTOGET OFF
#define DEFAULT_DCC_GET_LIMIT 0
#define DEFAULT_DCC_SEND_LIMIT 5
#define DEFAULT_DCC_QUEUE_LIMIT 10
#define DEFAULT_DCC_LIMIT 10
#define DEFAULT_DCCTIMEOUT 600
#define DEFAULT_FLOATING_POINT_MATH OFF
#define DEFAULT_LLOOK OFF
#define DEFAULT_CLOAK OFF
#define DEFAULT_AINV 0
#define DEFAULT_ANNOY_KICK OFF
#define DEFAULT_AOP_VAR OFF
#define DEFAULT_AUTO_AWAY ON
#define DEFAULT_KICK_OPS ON
#define DEFAULT_AUTO_REJOIN ON
#define DEFAULT_DEOPFLOOD ON
#if defined(__EMXPM__) || defined(WIN32)
#define DEFAULT_CODEPAGE 437
#endif
#define DEFAULT_CTCP_FLOOD_AFTER 3
#define DEFAULT_CTCP_FLOOD_RATE 10
#define DEFAULT_DEOPFLOOD_TIME 30
#define DEFAULT_DEOP_ON_DEOPFLOOD 3
#define DEFAULT_DEOP_ON_KICKFLOOD 3
#define DEFAULT_KICK_IF_BANNED OFF
#define DEFAULT_HACKING 0  /* 0 1 2 */
#define DEFAULT_JOINFLOOD ON
#define DEFAULT_JOINFLOOD_TIME 50
#define DEFAULT_KICKFLOOD ON
#define DEFAULT_KICKFLOOD_TIME 30
#define DEFAULT_KICK_ON_DEOPFLOOD 3
#define DEFAULT_KICK_ON_JOINFLOOD 4
#define DEFAULT_KICK_ON_KICKFLOOD 4
#define DEFAULT_KICK_ON_NICKFLOOD 3
#define DEFAULT_KICK_ON_PUBFLOOD 30
#define DEFAULT_NICKFLOOD ON
#define DEFAULT_NICKFLOOD_TIME 30
#ifdef __EMXPM__
#define DEFAULT_NICKLIST 10
#else
#define DEFAULT_NICKLIST 100
#endif
#define DEFAULT_NICKLIST_SORT 0
#define DEFAULT_LAME_IDENT OFF
#define DEFAULT_LAMELIST ON
#define DEFAULT_SHITLIST ON
#define DEFAULT_USERLIST ON
#define DEFAULT_PUBFLOOD OFF
#define DEFAULT_PUBFLOOD_TIME 20
#define DEFAULT_CONNECT_DELAY 1
#define DEFAULT_CONNECT_TIMEOUT 30
#define DEFAULT_STATUS_NO_REPEAT ON
#define DEFAULT_STATUS_DOES_EXPANDOS OFF
#define DEFAULT_DISPATCH_UNKNOWN_COMMANDS OFF
#define DEFAULT_SCROLLBACK_LINES 512
#define DEFAULT_SCROLLBACK_RATIO 50
#define DEFAULT_SCROLLERBARS ON
#define DEFAULT_ND_SPACE_MAX 160
#define DEFAULT_CPU_SAVER_AFTER 0
#define DEFAULT_CPU_SAVER_EVERY 0
#define DEFAULT_NO_FAIL_DISCONNECT OFF
#define DEFAULT_MAX_URLS 20	/* this defines the MAX number of urls saved */
#undef BITCHX_LITE
#undef EMACS_KEYBINDS	       /* change this is you have problems with 
				* your keyboard
				*/
#define EXEC_COMMAND
#undef PUBLIC_ACCESS		/* 
				 * this define removes /load /exec commands
				 */
#define DEFAULT_OPERVIEW_HIDE 0 /* defines the operview window. if hidden or not */ 
#define WANT_OPERVIEW ON
#define WANT_EPICHELP 	ON	/* epic help command. /ehelp. */
#define WANT_LLOOK	ON	/* do we want built-in llooker. */
#define WANT_CDCC	ON	/* do we want the cdcc system */
#define WANT_FTP	ON	/* do we want the ftp dcc comamnd */
#if defined(HAVE_RESOLV) && defined(HAVE_ARPA_NAMESER_H) && defined(HAVE_RESOLV_H)
#define WANT_NSLOOKUP	ON
#else
#undef WANT_NSLOOKUP
#endif
#define WANT_TABKEY	ON
#define WANT_CHELP	ON
#define WANT_USERLIST	ON
#undef HUMBLE			/* define this for a hades look */

#define WANT_DETACH OFF	/* this is here for the detach/re-attach code
			   which is essentially a mini-screen */

#define ALLOW_DETACH ON
#define DEFAULT_DETACH_ON_HUP OFF

#undef OLD_RANDOM_BEHAVIOR   /* semi randomness for random() */

#ifdef WANT_OPERVIEW
#define DEFAULT_OPER_VIEW OFF
#endif

#if defined(NON_BLOCKING_CONNECTS)
#define DEFAULT_DCC_FAST ON
#else
#define DEFAULT_DCC_FAST OFF
#endif

#endif 
/* _USE_LOCAL_CONFIG */

#define DEFAULT_KICK_REASON "Bitch-X BaBy!"
#define DEFAULT_PROTECT_CHANNELS "*"
#define DEFAULT_SHITLIST_REASON "Surplus Lamerz must go!!!!"
#define DEFAULT_BEEP_ON_MSG "MSGS"
#define DEFAULT_CMDCHARS "/"
#define DEFAULT_CONTINUED_LINE "          "
#define DEFAULT_HIGHLIGHT_CHAR "INVERSE"
#define DEFAULT_LASTLOG_LEVEL "ALL"
#define DEFAULT_MSGLOG_LEVEL "MSGS NOTICES SEND_MSG"
#define DEFAULT_LOGFILE "IrcLog"
#define DEFAULT_SHELL "/bin/sh"
#define DEFAULT_SHELL_FLAGS "-c"
#define DEFAULT_USERINFO ""
#define DEFAULT_XTERM "rxvt"
#define DEFAULT_XTERM_OPTIONS "-bg black -fg white"
#define DEFAULT_DCC_DLDIR "~"

#define DEFAULT_PAD_CHAR ' '
#define DEFAULT_USERMODE "+iw"  /* change this to the default usermode */
#define DEFAULT_OPERMODE "swfck"
#define DEFAULT_CHANMODE "+nt" /* default channel mode */

#define DEFAULT_SWATCH "KILLS,CLIENTS,TRAFFIC,REHASH,KLINE,BOTS,OPER,SQUIT,SERVER,CONNECT,FLOOD,USER,STATS,NICK,ACTIVEK"

#define DEFAULT_WORD_BREAK " \t"

#define DEFAULT_JOIN_NEW_WINDOW 0
#define DEFAULT_QUERY_NEW_WINDOW 0
#ifdef GUI
#define DEFAULT_JOIN_NEW_WINDOW_TYPE "create hide swap last double on split on"
#define DEFAULT_QUERY_NEW_WINDOW_TYPE "create hide swap last double on split on"
#else
#define DEFAULT_JOIN_NEW_WINDOW_TYPE "new hide_others swap last double on split on"
#define DEFAULT_QUERY_NEW_WINDOW_TYPE "new hide_others swap last double on split on"
#endif

#define DEFAULT_MDI OFF

#ifdef __EMX__
#define DEFAULT_FONT "6x10"
#elif defined(GTK)
#define DEFAULT_FONT "vga"
#else
#define DEFAULT_FONT "-fn vga11x19"
#endif

/*#define CLOAKED  "emacs"*/	/*
				 * define this to the program you want to
				 * show up in "ps" and "top" to hide irc
				 * from evil sys-admins.
				 */

#if !defined(NON_BLOCKING_CONNECTS) && defined(DEFAULT_DCC_FAST)
#undef DEFAULT_DCC_FAST
#define DEFAULT_DCC_FAST OFF
#endif

#if defined LATIN1
/* Make sure the keyboard works */
#undef EMACS_KEYBINDS
/* No line chars available, so better define this: */
#define ONLY_STD_CHARS 1
#endif

/*
 * on certain systems we can define NON_BLOCKING to 1
 * connects are then done alot differantly. We can perform actual work
 * in the background, while connecting. This also protects us from certain
 * "bombs" that are available.  If you have trouble with this undef
 * the NON_BLOCKING_CONNECTS. DCC sends/gets are much improved with this.
 */

#if defined(HEBREW) && !defined(TRANSLATE)
#define TRANSLATE 1
#endif
#if defined(TRANSLATE) && !defined(HEBREW)
#define HEBREW 1
#endif

#if defined(PUBLIC_ACCESS)
#undef EXEC_COMMAND
#undef WANT_TCL
#undef WANT_FTP
#endif

#if defined(WINNT) || defined(__EMX__) || defined(GUI)
#undef WANT_DETACH
#endif

/*
 * This is the filename of the identd file to use
 */
#ifdef CIDENTD
#define DEFAULT_IDENT_HACK ".authlie"
#elif defined(WDIDENT)
#define DEFAULT_IDENT_HACK ".noident"
#else
#define DEFAULT_IDENT_HACK ".noident"
#endif

#if !defined(WANT_CHATNET)
#undef WANT_CHATNET      /* define just for codelogic */
#endif

#if defined(_USE_LOCAL_CONFIG) && !defined(SHOULD_NOTIFY_BITCHX_COM)
#undef WANT_NOTIFY_BITCHX_COM
#endif

#undef PARANOID		/* #define this if your paranoid about dcc hijacking */
#undef WANT_CHAN_NICK_SERV	/* do we want to include some chan/nick/oper server commands */

/* new epic stuff */
#define OLD_STATUS_S_EXPANDO_BEHAVIOR
#define DEFAULT_NEW_SERVER_LASTLOG_LEVEL "NONE"
#define DEFAULT_RANDOM_LOCAL_PORTS 0
#define DEFAULT_RANDOM_SOURCE 0
#define DEFAULT_TERM_DOES_BRIGHT_BLINK 0


#if defined(BITCHX_LITE) && defined(WANT_TCL)
#undef BITCHX_LITE
#endif

#if defined(BITCHX_LITE)
#undef WANT_DLL
#undef WANT_TRANSLATE
#undef WANT_DETACH
#undef WANT_NSLOOKUP
#undef HEBREW
#undef CLOAKED
#undef WANT_OPERVIEW
#undef WANT_EPICHELP
#undef WANT_LLOOK
#undef WANT_CDCC
#undef WANT_FTP
#undef WANT_TABKEY
#undef WANT_CHELP
#undef WANT_USERLIST
#undef COMPRESS_MODES
#undef ALLOW_DETACH
#endif

#define DEFAULT_TKLINE_TIME 10
#define DEFAULT_BOTCHAR '.'		/* default char to enter dcc chat. */
					/* oper serv's tend to send .'s */

#define WANT_CORE

#undef OFF
#undef ON

#include "color.h"		/* all color options here. */

#endif /* __config_h_ */

--- NEW FILE: debug.h ---
/*
 * debug.h -- the runtime debug settings.  Can also be done on command line.
 */

#ifndef __X_DEBUG_H__
#define __X_DEBUG_H__

extern 	unsigned long x_debug;
extern	unsigned long internal_debug;
extern	unsigned long alias_debug;
extern	unsigned int debug_count;
extern	int in_debug_yell;

BUILT_IN_COMMAND(xdebugcmd);
void	debugyell	(const char *, ...);
void	debug_alias	(char *, int);
void	debug_hook	(char *, int);

#define DEBUG_LOCAL_VARS	1 << 0
#define DEBUG_ALIAS		1 << 1
#define DEBUG_CTCPS		1 << 2
#define DEBUG_DCC_SEARCH	1 << 3
#define DEBUG_OUTBOUND		1 << 4
#define DEBUG_INBOUND		1 << 5
#define DEBUG_DCC_XMIT		1 << 6
#define DEBUG_WAITS		1 << 7
#define DEBUG_MEMORY		1 << 8
#define DEBUG_SERVER_CONNECT	1 << 9
#define DEBUG_CRASH		1 << 10
#define DEBUG_COLOR		1 << 11
#define DEBUG_NOTIFY		1 << 12
#define DEBUG_REGEX		1 << 13
#define DEBUG_REGEX_DEBUG	1 << 14
#define DEBUG_BROKEN_CLOCK	1 << 15
#define DEBUG_UNKNOWN		1 << 16
#define DEBUG_DEBUGGER		1 << 17
#define DEBUG_NEW_MATH		1 << 18
#define DEBUG_NEW_MATH_DEBUG    1 << 19
#define DEBUG_AUTOKEY		1 << 20
#define DEBUG_STRUCTURES	1 << 21

#define DEBUG_ALL		(unsigned long)0xffffffff
#endif

--- NEW FILE: ssl.h ---
#if defined(HAVE_SSL) && !defined(IN_MODULE)

#ifndef __ssl_h__
#define __ssl_h__

#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/rand.h>

#ifndef TRUE
#define TRUE 0
#endif
#ifndef FALSE
#define FALSE 1
#endif

#define CHK_NULL(x) if ((x)==NULL) { say("SSL error - NULL data form server"); close_server(refnum, empty_string); return(-1); }
#define CHK_ERR(err,s) if ((err)==-1) {  say("SSL prime error - %s",s); close_server(refnum, empty_string); return(-1); }
#define CHK_SSL(err) if ((err)==-1) {  say("SSL CHK error - %d %d",err,SSL_get_error(server_list[refnum].ssl_fd, err)); close_server(refnum, empty_string); return(-2); }

void SSL_show_errors(void);

/* Make these what you want for cert & key files */

/*extern    SSL_CTX* ctx;*/
/*extern    SSL_METHOD *meth;*/

#endif
#endif

--- NEW FILE: help.h ---
/*
 * help.h: header for help.c
 *
 * copyright(c) 1994 matthew green
 *
 * See the copyright file, or do a help ircii copyright 
 *
 * @(#)$Id: help.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __help_h
# define __help_h

	void	help (char *, char *, char *, char *);

#endif /* __help_h */

--- NEW FILE: cdns.h ---
 /* $Id: cdns.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $ */
 
/*
 * cdns.h: header for cdns.c
 */

#ifndef _CDNS_H_
#define _CDNS_H_

/* We gotta know about the fd_set type, so we gonna inclue this  */
#include "irc.h"

#include "struct.h"
#include "newio.h"
#endif

#define MAXALIASES	35
#define MAXADDRS	35

typedef struct	_hent {
	char	*h_name;	/* official name of host */
	char	*h_aliases[MAXALIASES];	/* alias list */
	int	h_addrtype;	/* host address type */
	int	h_length;	/* length of address */
	/* list of addresses from name server */
	struct	in_addr	h_addr_list[MAXADDRS];
#define	h_addr	h_addr_list[0]	/* address, for backward compatiblity */
} my_hostent;

typedef struct dns_struct {
	/* 'in': This is the string we want to resolve. It can be
	 * either a host or ip. The string WILL be malloc'ed by
	 * the "add" function. Do NOT malloc or free this variable!
	 */
	char *in;

	/* 'out': This is our "resolved" string. It can be
	 * either a host or ip. The string WILL be malloc'ed by
	 * the internal resolver. Do NOT malloc or free this variable!
	 */
	char *out;

	/* alias: this is passed to the alias parser which then interpret's 
	 * the output.
	 */
	char *alias;
	
	/* 'callback': This is our callback function. When our 'in' gets
	 * resolved, we will call this function, with this structure
	 * as our parameter. Do NOT malloc or free this variable.
	 */
	void (*callback) (struct dns_struct *); /* Our callback function */

	/* 'callinfo': This allows us to store information that you might
	 * need for later use when in your 'callback' function. This is
	 * just a void pointer, so you MUST malloc any of the data you want to
	 * store here. Once you are done with this variable, you must
	 * free it!!! BEWARE BEWARE, YOU MUST FREE THIS VARIABLE YOURSELF!
	 */
	void *callinfo;

	/* 'ip': Internally used, to find out what the 'out' variable is.
	 * ie, is it a host, or is it ip
	 */
	int ip;

	/* hostentr: A copy of the hostent structure returned from the
	 * name server.  I am adding it here to extend the ability to
	 * read multiple IPs.  Although this is not generally necessary.
	 * - Brian Smith
	 */
	my_hostent *hostentr;

	/* 'next': Internally used. our "next" pointer. */
        struct dns_struct *next;
} DNS_QUEUE;

void start_dns(void);
void stop_dns(void);
void kill_dns(void);
void set_dns_output_fd(fd_set *);
void dns_check(fd_set *);
void check_dns_queue(void);
void add_to_dns_queue(char *, void (*) (DNS_QUEUE *), char *, void *, int);
my_hostent *duphostent(struct hostent *orig);
void freemyhostent(my_hostent *freeme);

#define DNS_URGENT 1
#define DNS_NORMAL 2

#define Q_NEXT(tmp) ((tmp)->next)
#define Q_OPEN(headp, tailp) (*(headp) = *(tailp) = NULL)


--- NEW FILE: ircterm.h ---
/*
 * term.h: header file for term.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: ircterm.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef _TERM_H_
# define _TERM_H_

#ifdef HAVE_NCURSES_H
# include <ncurses.h>
# ifdef HAVE_NCURSES_TERMCAP_H
#  include <ncurses/termcap.h>
# elif defined(HAVE_TERMCAP_H)
#  ifndef __CYGWIN__
#     include <termcap.h>
#  endif
# endif
#else
# ifdef HAVE_CURSES_H
#  include <curses.h>
# endif
# ifdef HAVE_TERMCAP_H
#  include <termcap.h>
# endif
#endif
#ifdef __EMX__
#include <termcap.h>
#endif

#include "irc_std.h"
#include "screen.h"

extern	int	need_redraw;
extern	int	meta_mode;

/* 
 * This puts a character to the current target, whatever it is. 
 * All output everywhere should go through this.
 * This does not mangle its output, so its suitable for outputting
 * escape sequences.
 */
#if !defined(WTERM_C) && !defined(WSERV_C)
#define current_ftarget (output_screen ? output_screen->fpout : stdout)

#ifdef __EMXPM__
void avio_set_var(int aviovar, int value);
int avio_get_var(int aviovar);
void avio_refresh_screen(void);
#define         AVIOREDRAW      1
#define         AVIORESIZED     2
#define         AVIOINSELECT    3
#define         AVIOINWMCHAR    4
#endif

#ifdef GUI
#include "gui.h"
#endif

#ifdef TRANSLATE
#include "translat.h"
__inline__
static int putchar_x (int c) {
#ifdef GUI
#if 1
	return gui_putc((int) (translation ? transToClient[c] : c));
#else
	return gui_putc((int) c);
#endif
#else
#if 1
	return fputc((int) (translation ? transToClient[c] : c), current_ftarget);
#else
	return fputc((int) c, current_ftarget);
#endif
#endif
}
#else
__inline__ 
static int putchar_x (int c) { 
#ifdef GUI
	return gui_putc((int) c);
#else
	return fputc((unsigned int) c, current_ftarget); 
#endif
}
#endif

__inline__
static void term_flush (void) { fflush(current_ftarget); }

#define	TERM_SGR_BOLD_ON	1
#define TERM_SGR_BOLD_OFF	2
#define TERM_SGR_BLINK_ON	3
#define TERM_SGR_BLINK_OFF	4
#define TERM_SGR_UNDL_ON	5
#define TERM_SGR_UNDL_OFF	6
#define TERM_SGR_REV_ON		7
#define TERM_SGR_REV_OFF	8
#define TERM_SGR_NORMAL		9
#define TERM_SGR_RESET		10
#define TERM_SGR_FOREGROUND	11
#define TERM_SGR_BACKGROUND	12
#define TERM_SGR_GCHAR		13
#define TERM_SGR_ALTCHAR_ON	14
#define TERM_SGR_ALTCHAR_OFF	15
#define TERM_SGR_MAXVAL		16

#define TERM_CAN_CUP		1 << 0
#define TERM_CAN_CLEAR		1 << 1
#define TERM_CAN_CLREOL		1 << 2
#define TERM_CAN_RIGHT		1 << 3
#define TERM_CAN_LEFT		1 << 4
#define TERM_CAN_SCROLL		1 << 5
#define TERM_CAN_DELETE		1 << 6
#define TERM_CAN_INSERT		1 << 7
#define TERM_CAN_DELLINES	1 << 8
#define TERM_CAN_INSLINES	1 << 9
#define TERM_CAN_REPEAT		1 << 10
#define TERM_CAN_BOLD		1 << 11
#define TERM_CAN_BLINK		1 << 12
#define TERM_CAN_UNDL		1 << 13
#define TERM_CAN_REVERSE	1 << 14
#define TERM_CAN_COLOR		1 << 15
#define TERM_CAN_GCHAR		1 << 16

#if 0
extern	char	*TI_cr, *TI_nl;
extern	int	TI_lines, TI_cols;
extern	char	*TI_sgrstrs[];
extern	char	*TI_forecolors[];
extern	char	*TI_backcolors[];
#endif

extern	int	termfeatures;


/*      Our variable name   Cap / Info      Description */

struct term_struct {
	int TI_bw;	 /* bw  / bw        cub1 wraps from column 0 to last column */
	int TI_am;	 /* am  / am        terminal has automatic margins */
	int TI_xsb;	 /* xb  / xsb       beehive (f1=escape, f2=ctrl C) */
	int TI_xhp;	 /* xs  / xhp       standout not erased by overwriting (hp) */
	int TI_xenl;	 /* xn  / xenl      newline ignored after 80 cols (concept) */
	int TI_eo;	 /* eo  / eo        can erase overstrikes with a blank */
	int TI_gn;	 /* gn  / gn        generic line type */
	int TI_hc;	 /* hc  / hc        hardcopy terminal */
	int TI_km;	 /* km  / km        Has a meta key (shift, sets parity bit) */
	int TI_hs;	 /* hs  / hs        has extra status line */
	int TI_in;	 /* in  / in        insert mode distinguishes nulls */
	int TI_da;	 /* da  / da        display may be retained above the screen */
	int TI_db;	 /* db  / db        display may be retained below the screen */
	int TI_mir;	 /* mi  / mir       safe to move while in insert mode */
	int TI_msgr;	 /* ms  / msgr      safe to move while in standout mode */
	int TI_os;	 /* os  / os        terminal can overstrike */
	int TI_eslok;	 /* es  / eslok     escape can be used on the status line */
	int TI_xt;	 /* xt  / xt        tabs destructive, magic so char (t1061) */
	int TI_hz;	 /* hz  / hz        can't print ~'s (hazeltine) */
	int TI_ul;	 /* ul  / ul        underline character overstrikes */
	int TI_xon;	 /* xo  / xon       terminal uses xon/xoff handshaking */
	int TI_nxon;	 /* nx  / nxon      padding won't work, xon/xoff required */
	int TI_mc5i;	 /* 5i  / mc5i      printer won't echo on screen */
	int TI_chts;	 /* HC  / chts      cursor is hard to see */
	int TI_nrrmc;	 /* NR  / nrrmc     smcup does not reverse rmcup */
	int TI_npc;	 /* NP  / npc       pad character does not exist */
	int TI_ndscr;	 /* ND  / ndscr     scrolling region is non-destructive */
	int TI_ccc;	 /* cc  / ccc       terminal can re-define existing colors */
	int TI_bce;	 /* ut  / bce       screen erased with background color */
	int TI_hls;	 /* hl  / hls       terminal uses only HLS color notation (Tektronix) */
	int TI_xhpa;	 /* YA  / xhpa      only positive motion for hpa/mhpa caps */
	int TI_crxm;	 /* YB  / crxm      using cr turns off micro mode */
	int TI_daisy;	 /* YC  / daisy     printer needs operator to change character set */
	int TI_xvpa;	 /* YD  / xvpa      only positive motion for vpa/mvpa caps */
	int TI_sam;	 /* YE  / sam       printing in last column causes cr */
	int TI_cpix;	 /* YF  / cpix      changing character pitch changes resolution */
	int TI_lpix;	 /* YG  / lpix      changing line pitch changes resolution */
	int TI_cols;	 /* co  / cols      number of columns in a line */
	int TI_it;	 /* it  / it        tabs initially every # spaces */
	int TI_lines;	 /* li  / lines     number of lines on screen or page */
	int TI_lm;	 /* lm  / lm        lines of memory if > line. 0 means varies */
	int TI_xmc;	 /* sg  / xmc       number of blank characters left by smso or rmso */
	int TI_pb;	 /* pb  / pb        lowest baud rate where padding needed */
	int TI_vt;	 /* vt  / vt        virtual terminal number (CB/unix) */
	int TI_wsl;	 /* ws  / wsl       number of columns in status line */
	int TI_nlab;	 /* Nl  / nlab      number of labels on screen */
	int TI_lh;	 /* lh  / lh        rows in each label */
	int TI_lw;	 /* lw  / lw        columns in each label */
	int TI_ma;	 /* ma  / ma        maximum combined attributes terminal can handle */
	int TI_wnum;	 /* MW  / wnum      maximum number of defineable windows */
	int TI_colors;	 /* Co  / colors    maximum number of colors on screen */
	int TI_pairs;	 /* pa  / pairs     maximum number of color-pairs on the screen */
	int TI_ncv;	 /* NC  / ncv       video attributes that can't be used with colors */
	int TI_bufsz;	 /* Ya  / bufsz     numbers of bytes buffered before printing */
	int TI_spinv;	 /* Yb  / spinv     spacing of pins vertically in pins per inch */
	int TI_spinh;	 /* Yc  / spinh     spacing of dots horizontally in dots per inch */
	int TI_maddr;	 /* Yd  / maddr     maximum value in micro_..._address */
	int TI_mjump;	 /* Ye  / mjump     maximum value in parm_..._micro */
	int TI_mcs;	 /* Yf  / mcs       character step size when in micro mode */
	int TI_mls;	 /* Yg  / mls       line step size when in micro mode */
	int TI_npins;	 /* Yh  / npins     numbers of pins in print-head */
	int TI_orc;	 /* Yi  / orc       horizontal resolution in units per line */
	int TI_orl;	 /* Yj  / orl       vertical resolution in units per line */
	int TI_orhi;	 /* Yk  / orhi      horizontal resolution in units per inch */
	int TI_orvi;	 /* Yl  / orvi      vertical resolution in units per inch */
	int TI_cps;	 /* Ym  / cps       print rate in characters per second */
	int TI_widcs;	 /* Yn  / widcs     character step size when in double wide mode */
	int TI_btns;	 /* BT  / btns      number of buttons on mouse */
	int TI_bitwin;	 /* Yo  / bitwin    number of passes for each bit-image row */
	int TI_bitype;	 /* Yp  / bitype    type of bit-image device */
	char *TI_cbt;	 /* bt  / cbt       back tab (P) */
	char *TI_bel;	 /* bl  / bel       audible signal (bell) (P) */
	char *TI_cr;	 /* cr  / cr        carriage return (P*) (P*) */
	char *TI_csr;	 /* cs  / csr       change region to line #1 to line #2 (P) */
	char *TI_tbc;	 /* ct  / tbc       clear all tab stops (P) */
	char *TI_clear;	 /* cl  / clear     clear screen and home cursor (P*) */
	char *TI_el;	 /* ce  / el        clear to end of line (P) */
	char *TI_ed;	 /* cd  / ed        clear to end of screen (P*) */
	char *TI_hpa;	 /* ch  / hpa       horizontal position #1, absolute (P) */
	char *TI_cmdch;	 /* CC  / cmdch     terminal settable cmd character in prototype !? */
	char *TI_cup;	 /* cm  / cup       move to row #1 columns #2 */
	char *TI_cud1;	 /* do  / cud1      down one line */
	char *TI_home;	 /* ho  / home      home cursor (if no cup) */
	char *TI_civis;	 /* vi  / civis     make cursor invisible */
	char *TI_cub1;	 /* le  / cub1      move left one space */
	char *TI_mrcup;	 /* CM  / mrcup     memory relative cursor addressing */
	char *TI_cnorm;	 /* ve  / cnorm     make cursor appear normal (undo civis/cvvis) */
	char *TI_cuf1;	 /* nd  / cuf1      non-destructive space (move right one space) */
	char *TI_ll;	 /* ll  / ll        last line, first column (if no cup) */
	char *TI_cuu1;	 /* up  / cuu1      up one line */
	char *TI_cvvis;	 /* vs  / cvvis     make cursor very visible */
	char *TI_dch1;	 /* dc  / dch1      delete character (P*) */
	char *TI_dl1;	 /* dl  / dl1       delete line (P*) */
	char *TI_dsl;	 /* ds  / dsl       disable status line */
	char *TI_hd;	 /* hd  / hd        half a line down */
	char *TI_smacs;	 /* as  / smacs     start alternate character set (P) */
	char *TI_blink;	 /* mb  / blink     turn on blinking */
	char *TI_bold;	 /* md  / bold      turn on bold (extra bright) mode */
	char *TI_smcup;	 /* ti  / smcup     string to start programs using cup */
	char *TI_smdc;	 /* dm  / smdc      enter delete mode */
	char *TI_dim;	 /* mh  / dim       turn on half-bright mode */
	char *TI_smir;	 /* im  / smir      enter insert mode */
	char *TI_invis;	 /* mk  / invis     turn on blank mode (characters invisible) */
	char *TI_prot;	 /* mp  / prot      turn on protected mode */
	char *TI_rev;	 /* mr  / rev       turn on reverse video mode */
	char *TI_smso;	 /* so  / smso      begin standout mode */
	char *TI_smul;	 /* us  / smul      begin underline mode */
	char *TI_ech;	 /* ec  / ech       erase #1 characters (P) */
	char *TI_rmacs;	 /* ae  / rmacs     end alternate character set (P) */
	char *TI_sgr0;	 /* me  / sgr0      turn off all attributes */
	char *TI_rmcup;	 /* te  / rmcup     strings to end programs using cup */
	char *TI_rmdc;	 /* ed  / rmdc      end delete mode */
	char *TI_rmir;	 /* ei  / rmir      exit insert mode */
	char *TI_rmso;	 /* se  / rmso      exit standout mode */
	char *TI_rmul;	 /* ue  / rmul      exit underline mode */
	char *TI_flash;	 /* vb  / flash     visible bell (may not move cursor) */
	char *TI_ff;	 /* ff  / ff        hardcopy terminal page eject (P*) */
	char *TI_fsl;	 /* fs  / fsl       return from status line */
	char *TI_is1;	 /* i1  / is1       initialization string */
	char *TI_is2;	 /* is  / is2       initialization string */
	char *TI_is3;	 /* i3  / is3       initialization string */
	char *TI_if;	 /* if  / if        name of initialization file */
	char *TI_ich1;	 /* ic  / ich1      insert character (P) */
	char *TI_il1;	 /* al  / il1       insert line (P*) */
	char *TI_ip;	 /* ip  / ip        insert padding after inserted character */
	char *TI_kbs;	 /* kb  / kbs       backspace key */
	char *TI_ktbc;	 /* ka  / ktbc      clear-all-tabs key */
	char *TI_kclr;	 /* kC  / kclr      clear-screen or erase key */
	char *TI_kctab;	 /* kt  / kctab     clear-tab key */
	char *TI_kdch1;	 /* kD  / kdch1     delete-character key */
	char *TI_kdl1;	 /* kL  / kdl1      delete-line key */
	char *TI_kcud1;	 /* kd  / kcud1     down-arrow key */
	char *TI_krmir;	 /* kM  / krmir     sent by rmir or smir in insert mode */
	char *TI_kel;	 /* kE  / kel       clear-to-end-of-line key */
	char *TI_ked;	 /* kS  / ked       clear-to-end-of-screen key */
	char *TI_kf0;	 /* k0  / kf0       F0 function key */
	char *TI_kf1;	 /* k1  / kf1       F1 function key */
	char *TI_kf10;	 /* k;  / kf10      F10 function key */
	char *TI_kf2;	 /* k2  / kf2       F2 function key */
	char *TI_kf3;	 /* k3  / kf3       F3 function key */
	char *TI_kf4;	 /* k4  / kf4       F4 function key */
	char *TI_kf5;	 /* k5  / kf5       F5 function key */
	char *TI_kf6;	 /* k6  / kf6       F6 function key */
	char *TI_kf7;	 /* k7  / kf7       F7 function key */
	char *TI_kf8;	 /* k8  / kf8       F8 function key */
	char *TI_kf9;	 /* k9  / kf9       F9 function key */
	char *TI_khome;	 /* kh  / khome     home key */
	char *TI_kich1;	 /* kI  / kich1     insert-character key */
	char *TI_kil1;	 /* kA  / kil1      insert-line key */
	char *TI_kcub1;	 /* kl  / kcub1     left-arrow key */
	char *TI_kll;	 /* kH  / kll       lower-left key (home down) */
	char *TI_knp;	 /* kN  / knp       next-page key */
	char *TI_kpp;	 /* kP  / kpp       previous-page key */
	char *TI_kcuf1;	 /* kr  / kcuf1     right-arrow key */
	char *TI_kind;	 /* kF  / kind      scroll-forward key */
	char *TI_kri;	 /* kR  / kri       scroll-backward key */
	char *TI_khts;	 /* kT  / khts      set-tab key */
	char *TI_kcuu1;	 /* ku  / kcuu1     up-arrow key */
	char *TI_rmkx;	 /* ke  / rmkx      leave 'keyboard_transmit' mode */
	char *TI_smkx;	 /* ks  / smkx      enter 'keyboard_transmit' mode */
	char *TI_lf0;	 /* l0  / lf0       label on function key f0 if not f0 */
	char *TI_lf1;	 /* l1  / lf1       label on function key f1 if not f1 */
	char *TI_lf10;	 /* la  / lf10      label on function key f10 if not f10 */
	char *TI_lf2;	 /* l2  / lf2       label on function key f2 if not f2 */
	char *TI_lf3;	 /* l3  / lf3       label on function key f3 if not f3 */
	char *TI_lf4;	 /* l4  / lf4       label on function key f4 if not f4 */
	char *TI_lf5;	 /* l5  / lf5       label on function key f5 if not f5 */
	char *TI_lf6;	 /* l6  / lf6       label on function key f6 if not f6 */
	char *TI_lf7;	 /* l7  / lf7       label on function key f7 if not f7 */
	char *TI_lf8;	 /* l8  / lf8       label on function key f8 if not f8 */
	char *TI_lf9;	 /* l9  / lf9       label on function key f9 if not f9 */
	char *TI_rmm;	 /* mo  / rmm       turn off meta mode */
	char *TI_smm;	 /* mm  / smm       turn on meta mode (8th-bit on) */
	char *TI_nel;	 /* nw  / nel       newline (behave like cr followed by lf) */
	char *TI_pad;	 /* pc  / pad       padding char (instead of null) */
	char *TI_dch;	 /* DC  / dch       delete #1 characters (P*) */
	char *TI_dl;	 /* DL  / dl        delete #1 lines (P*) */
	char *TI_cud;	 /* DO  / cud       down #1 lines (P*) */
	char *TI_ich;	 /* IC  / ich       insert #1 characters (P*) */
	char *TI_indn;	 /* SF  / indn      scroll forward #1 lines (P) */
	char *TI_il;	 /* AL  / il        insert #1 lines (P*) */
	char *TI_cub;	 /* LE  / cub       move #1 characters to the left (P) */
	char *TI_cuf;	 /* RI  / cuf       move #1 characters to the right (P*) */
	char *TI_rin;	 /* SR  / rin       scroll back #1 lines (P) */
	char *TI_cuu;	 /* UP  / cuu       up #1 lines (P*) */
	char *TI_pfkey;	 /* pk  / pfkey     program function key #1 to type string #2 */
	char *TI_pfloc;	 /* pl  / pfloc     program function key #1 to execute string #2 */
	char *TI_pfx;	 /* px  / pfx       program function key #1 to transmit string #2 */
	char *TI_mc0;	 /* ps  / mc0       print contents of screen */
	char *TI_mc4;	 /* pf  / mc4       turn off printer */
	char *TI_mc5;	 /* po  / mc5       turn on printer */
	char *TI_rep;	 /* rp  / rep       repeat char #1 #2 times (P*) */
	char *TI_rs1;	 /* r1  / rs1       reset string */
	char *TI_rs2;	 /* r2  / rs2       reset string */
	char *TI_rs3;	 /* r3  / rs3       reset string */
	char *TI_rf;	 /* rf  / rf        name of reset file */
	char *TI_rc;	 /* rc  / rc        restore cursor to position of last save_cursor */
	char *TI_vpa;	 /* cv  / vpa       vertical position #1 absolute (P) */
	char *TI_sc;	 /* sc  / sc        save current cursor position (P) */
	char *TI_ind;	 /* sf  / ind       scroll text up (P) */
	char *TI_ri;	 /* sr  / ri        scroll text down (P) */
	char *TI_sgr;	 /* sa  / sgr       define video attributes #1-#9 (PG9) */
	char *TI_hts;	 /* st  / hts       set a tab in every row, current columns */
	char *TI_wind;	 /* wi  / wind      current window is lines #1-#2 cols #3-#4 */
	char *TI_ht;	 /* ta  / ht        tab to next 8-space hardware tab stop */
	char *TI_tsl;	 /* ts  / tsl       move to status line */
	char *TI_uc;	 /* uc  / uc        underline char and move past it */
	char *TI_hu;	 /* hu  / hu        half a line up */
	char *TI_iprog;	 /* iP  / iprog     path name of program for initialization */
	char *TI_ka1;	 /* K1  / ka1       upper left of keypad */
	char *TI_ka3;	 /* K3  / ka3       upper right of keypad */
	char *TI_kb2;	 /* K2  / kb2       center of keypad */
	char *TI_kc1;	 /* K4  / kc1       lower left of keypad */
	char *TI_kc3;	 /* K5  / kc3       lower right of keypad */
	char *TI_mc5p;	 /* pO  / mc5p      turn on printer for #1 bytes */
	char *TI_rmp;	 /* rP  / rmp       like ip but when in insert mode */
	char *TI_acsc;	 /* ac  / acsc      graphics charset pairs, based on vt100 */
	char *TI_pln;	 /* pn  / pln       program label #1 to show string #2 */
	char *TI_kcbt;	 /* kB  / kcbt      back-tab key */
	char *TI_smxon;	 /* SX  / smxon     turn on xon/xoff handshaking */
	char *TI_rmxon;	 /* RX  / rmxon     turn off xon/xoff handshaking */
	char *TI_smam;	 /* SA  / smam      turn on automatic margins */
	char *TI_rmam;	 /* RA  / rmam      turn off automatic margins */
	char *TI_xonc;	 /* XN  / xonc      XON character */
	char *TI_xoffc;	 /* XF  / xoffc     XOFF character */
	char *TI_enacs;	 /* eA  / enacs     enable alternate char set */
	char *TI_smln;	 /* LO  / smln      turn on soft labels */
	char *TI_rmln;	 /* LF  / rmln      turn off soft labels */
	char *TI_kbeg;	 /* @1  / kbeg      begin key */
	char *TI_kcan;	 /* @2  / kcan      cancel key */
	char *TI_kclo;	 /* @3  / kclo      close key */
	char *TI_kcmd;	 /* @4  / kcmd      command key */
	char *TI_kcpy;	 /* @5  / kcpy      copy key */
	char *TI_kcrt;	 /* @6  / kcrt      create key */
	char *TI_kend;	 /* @7  / kend      end key */
	char *TI_kent;	 /* @8  / kent      enter/send key */
	char *TI_kext;	 /* @9  / kext      exit key */
	char *TI_kfnd;	 /* @0  / kfnd      find key */
	char *TI_khlp;	 /* %1  / khlp      help key */
	char *TI_kmrk;	 /* %2  / kmrk      mark key */
	char *TI_kmsg;	 /* %3  / kmsg      message key */
	char *TI_kmov;	 /* %4  / kmov      move key */
	char *TI_knxt;	 /* %5  / knxt      next key */
	char *TI_kopn;	 /* %6  / kopn      open key */
	char *TI_kopt;	 /* %7  / kopt      options key */
	char *TI_kprv;	 /* %8  / kprv      previous key */
	char *TI_kprt;	 /* %9  / kprt      print key */
	char *TI_krdo;	 /* %0  / krdo      redo key */
	char *TI_kref;	 /* &1  / kref      reference key */
	char *TI_krfr;	 /* &2  / krfr      refresh key */
	char *TI_krpl;	 /* &3  / krpl      replace key */
	char *TI_krst;	 /* &4  / krst      restart key */
	char *TI_kres;	 /* &5  / kres      resume key */
	char *TI_ksav;	 /* &6  / ksav      save key */
	char *TI_kspd;	 /* &7  / kspd      suspend key */
	char *TI_kund;	 /* &8  / kund      undo key */
	char *TI_kBEG;	 /* &9  / kBEG      shifted begin key */
	char *TI_kCAN;	 /* &0  / kCAN      shifted cancel key */
	char *TI_kCMD;	 /* *1  / kCMD      shifted command key */
	char *TI_kCPY;	 /* *2  / kCPY      shifted copy key */
	char *TI_kCRT;	 /* *3  / kCRT      shifted create key */
	char *TI_kDC;	 /* *4  / kDC       shifted delete-character key */
	char *TI_kDL;	 /* *5  / kDL       shifted delete-line key */
	char *TI_kslt;	 /* *6  / kslt      select key */
	char *TI_kEND;	 /* *7  / kEND      shifted end key */
	char *TI_kEOL;	 /* *8  / kEOL      shifted clear-to-end-of-line key */
	char *TI_kEXT;	 /* *9  / kEXT      shifted exit key */
	char *TI_kFND;	 /* *0  / kFND      shifted find key */
	char *TI_kHLP;	 /* #1  / kHLP      shifted help key */
	char *TI_kHOM;	 /* #2  / kHOM      shifted home key */
	char *TI_kIC;	 /* #3  / kIC       shifted insert-character key */
	char *TI_kLFT;	 /* #4  / kLFT      shifted left-arrow key */
	char *TI_kMSG;	 /* %a  / kMSG      shifted message key */
	char *TI_kMOV;	 /* %b  / kMOV      shifted move key */
	char *TI_kNXT;	 /* %c  / kNXT      shifted next key */
	char *TI_kOPT;	 /* %d  / kOPT      shifted options key */
	char *TI_kPRV;	 /* %e  / kPRV      shifted previous key */
	char *TI_kPRT;	 /* %f  / kPRT      shifted print key */
	char *TI_kRDO;	 /* %g  / kRDO      shifted redo key */
	char *TI_kRPL;	 /* %h  / kRPL      shifted replace key */
	char *TI_kRIT;	 /* %i  / kRIT      shifted right-arrow key */
	char *TI_kRES;	 /* %j  / kRES      shifted resume key */
	char *TI_kSAV;	 /* !1  / kSAV      shifted save key */
	char *TI_kSPD;	 /* !2  / kSPD      shifted suspend key */
	char *TI_kUND;	 /* !3  / kUND      shifted undo key */
	char *TI_rfi;	 /* RF  / rfi       send next input char (for ptys) */
	char *TI_kf11;	 /* F1  / kf11      F11 function key */
	char *TI_kf12;	 /* F2  / kf12      F12 function key */
	char *TI_kf13;	 /* F3  / kf13      F13 function key */
	char *TI_kf14;	 /* F4  / kf14      F14 function key */
	char *TI_kf15;	 /* F5  / kf15      F15 function key */
	char *TI_kf16;	 /* F6  / kf16      F16 function key */
	char *TI_kf17;	 /* F7  / kf17      F17 function key */
	char *TI_kf18;	 /* F8  / kf18      F18 function key */
	char *TI_kf19;	 /* F9  / kf19      F19 function key */
	char *TI_kf20;	 /* FA  / kf20      F20 function key */
	char *TI_kf21;	 /* FB  / kf21      F21 function key */
	char *TI_kf22;	 /* FC  / kf22      F22 function key */
	char *TI_kf23;	 /* FD  / kf23      F23 function key */
	char *TI_kf24;	 /* FE  / kf24      F24 function key */
	char *TI_kf25;	 /* FF  / kf25      F25 function key */
	char *TI_kf26;	 /* FG  / kf26      F26 function key */
	char *TI_kf27;	 /* FH  / kf27      F27 function key */
	char *TI_kf28;	 /* FI  / kf28      F28 function key */
	char *TI_kf29;	 /* FJ  / kf29      F29 function key */
	char *TI_kf30;	 /* FK  / kf30      F30 function key */
	char *TI_kf31;	 /* FL  / kf31      F31 function key */
	char *TI_kf32;	 /* FM  / kf32      F32 function key */
	char *TI_kf33;	 /* FN  / kf33      F33 function key */
	char *TI_kf34;	 /* FO  / kf34      F34 function key */
	char *TI_kf35;	 /* FP  / kf35      F35 function key */
	char *TI_kf36;	 /* FQ  / kf36      F36 function key */
	char *TI_kf37;	 /* FR  / kf37      F37 function key */
	char *TI_kf38;	 /* FS  / kf38      F38 function key */
	char *TI_kf39;	 /* FT  / kf39      F39 function key */
	char *TI_kf40;	 /* FU  / kf40      F40 function key */
	char *TI_kf41;	 /* FV  / kf41      F41 function key */
	char *TI_kf42;	 /* FW  / kf42      F42 function key */
	char *TI_kf43;	 /* FX  / kf43      F43 function key */
	char *TI_kf44;	 /* FY  / kf44      F44 function key */
	char *TI_kf45;	 /* FZ  / kf45      F45 function key */
	char *TI_kf46;	 /* Fa  / kf46      F46 function key */
	char *TI_kf47;	 /* Fb  / kf47      F47 function key */
	char *TI_kf48;	 /* Fc  / kf48      F48 function key */
	char *TI_kf49;	 /* Fd  / kf49      F49 function key */
	char *TI_kf50;	 /* Fe  / kf50      F50 function key */
	char *TI_kf51;	 /* Ff  / kf51      F51 function key */
	char *TI_kf52;	 /* Fg  / kf52      F52 function key */
	char *TI_kf53;	 /* Fh  / kf53      F53 function key */
	char *TI_kf54;	 /* Fi  / kf54      F54 function key */
	char *TI_kf55;	 /* Fj  / kf55      F55 function key */
	char *TI_kf56;	 /* Fk  / kf56      F56 function key */
	char *TI_kf57;	 /* Fl  / kf57      F57 function key */
	char *TI_kf58;	 /* Fm  / kf58      F58 function key */
	char *TI_kf59;	 /* Fn  / kf59      F59 function key */
	char *TI_kf60;	 /* Fo  / kf60      F60 function key */
	char *TI_kf61;	 /* Fp  / kf61      F61 function key */
	char *TI_kf62;	 /* Fq  / kf62      F62 function key */
	char *TI_kf63;	 /* Fr  / kf63      F63 function key */
	char *TI_el1;	 /* cb  / el1       Clear to beginning of line */
	char *TI_mgc;	 /* MC  / mgc       clear right and left soft margins */
	char *TI_smgl;	 /* ML  / smgl      set left soft margin at current column */
	char *TI_smgr;	 /* MR  / smgr      set right soft margin at current column */
	char *TI_fln;	 /* Lf  / fln       label format */
	char *TI_sclk;	 /* SC  / sclk      set clock, #1 hrs #2 mins #3 secs */
	char *TI_dclk;	 /* DK  / dclk      display clock at (#1,#2) */
	char *TI_rmclk;	 /* RC  / rmclk     remove clock */
	char *TI_cwin;	 /* CW  / cwin      define a window #1 from #2,#3 to #4,#5 */
	char *TI_wingo;	 /* WG  / wingo     go to window #1 */
	char *TI_hup;	 /* HU  / hup       hang-up phone */
	char *TI_dial;	 /* DI  / dial      dial number #1 */
	char *TI_qdial;	 /* QD  / qdial     dial number #1 without checking */
	char *TI_tone;	 /* TO  / tone      select touch tone dialing */
	char *TI_pulse;	 /* PU  / pulse     select pulse dialing */
	char *TI_hook;	 /* fh  / hook      flash switch hook */
	char *TI_pause;	 /* PA  / pause     pause for 2-3 seconds */
	char *TI_wait;	 /* WA  / wait      wait for dial-tone */
	char *TI_u0;	 /* u0  / u0        User string #0 */
	char *TI_u1;	 /* u1  / u1        User string #1 */
	char *TI_u2;	 /* u2  / u2        User string #2 */
	char *TI_u3;	 /* u3  / u3        User string #3 */
	char *TI_u4;	 /* u4  / u4        User string #4 */
	char *TI_u5;	 /* u5  / u5        User string #5 */
	char *TI_u6;	 /* u6  / u6        User string #6 */
	char *TI_u7;	 /* u7  / u7        User string #7 */
	char *TI_u8;	 /* u8  / u8        User string #8 */
	char *TI_u9;	 /* u9  / u9        User string #9 */
	char *TI_op;	 /* op  / op        Set default pair to its original value */
	char *TI_oc;	 /* oc  / oc        Set all color pairs to the original ones */
	char *TI_initc;	 /* Ic  / initc     initialize color #1 to (#2,#3,#4) */
	char *TI_initp;	 /* Ip  / initp     Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) */
	char *TI_scp;	 /* sp  / scp       Set current color pair to #1 */
	char *TI_setf;	 /* Sf  / setf      Set foreground color #1 */
	char *TI_setb;	 /* Sb  / setb      Set background color #1 */
	char *TI_cpi;	 /* ZA  / cpi       Change number of characters per inch */
	char *TI_lpi;	 /* ZB  / lpi       Change number of lines per inch */
	char *TI_chr;	 /* ZC  / chr       Change horizontal resolution */
	char *TI_cvr;	 /* ZD  / cvr       Change vertical resolution */
	char *TI_defc;	 /* ZE  / defc      Define a character */
	char *TI_swidm;	 /* ZF  / swidm     Enter double-wide mode */
	char *TI_sdrfq;	 /* ZG  / sdrfq     Enter draft-quality mode */
	char *TI_sitm;	 /* ZH  / sitm      Enter italic mode */
	char *TI_slm;	 /* ZI  / slm       Start leftward carriage motion */
	char *TI_smicm;	 /* ZJ  / smicm     Start micro-motion mode */
	char *TI_snlq;	 /* ZK  / snlq      Enter NLQ mode */
	char *TI_snrmq;	 /* ZL  / snrmq     Enter normal-quality mode */
	char *TI_sshm;	 /* ZM  / sshm      Enter shadow-print mode */
	char *TI_ssubm;	 /* ZN  / ssubm     Enter subscript mode */
	char *TI_ssupm;	 /* ZO  / ssupm     Enter superscript mode */
	char *TI_sum;	 /* ZP  / sum       Start upward carriage motion */
	char *TI_rwidm;	 /* ZQ  / rwidm     End double-wide mode */
	char *TI_ritm;	 /* ZR  / ritm      End italic mode */
	char *TI_rlm;	 /* ZS  / rlm       End left-motion mode */
	char *TI_rmicm;	 /* ZT  / rmicm     End micro-motion mode */
	char *TI_rshm;	 /* ZU  / rshm      End shadow-print mode */
	char *TI_rsubm;	 /* ZV  / rsubm     End subscript mode */
	char *TI_rsupm;	 /* ZW  / rsupm     End superscript mode */
	char *TI_rum;	 /* ZX  / rum       End reverse character motion */
	char *TI_mhpa;	 /* ZY  / mhpa      Like column_address in micro mode */
	char *TI_mcud1;	 /* ZZ  / mcud1     Like cursor_down in micro mode */
	char *TI_mcub1;	 /* Za  / mcub1     Like cursor_left in micro mode */
	char *TI_mcuf1;	 /* Zb  / mcuf1     Like cursor_right in micro mode */
	char *TI_mvpa;	 /* Zc  / mvpa      Like row_address in micro mode */
	char *TI_mcuu1;	 /* Zd  / mcuu1     Like cursor_up in micro mode */
	char *TI_porder; /* Ze  / porder    Match software bits to print-head pins */
	char *TI_mcud;	 /* Zf  / mcud      Like parm_down_cursor in micro mode */
	char *TI_mcub;	 /* Zg  / mcub      Like parm_left_cursor in micro mode */
	char *TI_mcuf;	 /* Zh  / mcuf      Like parm_right_cursor in micro mode */
	char *TI_mcuu;	 /* Zi  / mcuu      Like parm_up_cursor in micro mode */
	char *TI_scs;	 /* Zj  / scs       Select character set */
	char *TI_smgb;	 /* Zk  / smgb      Set bottom margin at current line */
	char *TI_smgbp;	 /* Zl  / smgbp     Set bottom margin at line #1 or #2 lines from bottom */
	char *TI_smglp;	 /* Zm  / smglp     Set left (right) margin at column #1 (#2) */
	char *TI_smgrp;	 /* Zn  / smgrp     Set right margin at column #1 */
	char *TI_smgt;	 /* Zo  / smgt      Set top margin at current line */
	char *TI_smgtp;	 /* Zp  / smgtp     Set top (bottom) margin at row #1 (#2) */
	char *TI_sbim;	 /* Zq  / sbim      Start printing bit image graphics */
	char *TI_scsd;	 /* Zr  / scsd      Start character set definition */
	char *TI_rbim;	 /* Zs  / rbim      Stop printing bit image graphics */
	char *TI_rcsd;	 /* Zt  / rcsd      End definition of character set */
	char *TI_subcs;	 /* Zu  / subcs     List of subscriptable characters */
	char *TI_supcs;	 /* Zv  / supcs     List of superscriptable characters */
	char *TI_docr;	 /* Zw  / docr      Printing any of these characters causes CR */
	char *TI_zerom;	 /* Zx  / zerom     No motion for subsequent character */
	char *TI_csnm;	 /* Zy  / csnm      List of character set names */
	char *TI_kmous;	 /* Km  / kmous     Mouse event has occurred */
	char *TI_minfo;	 /* Mi  / minfo     Mouse status information */
	char *TI_reqmp;	 /* RQ  / reqmp     Request mouse position */
	char *TI_getm;	 /* Gm  / getm      Curses should get button events */
	char *TI_setaf;	 /* AF  / setaf     Set foreground color using ANSI escape */
	char *TI_setab;	 /* AB  / setab     Set background color using ANSI escape */
	char *TI_pfxl;	 /* xl  / pfxl      Program function key #1 to type string #2 and show string #3 */
	char *TI_devt;	 /* dv  / devt      Indicate language/codeset support */
	char *TI_csin;	 /* ci  / csin      Init sequence for multiple codesets */
	char *TI_s0ds;	 /* s0  / s0ds      Shift to code set 0 (EUC set 0, ASCII) */
	char *TI_s1ds;	 /* s1  / s1ds      Shift to code set 1 */
	char *TI_s2ds;	 /* s2  / s2ds      Shift to code set 2 */
	char *TI_s3ds;	 /* s3  / s3ds      Shift to code set 3 */
	char *TI_smglr;	 /* ML  / smglr     Set both left and right margins to #1, #2 */
	char *TI_smgtb;	 /* MT  / smgtb     Sets both top and bottom margins to #1, #2 */
	char *TI_birep;	 /* Xy  / birep     Repeat bit image cell #1 #2 times */
	char *TI_binel;	 /* Zz  / binel     Move to next row of the bit image */
	char *TI_bicr;	 /* Yv  / bicr      Move to beginning of same row */
	char *TI_colornm; /* Yw  / colornm   Give name for color #1 */
	char *TI_defbi;	 /* Yx  / defbi     Define rectangualar bit image region */
	char *TI_endbi;	 /* Yy  / endbi     End a bit-image region */
	char *TI_setcolor; /* Yz  / setcolor  Change to ribbon color #1 */
	char *TI_slines; /* YZ  / slines    Set page length to #1 lines */
	char *TI_dispc;	 /* S1  / dispc     Display PC character */
	char *TI_smpch;	 /* S2  / smpch     Enter PC character display mode */
	char *TI_rmpch;	 /* S3  / rmpch     Exit PC character display mode */
	char *TI_smsc;	 /* S4  / smsc      Enter PC scancode mode */
	char *TI_rmsc;	 /* S5  / rmsc      Exit PC scancode mode */
	char *TI_pctrm;	 /* S6  / pctrm     PC terminal options */
	char *TI_scesc;	 /* S7  / scesc     Escape for scancode emulation */
	char *TI_scesa;	 /* S8  / scesa     Alternate escape for scancode emulation */
	char *TI_ehhlm;	 /* Xh  / ehhlm     Enter horizontal highlight mode */
	char *TI_elhlm;	 /* Xl  / elhlm     Enter left highlight mode */
	char *TI_elohlm; /* Xo  / elohlm    Enter low highlight mode */
	char *TI_erhlm;	 /* Xr  / erhlm     Enter right highlight mode */
	char *TI_ethlm;	 /* Xt  / ethlm     Enter top highlight mode */
	char *TI_evhlm;	 /* Xv  / evhlm     Enter vertical highlight mode */
	char *TI_sgr1;	 /* sA  / sgr1      Define second set of video attributes #1-#6 */
	char *TI_slength; /* sL  / slength   YI Set page length to #1 hundredth of an inch */
	char *TI_OTi2;	 /* i2  / OTi2      secondary initialization string */
	char *TI_OTrs;	 /* rs  / OTrs      terminal reset string */
	int TI_OTug;	 /* ug  / OTug      number of blanks left by ul */
	int TI_OTbs;	 /* bs  / OTbs      uses ^H to move left */
	int TI_OTns;	 /* ns  / OTns      crt cannot scroll */
	int TI_OTnc;	 /* nc  / OTnc      no way to go to start of line */
	int TI_OTdC;	 /* dC  / OTdC      pad needed for CR */
	int TI_OTdN;	 /* dN  / OTdN      pad needed for LF */
	char *TI_OTnl;	 /* nl  / OTnl      use to move down */
	char *TI_OTbc;	 /* bc  / OTbc      move left, if not ^H */
	int TI_OTMT;	 /* MT  / OTMT      has meta key */
	int TI_OTNL;	 /* NL  / OTNL      move down with \n */
	int TI_OTdB;	 /* dB  / OTdB      padding required for ^H */
	int TI_OTdT;	 /* dT  / OTdT      padding required for ^I */
	int TI_OTkn;	 /* kn  / OTkn      count of function keys */
	char *TI_OTko;	 /* ko  / OTko      list of self-mapped keycaps */
	char *TI_OTma;	 /* ma  / OTma      map arrow keys rogue(1) motion keys */
	int TI_OTpt;	 /* pt  / OTpt      has 8-char tabs invoked with ^I */
	int TI_OTxr;	 /* xr  / OTxr      return clears the line */
	char *TI_OTG2;	 /* G2  / OTG2      single upper left */
	char *TI_OTG3;	 /* G3  / OTG3      single lower left */
	char *TI_OTG1;	 /* G1  / OTG1      single upper right */
	char *TI_OTG4;	 /* G4  / OTG4      single lower right */
	char *TI_OTGR;	 /* GR  / OTGR      tee pointing right */
	char *TI_OTGL;	 /* GL  / OTGL      tee pointing left */
	char *TI_OTGU;	 /* GU  / OTGU      tee pointing up */
	char *TI_OTGD;	 /* GD  / OTGD      tee pointing down */
	char *TI_OTGH;	 /* GH  / OTGH      single horizontal line */
	char *TI_OTGV;	 /* GV  / OTGV      single vertical line */
	char *TI_OTGC;	 /* GC  / OTGC      single intersection */
	char *TI_meml;	 /* ml  / meml      memory lock above */
	char *TI_memu;	 /* mu  / memu      memory unlock */
	char *TI_box1;	 /* bx  / box1      box characters primary set */
	/* non termcap/terminfo terminal info (generated by epic) */
	char TI_normal[256];
	char *TI_sgrstrs[TERM_SGR_MAXVAL];
	char *TI_forecolors[16];
	char *TI_backcolors[16];
	int TI_meta_mode;
/*	int TI_need_redraw ; */
};

extern	struct	term_struct	*current_term;

#define term_has(x) 	(termfeatures & (x))
#define capstr(x) 	(current_term->TI_sgrstrs[(TERM_SGR_ ## x)-1])
#define outcap(x)	(tputs_x(capstr(x)))

#ifndef TERM_DEBUG
#define tputs_x(s)		(tputs(s, 0, putchar_x))
#else
int	tputs_x(char *);
#endif
#if 0
#define term_underline_on()	outcap(UNDL_ON)
#define term_underline_off()	outcap(UNDL_OFF)
#define term_standout_on()	outcap(REV_ON)
#define term_standout_off()	outcap(REV_OFF)
#define term_blink_on()		outcap(BLINK_ON)
#define term_blink_off()	outcap(BLINK_OFF)
#define term_bold_on()		outcap(BOLD_ON)
#define	term_bold_off()		outcap(BOLD_OFF)
#define term_altcharset_on()	outcap(ALTCHAR_ON)
#define term_altcharset_off()	outcap(ALTCHAR_OFF)
#endif
#define term_underline_on()	if (get_int_var(UNDERLINE_VIDEO_VAR)) \
					outcap(UNDL_ON)
#define term_underline_off()	if (get_int_var(UNDERLINE_VIDEO_VAR)) \
					outcap(UNDL_OFF)
#define term_standout_on()	if (get_int_var(INVERSE_VIDEO_VAR)) \
					outcap(REV_ON)
#define term_standout_off()	if (get_int_var(INVERSE_VIDEO_VAR)) \
					outcap(REV_OFF)
#define term_blink_on()		if (get_int_var(BLINK_VIDEO_VAR)) \
					outcap(BLINK_ON)
#define term_blink_off()	if (get_int_var(BLINK_VIDEO_VAR)) \
					outcap(BLINK_OFF)
#define term_bold_on()		if (get_int_var(BOLD_VIDEO_VAR)) \
					outcap(BOLD_ON)
#define	term_bold_off()		if (get_int_var(BOLD_VIDEO_VAR)) \
					outcap(BOLD_OFF)
#define term_altcharset_on()	if (get_int_var(ALT_CHARSET_VAR)) \
					outcap(ALTCHAR_ON)
#define term_altcharset_off()	if (get_int_var(ALT_CHARSET_VAR)) \
					outcap(ALTCHAR_OFF)

#define term_set_foreground(x)	tputs_x(current_term->TI_forecolors[(x) & 0x0f])
#define term_set_background(x)	tputs_x(current_term->TI_backcolors[(x) & 0x0f])
#define term_set_attribs(f,b)	tputs_x(term_getsgr(TERM_SGR_COLORS,(f),(b)))
#define term_putgchar(x)	tputs_x(term_getsgr(TERM_SGR_GCHAR,(x),0))
#define term_move_cursor(c, r)	term_gotoxy((c),(r))
#define term_cr()		tputs_x(current_term->TI_cr)
#define term_newline()		tputs_x(current_term->TI_nel)
#define term_cursor_left()	term_left(1)
#define term_cursor_right()	term_right(1)
#define term_clear_to_eol()	term_clreol()
#define term_clear_screen()	term_clrscr()

#ifdef __EMX__
extern int vio_screen;
extern char default_pair[2];
#endif
#endif

	RETSIGTYPE 	term_cont 		(int);
	void 		term_beep 		(void);
	int		term_echo 		(int);
	int		term_init 		(char *);
	int		term_resize 		(void);
	void		term_pause 		(char, char *);
	void		term_putchar 		(unsigned char);
	void		term_scroll 		(int, int, int);
	void		term_insert 		(unsigned char);
	void		term_delete 		(int);
	void		term_repeat		(unsigned char, int);
	void		term_right		(int);
	void		term_left		(int);
	void		term_clreol		(void);
	void		term_clrscr		(void);
	void		term_gotoxy		(int, int);
	void		term_reset		(void);
	int		term_eight_bit		(void);
	void		set_term_eight_bit	(int);
	void		set_meta_8bit		(Window *, char *, int);
	char *		term_getsgr		(int, int, int);
	void		reinit_term		(int);
	void		term_reset2		(void);
	void		reset_cols		(int);
	void		reset_lines		(int);
	char *		term_getsgr		(int, int, int);
	char *		get_term_capability	(char *, int, int);

#if 0
#ifndef TPUTS_DECLARED
int	tputs (const unsigned char *, int, int (*)(int));	
#endif
#endif

#endif /* _TERM_H_ */

--- NEW FILE: commands.h ---
/*
 * edit.h: header for edit.c 
 *
 */
#ifndef __edit_h_
#define __edit_h_

#include "irc_std.h"

extern	char	*sent_nick;
extern	char	*sent_body;
extern	char	*recv_nick;

	void	BX_send_text (const char *, const char *, char *, int, int);
	void	eval_inputlist (char *, char *);
	int	BX_parse_command (char *, int, char *);
	void	BX_parse_line (const char *, char *, const char *, int, int, int);
	void	edit_char (unsigned char);
	void	execute_timer (void);
	void	ison_now (char *, char *);
	void	quote_char (char, char *);
	void	type_text (char, char *);
	void	parse_text (char, char *);
	void	irc_clear_screen (char, char *);
	int	check_wait_command (char *);
	void	ExecuteTimers (void);
	int	check_mode_lock (char *, char *, int);
	void	destroy_call_stack (void);
	void	unwind_stack (void);
	void	wind_stack (char *);
	void	redirect_text (int, const char *, const char *, char *, int, int);
	int	command_exist (char *);
			


/* a few advance declarations */
extern	void	my_clear 		(char *, char *, char *, char *);
extern	void	reconnect_cmd		(char *, char *, char *, char *);
extern	void	e_hostname		(char *, char *, char *, char *);
extern	void	BX_load			(char *, char *, char *, char *);
extern	void	query			(char *, char *, char *, char *);
extern	void	unquery			(char *, char *, char *, char *);
extern	void	away			(char *, char *, char *, char *);
extern	void	e_quit			(char *, char *, char *, char *);
extern	void	repeatcmd		(char *, char *, char *, char *);
extern	void	do_unkey		(char *, char *, char *, char *);
extern	void	do_unscrew		(char *, char *, char *, char *);
extern	void	do_getout		(char *, char *, char *, char *);
extern	void	do_mynames		(char *, char *, char *, char *);
extern	void	my_whois		(char *, char *, char *, char *);
extern	void	do_4op			(char *, char *, char *, char *);
extern	void	umodecmd		(char *, char *, char *, char *);
extern	void	do_invite		(char *, char *, char *, char *);
extern	void	do_forward		(char *, char *, char *, char *);
extern	void	do_oops			(char *, char *, char *, char *);
extern	void	sendlinecmd		(char *, char *, char *, char *);
extern	void	do_send_text		(char *, char *, char *, char *);
extern	void	funny_stuff		(char *, char *, char *, char *);
extern	void	cd			(char *, char *, char *, char *);
extern	void	e_wall			(char *, char *, char *, char *);
extern	void	send_2comm		(char *, char *, char *, char *);
extern	void	send_comm		(char *, char *, char *, char *);
extern	void	e_topic			(char *, char *, char *, char *);
extern	void	send_kick		(char *, char *, char *, char *);
extern	void	send_channel_com	(char *, char *, char *, char *);
extern	void	quotecmd		(char *, char *, char *, char *);
extern	void	e_privmsg		(char *, char *, char *, char *);
extern	void	flush			(char *, char *, char *, char *);
extern	void	oper			(char *, char *, char *, char *);
extern	void	e_channel		(char *, char *, char *, char *);
extern	void	who			(char *, char *, char *, char *);
extern	void	whois			(char *, char *, char *, char *);
extern	void	ison			(char *, char *, char *, char *);
extern	void	userhostcmd		(char *, char *, char *, char *);
extern	void	info			(char *, char *, char *, char *);
extern	void	e_nick			(char *, char *, char *, char *);
extern	void	comment			(char *, char *, char *, char *);
extern	void	sleepcmd		(char *, char *, char *, char *);
extern	void	version1		(char *, char *, char *, char *);
extern	void	ctcp			(char *, char *, char *, char *);
extern	void	rctcp			(char *, char *, char *, char *);
extern	void	dcc			(char *, char *, char *, char *);
extern	void	deop			(char *, char *, char *, char *);
extern	void	echocmd			(char *, char *, char *, char *);
extern	void	save_settings		(char *, char *, char *, char *);
extern	void	redirect		(char *, char *, char *, char *);
extern	void	waitcmd			(char *, char *, char *, char *);
extern	void	describe		(char *, char *, char *, char *);
extern	void	me			(char *, char *, char *, char *);
extern	void	evalcmd			(char *, char *, char *, char *);
extern	void	hookcmd			(char *, char *, char *, char *);
extern	void	inputcmd		(char *, char *, char *, char *);
extern	void	pingcmd			(char *, char *, char *, char *);
extern	void	xtypecmd		(char *, char *, char *, char *);
extern	void	beepcmd			(char *, char *, char *, char *);
extern	void	abortcmd		(char *, char *, char *, char *);
extern	void	e_debug			(char *, char *, char *, char *);
extern	void	do_scan			(char *, char *, char *, char *);
extern	void	push_cmd		(char *, char *, char *, char *);
extern	void	pop_cmd			(char *, char *, char *, char *);
extern	void	unshift_cmd		(char *, char *, char *, char *);
extern	void	shift_cmd		(char *, char *, char *, char *);
extern	void	exec_cmd		(char *, char *, char *, char *);
extern	void	auto_join		(char *, char *, char *, char *);
extern	void	dcc_crash		(char *, char *, char *, char *);
extern	void	do_msay			(char *, char *, char *, char *);
extern	void	send_mode		(char *, char *, char *, char *);
extern	void	do_offers		(char *, char *, char *, char *);
extern	void	ctcp_version		(char *, char *, char *, char *);
extern	void	about			(char *, char *, char *, char *);
extern	void	dcc_stat_comm		(char *, char *, char *, char *);
extern	void	sping			(char *, char *, char *, char *);
extern  void    realname_cmd		(char *, char *, char *, char *);
extern  void    set_username		(char *, char *, char *, char *);
extern  void    e_call			(char *, char *, char *, char *);
extern	void	do_toggle 		(char *, char *, char *, char *);
extern	void	e_quit 			(char *, char *, char *, char *);
extern	void	do_ig 			(char *, char *, char *, char *);
extern	void	do_listshit		(char *, char *, char *, char *);
extern	void	savelists		(char *, char *, char *, char *);
extern	void	mknu			(char *, char *, char *, char *);
extern	void	reconnect_cmd		(char *, char *, char *, char *);
extern  void    LameKick		(char *, char *, char *, char *);
extern  void    ChanWallOp		(char *, char *, char *, char *);
extern  void    NewUser			(char *, char *, char *, char *);
extern  void    ReconnectServer		(char *, char *, char *, char *);
extern  void    MegaDeop		(char *, char *, char *, char *);
extern  void    do_flood		(char *, char *, char *, char *);
extern  void    cycle			(char *, char *, char *, char *);
extern  void    bomb			(char *, char *, char *, char *);
extern  void    finger			(char *, char *, char *, char *);
extern  void    multkick		(char *, char *, char *, char *);
extern  void    massdeop		(char *, char *, char *, char *);
extern  void    doop			(char *, char *, char *, char *);
extern  void    dodeop			(char *, char *, char *, char *);
extern  void    massop			(char *, char *, char *, char *);
extern  void    whokill			(char *, char *, char *, char *);
extern  void 	ban			(char *, char *, char *, char *);
extern  void 	kickban			(char *, char *, char *, char *);
extern  void 	massban			(char *, char *, char *, char *);
extern  void 	dokick			(char *, char *, char *, char *);
extern  void 	nslookup		(char *, char *, char *, char *);
extern  void 	masskick		(char *, char *, char *, char *);
extern  void 	do_flood		(char *, char *, char *, char *);
extern  void 	reset			(char *, char *, char *, char *);
extern  void 	users			(char *, char *, char *, char *);
extern	void	my_ignorehost		(char *, char *, char *, char *);
extern	void	my_ignore		(char *, char *, char *, char *);
extern	void	unban			(char *, char *, char *, char *);
extern	void	masskickban		(char *, char *, char *, char *);
extern  void    linklook		(char *, char *, char *, char *);
extern  void	do_dump			(char *, char *, char *, char *);
extern  void	do_dirlasttype		(char *, char *, char *, char *);
extern	void	do_dirlistmsg		(char *, char *, char *, char *);
extern  void	do_dirlastmsg		(char *, char *, char *, char *);
extern  void	do_dirlastctcp		(char *, char *, char *, char *);
extern  void	do_dirlastctcpreply	(char *, char *, char *, char *);
extern  void	do_dirlastinvite	(char *, char *, char *, char *);
extern	void 	readlog			(char *, char *, char *, char *);
extern	void 	remove_log		(char *, char *, char *, char *);
extern	void 	add_user		(char *, char *, char *, char *);
extern	void	bot			(char *, char *, char *, char *);
extern	void	do_uptime		(char *, char *, char *, char *);
extern	void	cdcc			(char *, char *, char *, char *);
extern	void	extern_write		(char *, char *, char *, char *);
extern	void	showuserlist		(char *, char *, char *, char *);
extern	void	init_dcc_chat		(char *, char *, char *, char *);
extern	void	add_shit		(char *, char *, char *, char *);
extern	void	showshitlist		(char *, char *, char *, char *);
extern	void	channel_stats		(char *, char *, char *, char *);
extern	void	my_clear		(char *, char *, char *, char *);
extern	void	stubcmd			(char *, char *, char *, char *);
extern	void	addidle			(char *, char *, char *, char *);
extern	void	showidle		(char *, char *, char *, char *);
extern	void	kickidle		(char *, char *, char *, char *);
extern	void	usage			(char *, char *, char *, char *);
extern	void	reload_save		(char *, char *, char *, char *);
extern	void	cset_variable		(char *, char *, char *, char *);
extern	void	banstat			(char *, char *, char *, char *);
extern	void	nwhois			(char *, char *, char *, char *);
extern	void	statkgrep		(char *, char *, char *, char *);
extern	void	tban			(char *, char *, char *, char *);
extern	void	bantype			(char *, char *, char *, char *);
extern	void	whowas			(char *, char *, char *, char *);
extern	void	findports		(char *, char *, char *, char *);
extern	void	add_ban_word		(char *, char *, char *, char *);
extern	void	show_word_kick		(char *, char *, char *, char *);
extern	void	clear_tab		(char *, char *, char *, char *);
extern	void	topic_lock		(char *, char *, char *, char *);
extern	void	mode_lock		(char *, char *, char *, char *);
extern	void	randomnick		(char *, char *, char *, char *);
extern	void	topic_lock		(char *, char *, char *, char *);
extern	void	show_version		(char *, char *, char *, char *);
extern	void	chat			(char *, char *, char *, char *);
extern	void	back			(char *, char *, char *, char *);
extern	void	tog_fprot		(char *, char *, char *, char *);
extern	void	ftp			(char *, char *, char *, char *);
extern	void	do_dirsentlastnotice	(char *, char *, char *, char *);
extern	void	do_dirsentlastmsg	(char *, char *, char *, char *);
extern	void	do_dirlastwall		(char *, char *, char *, char *);
extern	void	do_dirlasttopic		(char *, char *, char *, char *);
extern	void	do_dirsentlastwall	(char *, char *, char *, char *);
extern	void	do_dirsentlasttopic	(char *, char *, char *, char *);
extern	void	do_dirlastserver	(char *, char *, char *, char *);
extern	void	botlink			(char *, char *, char *, char *);
extern	void	jnw			(char *, char *, char *, char *);
extern	void	lkw			(char *, char *, char *, char *);
extern	void	whokill			(char *, char *, char *, char *);
extern	void	csay			(char *, char *, char *, char *);
extern	void	clink			(char *, char *, char *, char *);
extern	void	cwho			(char *, char *, char *, char *);
extern	void	cboot			(char *, char *, char *, char *);
extern	void	cmsg			(char *, char *, char *, char *);
extern	void	toggle_xlink		(char *, char *, char *, char *);
extern	void	dcx			(char *, char *, char *, char *);
extern	void	orig_nick		(char *, char *, char *, char *);
extern	void	print_structs		(char *, char *, char *, char *);
extern	void	pretend_cmd		(char *, char *, char *, char *);
extern	void	e_pause			(char *, char *, char *, char *);
extern	void	add_bad_nick		(char *, char *, char *, char *);
extern	void	serv_stat		(char *, char *, char *, char *);
extern	void	fuckem			(char *, char *, char *, char *);
extern	void	tracekill		(char *, char *, char *, char *);
extern	void	traceserv		(char *, char *, char *, char *);
extern	void	dll_load		(char *, char *, char *, char *);
extern	void	tignore			(char *, char *, char *, char *);
extern	void	dumpcmd			(char *, char *, char *, char *);
extern	void	aliascmd		(char *, char *, char *, char *);
extern	void	set_autoreply		(char *, char *, char *, char *);
extern	void	init_ftp		(char *, char *, char *, char *);
extern	void	xdebugcmd		(char *, char *, char *, char *);
extern	void	blesscmd		(char *, char *, char *, char *);
extern	void	do_trace		(char *, char *, char *, char *);
extern	void	do_stats		(char *, char *, char *, char *);
extern	void	setenvcmd		(char *, char *, char *, char *);
extern	void	send_kill		(char *, char *, char *, char *);
extern	void	set_user_info		(char *, char *, char *, char *);
extern	void	init_vars		(char *, char *, char *, char *);
extern	void	init_window_vars	(char *, char *, char *, char *);
extern	void	show_hash		(char *, char *, char *, char *);
extern	void	unload			(char *, char *, char *, char *);
extern	void	do_map			(char *, char *, char *, char *);
extern	void	add_no_flood		(char *, char *, char *, char *);
extern	void	s_watch			(char *, char *, char *, char *);
extern	void	awaylog			(char *, char *, char *, char *);
extern	void	newnick			(char *, char *, char *, char *);
extern	void	newuser			(char *, char *, char *, char *);

extern	void	os2menu			(char *, char *, char *, char *);
extern	void	os2menuitem             (char *, char *, char *, char *);
extern	void	os2submenu       	(char *, char *, char *, char *);
extern	void	fontdialog         	(char *, char *, char *, char *);
extern	void	filedialog         	(char *, char *, char *, char *);

extern	void	ame			(char *, char *, char *, char *);

#ifdef WANT_DLL
extern	void	unload_dll		(char *, char *, char *, char *);
#endif

	IrcCommand *BX_find_command (char *, int *);
	char	*glob_commands(char *, int *, int);
		
#define AWAY_ONE 0
#define AWAY_ALL 1

#define STACK_POP 0
#define STACK_PUSH 1
#define STACK_SWAP 2

#define TRACE_OPER	0x01
#define TRACE_SERVER	0x02
#define TRACE_USER	0x04

#define STATS_LINK	0x001
#define STATS_CLASS	0x002
#define STATS_ILINE	0x004
#define STATS_TKLINE	0x008
#define STATS_YLINE	0x010
#define STATS_OLINE	0x020
#define STATS_HLINE	0x040
#define STATS_UPTIME	0x080
#define STATS_MLINE	0x100
#define STATS_KLINE	0x200

#define NONOVICEABBREV	0x0001
#define NOINTERACTIVE	0x0002
#define NOSIMPLESCRIPT	0x0004
#define NOCOMPLEXSCRIPT	0x0008
#define SERVERREQ	0x0010

#ifdef WANT_DLL
extern IrcCommandDll *dll_commands;
#endif

extern        int     will_catch_break_exceptions;
extern        int     will_catch_continue_exceptions;
extern        int     will_catch_return_exceptions;
extern        int     break_exception;
extern        int     continue_exception;
extern        int     return_exception;


#endif /* __edit_h_ */

--- NEW FILE: color.h ---

#ifndef _INC_COLOR
#define _INC_COLOR

/*
 * DEFAULT_DOUBLE STATUS  can be defined as 0 or 1
 * 0 makes the status line be 1 line only. 1 makes it 2 lines
 * this will be the default for all created windows.
 * DEFAULT_STATUS_LINES can be defined as 0 or 1
 * 0 is off, and 1 makes the window split the default for ALL windows.
 * a window split is the topic bar.
 */

#define NO_NUMERICS_STR "-:-"

#ifdef HUMBLE

#define DEFAULT_FORMAT_381_FSET "%K>%n>%W> You are now an %GIRC%n whore"
#define DEFAULT_FORMAT_391_FSET NULL

#define DEFAULT_FORMAT_471_FSET "$G $1 :Sorry, cannot join channel. %K(%WChannel is full%K)%n"
#define DEFAULT_FORMAT_473_FSET "$G $1 :Sorry, cannot join channel. %K(%WInvite only channel%K)%n"
#define DEFAULT_FORMAT_474_FSET "$G $1 :Sorry, cannot join channel. %K(%WBanned from channel%K)%n"
#define DEFAULT_FORMAT_475_FSET "$G $1 :Sorry, cannot join channel. %K(%WBad channel key%K)%n"
#define DEFAULT_FORMAT_476_FSET "$G $1 :%K(%WYou are not opped%K)%n"

/* Done ACTION */
#ifdef ONLY_STD_CHARS
#define DEFAULT_FORMAT_ACTION_FSET "%@%K* %W$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_AR_FSET "%@%K* %Y$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET "%@%K* %W$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_OTHER_FSET "%@%K* %c$3%K>%W$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET "%@%K* %c$3%K>%Y$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_USER_FSET "%@%K* %c$3%K>%W$1 %n$4-"
#define DEFAULT_FORMAT_ACTION_USER_AR_FSET "%@%K* %c$3%K>%Y$1 %n$4-"
#else /* ONLY_STD_CHARS */
#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%Kð %W$1 %n$4-":"%@ð $1 $4-"
#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%Kð %Y$1 %n$4-":"%@ð $1 $4-"
#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET ansi?"%@%Kð %W$1 %n$4-":"%@ð $1 $4-"
#define DEFAULT_FORMAT_ACTION_OTHER_FSET ansi?"%@%Kð %c$3%K>%W$1 %n$4-":"%@ð $3>$1 $4-"
#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET ansi?"%@%Kð %c$3%K>%Y$1 %n$4-":"%@ð $3>$1 $4-"
#define DEFAULT_FORMAT_ACTION_USER_FSET ansi?"%@%Kð %c$3%K>%W$1 %n$4-":"%@ð $3>$1 $4-"
#define DEFAULT_FORMAT_ACTION_USER_AR_FSET ansi?"%@%Kð %c$3%K>%Y$1 %n$4-":"%@ð $3>$1 $4-"
#endif /* ONLY_STD_CHARS */

/* Done ALIAS, ASSIGN */
#define DEFAULT_FORMAT_ALIAS_FSET "$G    %K$tolower($[10]0)%w $1-"
#define DEFAULT_FORMAT_ASSIGN_FSET "$G    %K$tolower($[10]0)%w $1-"

#define DEFAULT_FORMAT_AWAY_FSET "is away: ($3-) $1 $2"
#define DEFAULT_FORMAT_BACK_FSET "is back from the dead. Gone $1 hrs $2 min $3 secs"

/* Done BANS */
#define DEFAULT_FORMAT_BANS_HEADER_FSET "#  Channel    SetBy        Sec  Ban"
#define DEFAULT_FORMAT_BANS_FSET "%W$[-2]0%K:%n $[26]2 %K(%c$[20]3%K:%c$[24]4-%K)"
#define DEFAULT_FORMAT_BANS_FOOTER_FSET "%K[ %nEnd of channel %W$0 %K- %W$1 %nbans counted %K]"

#define DEFAULT_FORMAT_EBANS_HEADER_FSET "#  Channel    SetBy        Sec  ExemptBan"
#define DEFAULT_FORMAT_EBANS_FSET "%W$[-2]0%K:%n $[26]2 %K(%c$[20]3%K:%c$[24]4-%K)"
#define DEFAULT_FORMAT_EBANS_FOOTER_FSET "%K[ %nEnd of channel %W$0 %K- %W$1 %nexemptbans counted %K]"

#define DEFAULT_FORMAT_BITCH_FSET "%RBitch Mode Activated%n $1 $4 $5 on $3"
#define DEFAULT_FORMAT_BOT_HEADER_FSET "Aop Prot Bot         Channel    Hostname"
#define DEFAULT_FORMAT_BOT_FOOTER_FSET "There are $1 on the BotList"
#define DEFAULT_FORMAT_BOT_FSET "$[2]0 $[2]1 $[11]2 $[10]3 $4"

#define DEFAULT_FORMAT_BWALL_FSET "%K[%cWallOp%K/%c$2%K] %n$4-"

#define DEFAULT_FORMAT_CHANNEL_SIGNOFF_FSET "$G %nSignOff%K: %W$1 %K(%n$4-%K)"
#define DEFAULT_FORMAT_CONNECT_FSET "$G Connecting to server $1/%c$2%n"

/* Done CTCP */
#define DEFAULT_FORMAT_CTCP_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4 from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4 from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FUNC_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4 from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FUNC_USER_FSET " %K>%n>%W> %C$1 %K[%c$2%K]%c requested $4 from you"
#define DEFAULT_FORMAT_CTCP_CLOAK_UNKNOWN_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested unknown ctcp $4 from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_UNKNOWN_USER_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested unknown ctcp $4 from you"
#define DEFAULT_FORMAT_CTCP_CLOAK_USER_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4 from you"
#define DEFAULT_FORMAT_CTCP_FUNC_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4 from $3"
#define DEFAULT_FORMAT_CTCP_FUNC_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4 from you"
#define DEFAULT_FORMAT_CTCP_UNKNOWN_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested unknown ctcp $4 from $3"
#define DEFAULT_FORMAT_CTCP_UNKNOWN_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested unknown ctcp $4 from you"
#define DEFAULT_FORMAT_CTCP_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4 from you"
#define DEFAULT_FORMAT_CTCP_REPLY_FSET "$G %nCTCP %W$3 %nreply from %n$1: $4-"

/* Done DCC */
#define DEFAULT_FORMAT_DCC_CHAT_FSET "%K[%G$1%K(%gdcc%K)] %n$3-"
#define DEFAULT_FORMAT_DCC_CHAT_AR_FSET "%K[%Y$1%K(%Ydcc%K)] %n$3-"
#define DEFAULT_FORMAT_DCC_CONNECT_FSET "$G DCC $1 %nconnection with %W$2%K[%c$4 $5%K]%n established"
#define DEFAULT_FORMAT_DCC_ERROR_FSET "$G %rDCC lost %w$1%w %rto $2 %K[%w$3-%K]"
#define DEFAULT_FORMAT_DCC_LOST_FSET "$G %nDCC %W$1%n:%g$2%n %K[%C$3%K]%n $4 $5 completed in $6 secs %K(%W$7 kb/sec%K)"
#define DEFAULT_FORMAT_DCC_REQUEST_FSET "$G DCC $1 %K(%n$2 $3%K)%n request from %W$4%K[%c$5:$6%K]"

#define DEFAULT_FORMAT_DESYNC_FSET "$G $1 is desynced from $2 at $0"
#define DEFAULT_FORMAT_DISCONNECT_FSET "$G Use %G/Server%n to connect to a server"
#define DEFAULT_FORMAT_ENCRYPTED_NOTICE_FSET "%K-%Y$1%K(%p$2%K)-%n $3-"
#define DEFAULT_FORMAT_ENCRYPTED_PRIVMSG_FSET "%K[%Y$1%K(%p$2%K)]%n $3-"
#define DEFAULT_FORMAT_FLOOD_FSET "%Y$1%n flood detected from %G$2%K(%g$3%K)%n on %K[%G$4%K]"
#define DEFAULT_FORMAT_FRIEND_JOIN_FSET "$G %R$1 %K[%c$2%K]%n has joined $3"
#define DEFAULT_FORMAT_HELP_FSET "$0-"
#define DEFAULT_FORMAT_HOOK_FSET "$0-"
#define DEFAULT_FORMAT_INVITE_FSET "%K>%n>%W> $1 Invites You to $2-"
#define DEFAULT_FORMAT_INVITE_USER_FSET "%K>%n>%W> Inviting $1 to $2-"

/* Done JOIN, LEAVE, KICK, KILL */
#define DEFAULT_FORMAT_JOIN_FSET "$G %C$1 %K[%c$2%K]%n has joined $3"
#define DEFAULT_FORMAT_LEAVE_FSET "$G $1 %K[%w$2%K]%n has left $3-"
#define DEFAULT_FORMAT_KICK_FSET "$G %n$3 was kicked off $2 by %c$1 %K(%n$4-%K)"
#define DEFAULT_FORMAT_KICK_USER_FSET "$G %WYou%n have been kicked off $2 by %c$1 %K(%n$4-%K)"
#define DEFAULT_FORMAT_KILL_FSET "$G %WYou%n have been killed by $1 for $2-"

/* Done LINKS */
#define DEFAULT_FORMAT_LINKS_FSET "$G %K[%c$[-3]0%K] [%c$[-3]3%K] [%n$[-27]1%K]%n <- %K[%n$[-27]2%K]"
#define DEFAULT_FORMAT_LINKS_HEADER_FSET "$G %K[%cNum%K] [%cHop%K]                      [%cServer%K]                         [%cUplink%K]"

/* Done LIST */
#define DEFAULT_FORMAT_LIST_FSET "$G $[12]1 $[-5]2   $[50]3-"
#define DEFAULT_FORMAT_MAIL_FSET "%K>%n>%W> You've got mail!@#"
#define DEFAULT_FORMAT_MSGCOUNT_FSET "[$0-]"

#define DEFAULT_FORMAT_MSGLOG_FSET "[$[8]0] [$1] - $2-"

/* Done MODE SMODE MODE_CHANNEL */
#define DEFAULT_FORMAT_MODE_FSET "$G %nmode%K/%c$3 %K[%W$4-%K]%n by %W$1"
#define DEFAULT_FORMAT_SMODE_FSET "$G %nmodehack%K/%c$2 %K[%W$3-%K]%n by %W$1"
#define DEFAULT_FORMAT_MODE_CHANNEL_FSET "$G %nmode%K/%c$3 %K[%W$4-%K]%n by %W$1"

/* Done MSG */
#define DEFAULT_FORMAT_MSG_FSET "%K[%P$1%K(%p$2%K)]%n $3-"
#define DEFAULT_FORMAT_MSG_AR_FSET "%K[%Y$1%K(%Y$2%K)]%n $3-"

#define DEFAULT_FORMAT_OPER_FSET "%C$1 %K[%c$2%K]%n )s now %Wan%w %GIRC%n whore"

#define DEFAULT_FORMAT_IGNORE_INVITE_FSET "%K>%n>%W> You have been invited to $1-"
#define DEFAULT_FORMAT_IGNORE_MSG_FSET "%K[%P$1%P$2%K(%p$3%K)]%n $4-"
#define DEFAULT_FORMAT_IGNORE_MSG_AWAY_FSET "%K[%P$1%P$2%K(%p$3%K)]%n $4-"
#define DEFAULT_FORMAT_IGNORE_NOTICE_FSET "%K-%P$2%K(%p$3%K)-%n $4-"
#define DEFAULT_FORMAT_IGNORE_WALL_FSET "%K%P$1%n $2-"
/* Done MSG */
#define DEFAULT_FORMAT_MSG_GROUP_FSET "%K-%P$1%K:%p$3%K-%n $4-"
#define DEFAULT_FORMAT_MSG_GROUP_AR_FSET "%K-%Y$1%K:%Y$3%K-%n $4-"

/* Done NAMES */
#define DEFAULT_FORMAT_NAMES_BANNER_FSET "$G "
#define DEFAULT_FORMAT_NAMES_FSET "$G %K[%cUsers%K(%W$1%K:%W$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_NICKCOLOR_FSET "%K[%w $[10]1%K]"
#define DEFAULT_FORMAT_NAMES_NONOP_FSET "$G %K[%cNonChanOps%K(%W$1%K:%W$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_OP_FSET "$G %K[%cChanOps%K(%W$1%K:%W$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_OPCOLOR_FSET "%K[%c$0%w$[10]1%K]"
#define DEFAULT_FORMAT_NAMES_PROMPT_FSET "$G $0-"
#define DEFAULT_FORMAT_NAMES_VOICE_FSET "$G %K[%cVoiceUsers%K(%W$1%K:%W$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_VOICECOLOR_FSET "%K[%M$0%w$[10]1%K]"
/* In bx but not hades*/
#define DEFAULT_FORMAT_NAMES_BOT_FSET "$G %K[%GBots%K(%g$1%K:%g$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_FRIEND_FSET "$G %K[%GFriends%K(%g$1%K:%g$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_BOTCOLOR_FSET "%K[%C$0%G$[10]1%K]"
#define DEFAULT_FORMAT_NAMES_FRIENDCOLOR_FSET "%K[%C$0%Y$[10]1%K]"
#define DEFAULT_FORMAT_NAMES_IRCOP_FSET "$G %K[%GIrcOps%K(%g$1%K:%g$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_SHIT_FSET "$G %K[%MShitUsers%K(%m$1%K:%m$2%K)]%c $3"
#define DEFAULT_FORMAT_NAMES_SHITCOLOR_FSET "%K[%C$0%n%R$[10]1%K]"

#define DEFAULT_FORMAT_NETADD_FSET "$G %nAdded: %W$1 $2"
#define DEFAULT_FORMAT_NETSPLIT_FSET "$G %nNetsplit detected%K: %W$1%n split from %W$2 %K[%c$0%K]"
#define DEFAULT_FORMAT_NETJOIN_FSET "$G %nNetjoined%K: %W$1%n to %W$2"

/* nickname_fset not in hades*/
#define DEFAULT_FORMAT_NICKNAME_FSET "$G %W$1 %nis now known as %c$3"
#define DEFAULT_FORMAT_NICKNAME_OTHER_FSET "$G %W$1 %nis now known as %c$3"
#define DEFAULT_FORMAT_NICKNAME_USER_FSET "$G %WYou%K(%n$1%K)%n are now known as %c$3"

/* Done NONICK, no NONICK_FROM in bx */
#define DEFAULT_FORMAT_NONICK_FSET "$G %W$1%K:%n $3-"
/*#define DEFAULT_FORMAT_NONICK_FROM_FSET "$G %W$1%K:%n $3- %K[%Cfrom %c$2%K]"*/

#define DEFAULT_FORMAT_NOTE_FSET "($0) ($1) ($2) ($3) ($4) ($5-)"

#define DEFAULT_FORMAT_NOTICE_FSET "%K-%P$1%K-%n $2-"

#define DEFAULT_FORMAT_REL_FSET  "%K[%rmsg->$1%K]%n $4-"
#define DEFAULT_FORMAT_RELN_FSET "-$1:$3- $4-"
#define DEFAULT_FORMAT_RELM_FSET "[$1($2)] $4-"

#define DEFAULT_FORMAT_RELS_FSET "[***] $0-"
#define DEFAULT_FORMAT_RELSN_FSET "-> [notice($1)] $2-"
#define DEFAULT_FORMAT_RELSM_FSET "-> [msg($1)] $2-"

#define DEFAULT_FORMAT_NOTIFY_SIGNOFF_FSET "$G %GSignoff%n by %r$1%K!%r$2%n at $0"
#define DEFAULT_FORMAT_NOTIFY_SIGNON_FSET "$G %GSignon%n by %R$1%K!%R$2%n at $0"
#define DEFAULT_FORMAT_PASTE_FSET "%K[%W$1%K]%n $2-"

/* Done PUBLIC */
#define DEFAULT_FORMAT_PUBLIC_FSET "%b<%n$1%b>%n $3-"
#define DEFAULT_FORMAT_PUBLIC_AR_FSET "%b<%Y$1%b>%n $3-"
#define DEFAULT_FORMAT_PUBLIC_MSG_FSET "%b(%n$1%K/%n$3%b)%n $4-"
#define DEFAULT_FORMAT_PUBLIC_MSG_AR_FSET "%b(%Y$1%K/%Y$3%b)%n $4-"
#define DEFAULT_FORMAT_PUBLIC_NOTICE_FSET "%K-%P$1%K:%p$3%K-%n $5-"
#define DEFAULT_FORMAT_PUBLIC_NOTICE_AR_FSET "%K-%Y$1%K:%Y$3%K-%n $5-"
#define DEFAULT_FORMAT_PUBLIC_OTHER_FSET "%b<%n$1%K:%n$2%b>%n $3-"
#define DEFAULT_FORMAT_PUBLIC_OTHER_AR_FSET "%b<%Y$1%K:%Y$2%b>%n $3-"

/* Done SEND */
#define DEFAULT_FORMAT_SEND_ACTION_FSET "%Kð %W$1 %n$3-"
#define DEFAULT_FORMAT_SEND_ACTION_OTHER_FSET "%Kð %n-> %c$2%K>%W$1 %n$3-"
#define DEFAULT_FORMAT_SEND_DCC_CHAT_FSET "%K[%rdcc%K(%R$1%K)] %n$2-"
#define DEFAULT_FORMAT_SEND_MSG_FSET "%K[%rmsg%K(%R$1%K)] %n$3-"
#define DEFAULT_FORMAT_SEND_NOTICE_FSET "%K[%rnotice%K(%R$1%K)] %n$3-"
#define DEFAULT_FORMAT_SEND_PUBLIC_FSET "%p<%n$2%p>%n $3-"
#define DEFAULT_FORMAT_SEND_PUBLIC_OTHER_FSET "%p<%n$2%K:%n$1%p>%n $3-"
/* Not in Hades*/
#define DEFAULT_FORMAT_SEND_AWAY_FSET "[Away ($strftime($1 %a %b %d %I:%M%p %Z))] [$tdiff2(${time() - u})] [BX-MsgLog $2]"
#define DEFAULT_FORMAT_SEND_CTCP_FSET "%K[%rctcp%K(%R$1%K)] %n$2"
#define DEFAULT_FORMAT_SEND_RCTCP_FSET "%K[%rrctcp%K(%R$1%K)] %n$2-"
#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K-%Y$1%K(%p$2%K)-%n $2-"
#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%Y$1%K(%p$2%K)]%n $2-"


#define DEFAULT_FORMAT_SERVER_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG1_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG1_FROM_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG2_FSET "$G%n $1-"
#define DEFAULT_FORMAT_SERVER_MSG2_FROM_FSET "$G%n $1-"

#define DEFAULT_FORMAT_SERVER_NOTICE_FSET "%K[%c***%K] %n$2-"
/*#define DEFAULT_FORMAT_SERVER_NOTICE_FSET "$2-"*/
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT_FSET "Possible bot: %C$1 %K[%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT1_FSET "Possible $1 bot: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT_ALARM_FSET "$1 alarm activated: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_CONNECT_FSET "Client Connecting: %C$1 %K[%c$2%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_EXIT_FSET "Client Exiting: %C$1 %K[%c$2-%K] %K[%c$3-%K]"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_INVALID_FSET "Invalid username: %C$1%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_TERM_FSET "Terminating client for excess flood %C$1%K [%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_FAKE_FSET "Fake Mode detected on $1 -> $2-"
#define DEFAULT_FORMAT_SERVER_NOTICE_KILL_FSET "Foreign OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_KILL_LOCAL_FSET "Local OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n for $3-"
#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n from $3 for $4-"
#define DEFAULT_FORMAT_SERVER_NOTICE_NICK_COLLISION_FSET "Nick collision %W$1%n killed %c$2%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_OPER_FSET "%C$1 %K[%c$2%K]%n is now %Wan%w %GIRC%n whore"
#define DEFAULT_FORMAT_SERVER_NOTICE_REHASH_FSET "%W$1%n is rehashing the Server config file"
#define DEFAULT_FORMAT_SERVER_NOTICE_STATS_FSET "Stats $1: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_TRAFFIC_HIGH_FSET "Entering high-traffic mode %K(%n$1 > $2-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_TRAFFIC_NORM_FSET "Resuming standard operation %K(%n$1 $2 $3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_UNAUTH_FSET "Unauthorized Connection from $1-"

#define DEFAULT_FORMAT_SET_FSET "$G    %K$tolower($[27]0) %w$1-"
#define DEFAULT_FORMAT_CSET_FSET "%r$[-14]1 %R$[-20.]0   %w$2-"
#define DEFAULT_FORMAT_SET_NOVALUE_FSET "$G    %K$tolower($0) has no value"
#define DEFAULT_FORMAT_SHITLIST_FSET " $[3]0 $[34]1 $[10]2  $3-"
#define DEFAULT_FORMAT_SHITLIST_FOOTER_FSET "There are $1 users on the shitlist"
#define DEFAULT_FORMAT_SHITLIST_HEADER_FSET " lvl nick!user at host                     channels   reason"
#define DEFAULT_FORMAT_SIGNOFF_FSET "$G %nSignOff%K: %W$1 %K(%n$3-%K)"

#define DEFAULT_FORMAT_SILENCE_FSET "$G %RWe are $1 silencing $2 at $0"

#define DEFAULT_FORMAT_TRACE_OPER_FSET "%R$1%n %K[%n$3%K]"
#define DEFAULT_FORMAT_TRACE_SERVER_FSET "%R$1%n $2 $3 $4 %K[%n$5%K]%n $6-"
#define DEFAULT_FORMAT_TRACE_USER_FSET "%R$1%n %K[%n$3%K]"

#define DEFAULT_FORMAT_TIMER_FSET "$G $[-5]0 $[-10]1 $[-6]2 $3-"

/* Done TOPIC */
#define DEFAULT_FORMAT_TOPIC_FSET "$G Topic for %c$1%K:%n $2-"
#define DEFAULT_FORMAT_TOPIC_CHANGE_FSET "$G %W$1 %nhas changed the topic on channel %W$2%n to%K:%n $3-"
#define DEFAULT_FORMAT_TOPIC_SETBY_FSET "$G %nTopic set by %c$2%K [%c$stime($3) ago%K]"
#define DEFAULT_FORMAT_TOPIC_UNSET_FSET "$G %nTopic unset by $1 on $2"

#define DEFAULT_FORMAT_USAGE_FSET "$G Usage: /$0  $1-"
#define DEFAULT_FORMAT_USERMODE_FSET "$G %nMode change %K[%W$4-%K]%n for user %c$3"

#define DEFAULT_FORMAT_USERLIST_FSET "$[16]0 $[10]1 $[-10]2   $[-25]3 $[10]4"

#define DEFAULT_FORMAT_USERLIST_FOOTER_FSET "There are $1 users on the userlist"
#define DEFAULT_FORMAT_USERLIST_HEADER_FSET "level            nick       password     host                      channels"

#define DEFAULT_FORMAT_USERS_HEADER_FSET "%K[ %WC%nhannel   %K] [ %WN%wickname  %K] [ %WU%wser at host                            %K] [ %WL%wevel %K]"
#define DEFAULT_FORMAT_USERS_FSET "%K[%n$[11]1%K] [%C$5%c$[10]2%K] [%n$[38]3%K][%n$[7]0%K]"
#define DEFAULT_FORMAT_USERS_USER_FSET "%K[%n$[11]1%K] [%C$5%c$[10]2%K] [%p$[38]3%K][%n$[7]0%K]"
#define DEFAULT_FORMAT_USERS_SHIT_FSET "%K[%n$[11]1%K] [%C$5%c$[10]2%K] [%r$[38]3%K][%n$[7]0%K]"
#define DEFAULT_FORMAT_USERS_TITLE_FSET NULL


/* #define DEFAULT_FORMAT_USERS_FOOTER_FSET "%K[ %nEnd of channel %W$0 %K- %W$1 %nusers counted %K]"*/
/* #define DEFAULT_FORMAT_USERS_NONE_FSET "$G No match of %W$0%n on %c$1"*/

#define DEFAULT_FORMAT_VERSION_FSET "\002$0+$4$5\002 by panasync \002-\002 $2 $3"

#define DEFAULT_FORMAT_WALL_FSET "%G!%g$1:$2%G!%n $3-"
#define DEFAULT_FORMAT_WALL_AR_FSET "%G!%Y$1:$2%G!%n $3-"

#define DEFAULT_FORMAT_WALLOP_FSET "%K[%cWallOp%K] %n$2- ($1)"
#define DEFAULT_FORMAT_WHO_FSET "$[7]0 %W$[9]1%w $[3]2 $3@$4 ($6-)"

/* Done WHOIS WHOLEFT WHOWAS */
#define DEFAULT_FORMAT_WHOIS_AWAY_FSET "%K³ %Wa%nway     %K:%n $1-"
#define DEFAULT_FORMAT_WHOIS_BOT_FSET "%g³ %Wb%not      %K:%n A:$0 P:$1 [$2] $3-"
#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET "%g³ %Wc%nhannels %K:%n $0-"
#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET "%g³ %Wf%nriend   %K:%n L:$0 A:$1 P:$2 $3-"
#define DEFAULT_FORMAT_WHOIS_HEADER_FSET "%GÚÄÄÄÄÄÄÄÄ%gÄ%GÄÄ%gÄÄ%GÄ%gÄÄÄÄÄÄÄÄÄ%KÄ%gÄÄ%KÄÄ%gÄ%KÄÄÄÄÄÄÄÄÄÄ-Ä ÄÄ  Ä   -"
#define DEFAULT_FORMAT_WHOIS_IDLE_FSET "%K. %Wi%ndle     %K:%n $0 hours $1 mins $2 secs (signon: $stime($3))"
#define DEFAULT_FORMAT_WHOIS_SHIT_FSET "%g³ %Ws%nhit     %K:%n L:$0 [$1] $2 $3-"
#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET "%K: %Ws%nignon   %K:%n $0-"
#define DEFAULT_FORMAT_WHOIS_ACTUALLY_FSET "%K| %Wa%nctually %K:%n $0-"
#define DEFAULT_FORMAT_WHOIS_NAME_FSET "%G³ %Wi%nrcname  %K:%n $0-"
#define DEFAULT_FORMAT_WHOIS_NICK_FSET "%G³ %W$0 %K(%n$1@$2%K) (%n$3-%K)"
#define DEFAULT_FORMAT_WHOIS_OPER_FSET "%K| %Wo%nperator %K:%n $0 $1-"
#define DEFAULT_FORMAT_WHOIS_SERVER_FSET "%K³ %Ws%nerver   %K:%n $0 ($1-)"
#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET "%PÚÄÄÄÄÄ %WWho %PÄÄÄÄÄ%pÄÄÄ%PÄÄÄ%pÄÄ%PÄÄÄÄÄ%pÄÄ%PÄÄ %WChannel%p Ä%KÄ %WServer %KÄ%pÄÄÄÄ%KÄÄ%pÄÄ%KÄÄ-- %WSeconds"
#define DEFAULT_FORMAT_WHOLEFT_USER_FSET "%P³%n $[-10]0!$[20]1 $[10]2 $[20]4 $3"
#define DEFAULT_FORMAT_WHOLEFT_FOOTER_FSET "%PÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ%pÄÄ%PÄÄÄ%pÄÄÄ%PÄÄ%pÄ%PÄ%pÄÄÄÄÄ%KÄ%pÄÄÄ%KÄÄÄ%pÄÄ%KÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ-- --  -"
#define DEFAULT_FORMAT_WHOWAS_NICK_FSET "%G³ %W$0%n was %K(%n$1@$2%K)"
/* Not convered in hades*/
#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET   "%K| %Wa%ndmin    : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET "%K| %Ws%nervice  : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_HELP_FSET    "%K| %Wh%nelp     : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET "%K| %Wr%negister : $0 - $1-"

#define DEFAULT_FORMAT_WIDELIST_FSET "$1-"
#define DEFAULT_FORMAT_WINDOW_SET_FSET "$0-"

#define DEFAULT_FORMAT_NICK_MSG_FSET "$0 $1 $2-"

#define DEFAULT_FORMAT_NICK_COMP_FSET "$0:$1-"
#define DEFAULT_FORMAT_NICK_AUTO_FSET "$0:$1-"

#define DEFAULT_FORMAT_STATUS_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS1_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS2_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS3_FSET "%4%W$0-"
#define DEFAULT_FORMAT_NOTIFY_OFF_FSET "$[10]0 $[35]1 $[-6]2 $[-10]3 $4 $5"
#define DEFAULT_FORMAT_NOTIFY_ON_FSET "$[10]0 $[35]1 $[-6]2 $[-10]3 $4-"
#define DEFAULT_FORMAT_OV_FSET "%S %>[OperView] "
#define DEFAULT_FORMAT_DEBUG_FSET "DEBUG"

#define DEFAULT_FORMAT_COMPLETE_FSET "%K[%n$[15]0%K] [%n$[15]1%K] [%n$[15]2%K] [%n$[15]3%K]"	

#define DEFAULT_FORMAT_WHOIS_FOOTER_FSET NULL
#define DEFAULT_FORMAT_XTERM_TITLE_FSET NULL
#define DEFAULT_FORMAT_DCC_FSET NULL
#define DEFAULT_FORMAT_NAMES_FOOTER_FSET NULL
#define DEFAULT_FORMAT_NETSPLIT_HEADER_FSET NULL
#define DEFAULT_FORMAT_TOPIC_CHANGE_HEADER_FSET NULL
#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET NULL


/* Color.h by Humble - Lets try the hades look =) */

#define DEFAULT_STATUS_FORMAT "Ú%T %*%N%# %@%C%+ %A%W%H%B%M%Q %>%D %L ]"
#define DEFAULT_STATUS_FORMAT1 "ÚÄ User: %*%N%#%A %^%H%B %>%D %S Ä¿"
#define DEFAULT_STATUS_FORMAT2 "³  Channel: %@%C%+%W %M%Q %>%T %L ÄÙ"

#define DEFAULT_STATUS_AWAY "(A)"
#define DEFAULT_STATUS_CHANNEL "%C"
#define DEFAULT_STATUS_CHANOP "@"
#define DEFAULT_STATUS_HALFOP "%"
#define DEFAULT_STATUS_CLOCK "Time: %T"
#define DEFAULT_STATUS_HOLD " --More--"
#define DEFAULT_STATUS_HOLD_LINES " Hold: %B"
#define DEFAULT_STATUS_LAG " Lag: %L"
#define DEFAULT_STATUS_MODE "(%+)"
#define DEFAULT_STATUS_MAIL " Mail: %M"
#define DEFAULT_STATUS_NOTIFY " Notify: %F"
#define DEFAULT_STATUS_OPER "*"
#define DEFAULT_STATUS_VOICE "+"
#define DEFAULT_STATUS_QUERY " Query: %Q"
#define DEFAULT_STATUS_SERVER "Server: %S"
#define DEFAULT_STATUS_UMODE "(+%#)"
#define DEFAULT_STATUS_OPER_KILLS "[nk %d:ok %d]"
#define DEFAULT_STATUS_WINDOW "[þ]"

#define DEFAULT_STATUS_FORMAT3 "BitchX by panasync, Hades formats by Humble"
#define DEFAULT_STATUS_INSERT ""
#define DEFAULT_STATUS_MSGCOUNT " Msgs: (%^)"
#define DEFAULT_STATUS_NICK "%N"
#define DEFAULT_STATUS_OVERWRITE "(overtype) "
#define DEFAULT_STATUS_TOPIC "%-"
#define DEFAULT_STATUS_USER " * type /help for help "
#define DEFAULT_STATUS_DCCCOUNT  "[DCC  gets/%& sends/%&]"
#define DEFAULT_STATUS_CDCCCOUNT "[CDCC gets/%| offer/%|]"
#define DEFAULT_STATUS_USERS "[O/%! N/%! I/%! V/%! F/%!]"
#define DEFAULT_STATUS_CPU_SAVER " (%J)"

#define DEFAULT_STATUS_USER1 ""
#define DEFAULT_STATUS_USER2 ""
#define DEFAULT_STATUS_USER3 ""
#define DEFAULT_STATUS_USER4 ""
#define DEFAULT_STATUS_USER5 ""
#define DEFAULT_STATUS_USER6 ""
#define DEFAULT_STATUS_USER7 ""
#define DEFAULT_STATUS_USER8 ""
#define DEFAULT_STATUS_USER9 ""
#define DEFAULT_STATUS_USER10 ""
#define DEFAULT_STATUS_USER11 ""
#define DEFAULT_STATUS_USER12 ""
#define DEFAULT_STATUS_USER13 ""
#define DEFAULT_STATUS_USER14 ""
#define DEFAULT_STATUS_USER15 ""
#define DEFAULT_STATUS_USER16 ""
#define DEFAULT_STATUS_USER17 ""
#define DEFAULT_STATUS_USER18 ""
#define DEFAULT_STATUS_USER19 ""
#define DEFAULT_STATUS_USER20 "" 
#define DEFAULT_STATUS_USER21 ""
#define DEFAULT_STATUS_USER22 ""
#define DEFAULT_STATUS_USER23 ""
#define DEFAULT_STATUS_USER24 ""
#define DEFAULT_STATUS_USER25 ""
#define DEFAULT_STATUS_USER26 ""
#define DEFAULT_STATUS_USER27 ""
#define DEFAULT_STATUS_USER28 ""
#define DEFAULT_STATUS_USER29 ""
#define DEFAULT_STATUS_USER30 "" 
#define DEFAULT_STATUS_USER31 ""
#define DEFAULT_STATUS_USER32 ""
#define DEFAULT_STATUS_USER33 ""
#define DEFAULT_STATUS_USER34 ""
#define DEFAULT_STATUS_USER35 ""
#define DEFAULT_STATUS_USER36 ""
#define DEFAULT_STATUS_USER37 ""
#define DEFAULT_STATUS_USER38 ""
#define DEFAULT_STATUS_USER39 ""
#define DEFAULT_STATUS_FLAG ""
#define DEFAULT_STATUS_SCROLLBACK " (Scroll)"

#define DEFAULT_FORMAT_LASTLOG_FSET "$strftime($0 %H:%M) $1-"

#define DEFAULT_INPUT_PROMPT "À-[bitchx]Ä> "

#ifndef ONLY_STD_CHARS
#define DEFAULT_SHOW_NUMERICS_STR "ùíù"
#else
#ifndef LATIN1
#define DEFAULT_SHOW_NUMERICS_STR "***"
#else
#define DEFAULT_SHOW_NUMERICS_STR "-:-"
#endif
#endif


#define DEFAULT_SERVER_PROMPT "%K[%c$0%K] "

#define DEFAULT_FORMAT_WATCH_SIGNOFF_FSET "$G $0!$1@$2 has signed off"
#define DEFAULT_FORMAT_WATCH_SIGNON_FSET "$G $0!$1@$2 has signed on $3"

#else 

/* default bx */

#define DEFAULT_FORMAT_381_FSET "%K>%n>%W> You are now an %GIRC%n whore"
#define DEFAULT_FORMAT_391_FSET NULL

#define DEFAULT_FORMAT_471_FSET "$G [$1] Channel is full"
#define DEFAULT_FORMAT_473_FSET "$G [$1] Invite only channel"
#define DEFAULT_FORMAT_474_FSET "$G [$1] Banned from channel"
#define DEFAULT_FORMAT_475_FSET "$G [$1] Bad channel key"
#define DEFAULT_FORMAT_476_FSET "$G [$1] You are not opped"

#ifdef ONLY_STD_CHARS
#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%K* %W$1 %n$4-":"* $1 $4-"
#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%K* %Y$1 %n$4-":"* $1 $4-"
#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET ansi?"%@%K* %Y$1/$3 %n$4-":"* $1/$3 $4-"
#define DEFAULT_FORMAT_ACTION_OTHER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET ansi?"%@%K* %Y>%c$1 %n$3-":"* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_USER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_USER_AR_FSET ansi?"%@%K* %Y>%c$1 %n$3-":"* >$1 $3-"
#else
#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%Kð %W$1 %n$4-":"%@ð $1 $4-"
#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%Kð %Y$1 %n$4-":"%@ð $1 $4-"
#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET ansi?"%@%Kð %Y$1/$3 %n$4-":"%@ð $1/$3 $4-"
#define DEFAULT_FORMAT_ACTION_OTHER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"%@* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET ansi?"%@%K* %Y>%c$1 %n$3-":"%@* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_USER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"%@* >$1 $3-"
#define DEFAULT_FORMAT_ACTION_USER_AR_FSET ansi?"%@%K* %Y>%c$1 %n$3-":"%@* >$1 $3-"
#endif



#define DEFAULT_FORMAT_ALIAS_FSET "Alias $[20.]0 $1-"
#define DEFAULT_FORMAT_ASSIGN_FSET "Assign $[20.]0 $1-"
#define DEFAULT_FORMAT_AWAY_FSET "is away: ($3-) $1 $2"	
#define DEFAULT_FORMAT_BACK_FSET "is back from the dead. Gone $1 hrs $2 min $3 secs"
#define DEFAULT_FORMAT_BANS_HEADER_FSET "#  Channel    SetBy        Sec  Ban"
#define DEFAULT_FORMAT_BANS_FSET "$[2]0 $[10]1 $[10]3 $[-5]numdiff($time() $4)  $2"

#define DEFAULT_FORMAT_EBANS_HEADER_FSET "#  Channel    SetBy        Sec  ExemptBan"
#define DEFAULT_FORMAT_EBANS_FSET "$[2]0 $[10]1 $[10]3 $[-5]numdiff($time() $4)  $2"

#define DEFAULT_FORMAT_BITCH_FSET "%RBitch Mode Activated%n $1 $4 $5 on $3"
#define DEFAULT_FORMAT_BOT_HEADER_FSET "Aop Prot Bot         Channel    Hostname"
#define DEFAULT_FORMAT_BOT_FOOTER_FSET "There are $1 on the BotList"
#define DEFAULT_FORMAT_BOT_FSET "$[2]0 $[2]1 $[11]2 $[10]3 $4"

#define DEFAULT_FORMAT_BWALL_FSET "[%GBX-Wall%n/%W$1:$2%n] $4-"

#define DEFAULT_FORMAT_CHANNEL_SIGNOFF_FSET "$G %nSignOff %W$1%n: $3 %K(%n$4-%K)"
#define DEFAULT_FORMAT_CONNECT_FSET "$G Connecting to server $1/%c$2%n"

#define DEFAULT_FORMAT_COMPLETE_FSET "%K[%n$[15]0%K] [%n$[15]1%K] [%n$[15]2%K] [%n$[15]3%K]"	
#define DEFAULT_FORMAT_CTCP_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4- from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4- from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FUNC_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4- from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_FUNC_USER_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4- from you"
#define DEFAULT_FORMAT_CTCP_CLOAK_UNKNOWN_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested unknown ctcp $4- from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_UNKNOWN_USER_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested unknown ctcp $4- from $3"
#define DEFAULT_FORMAT_CTCP_CLOAK_USER_FSET "%K>%n>%W> %C$1 %K[%c$2%K]%c requested $4- from you"
#define DEFAULT_FORMAT_CTCP_FUNC_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4- from $3"
#define DEFAULT_FORMAT_CTCP_FUNC_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4- from you"
#define DEFAULT_FORMAT_CTCP_UNKNOWN_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested unknown ctcp $4- from $3"
#define DEFAULT_FORMAT_CTCP_UNKNOWN_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested unknown ctcp $4- from %g$3"
#define DEFAULT_FORMAT_CTCP_USER_FSET "%K>%n>%W> %G$1 %K[%g$2%K]%g requested $4- from you"
#define DEFAULT_FORMAT_CTCP_REPLY_FSET "$G %nCTCP %W$3 %nreply from %n$1: $4-"


#define DEFAULT_FORMAT_DCC_CHAT_FSET ansi?"%@%K[%G$1%K(%gdcc%K)] %n$3-":"%@[$1(dcc)] $3-"
#define DEFAULT_FORMAT_DCC_CHAT_AR_FSET ansi?"%@%K[%Y$1%K(%Ydcc%K)] %n$3-":"%@[$1(dcc)] $3-"
#define DEFAULT_FORMAT_DCC_CONNECT_FSET "$G %RDCC%n $1 with %W$2%K[%c$4:$5%K]%n established"
#define DEFAULT_FORMAT_DCC_ERROR_FSET "$G %RDCC%n lost %w$1%w %rto $2 %K[%w$3-%K]"
#define DEFAULT_FORMAT_DCC_LOST_FSET "%@$G %RDCC%n %W$1%n:%g$2%n %K[%C$3%K]%n $4 $5 completed in $6 secs %K(%W$7 $8/sec%K)"
#define DEFAULT_FORMAT_DCC_REQUEST_FSET "%@$G %RDCC%n $1 %K(%n$2%K)%n request from %W$3%K[%c$4 [$5:$6]%K]%n $8 $7"
#define DEFAULT_FORMAT_DESYNC_FSET "$G $1 is desynced from $2 at $0"
#define DEFAULT_FORMAT_DISCONNECT_FSET "$G Use %G/Server%n to connect to a server"
#define DEFAULT_FORMAT_ENCRYPTED_NOTICE_FSET "%@%K-%Y$1%K(%p$2%K)-%n $3-"
#define DEFAULT_FORMAT_ENCRYPTED_PRIVMSG_FSET "%@%K[%Y$1%K(%p$2%K)]%n $3-"
#define DEFAULT_FORMAT_FLOOD_FSET "%Y$1%n flood detected from %G$2%K(%g$3%K)%n on %K[%G$4%K]"
#define DEFAULT_FORMAT_FRIEND_JOIN_FSET "$G %R$1 %K[%c$2%K]%n has joined $3"
#define DEFAULT_FORMAT_HELP_FSET "$0-"
#define DEFAULT_FORMAT_HOOK_FSET "$0-"
#define DEFAULT_FORMAT_INVITE_FSET "%K>%n>%W> $1 Invites You to $2-"
#define DEFAULT_FORMAT_INVITE_USER_FSET "%K>%n>%W> Inviting $1 to $2-"
#define DEFAULT_FORMAT_JOIN_FSET ansi?"$G %C$1 %K[%c$2%K]%n has joined $3":"$G $1 [$2] has joined $3"
#define DEFAULT_FORMAT_KICK_FSET "$G %n$3 was kicked off $2 by %c$1 %K(%n$4-%K)"
#define DEFAULT_FORMAT_KICK_USER_FSET "%K>%n>%W> %WYou%n have been kicked off %c$2%n by %c$1 %K(%n$4-%K)"
#define DEFAULT_FORMAT_KILL_FSET "%K>%n>%W> %RYou have been killed by $1 for $2-"
#define DEFAULT_FORMAT_LEAVE_FSET "$G $1 %K[%w$2%K]%n has left $3 %K[%W$4-%K]"

#ifdef ONLY_STD_CHARS
#define DEFAULT_FORMAT_LINKS_FSET "%K|%n$[24]0%K| |%n$[24]1%K| |%n$[3]2%K| |%n$[13]3%K|"
#else
#define DEFAULT_FORMAT_LINKS_FSET "%K³%n$[24]0%K³ ³%n$[24]1%K³ ³%n$[3]2%K³ ³%n$[13]3%K³"
#endif

#define DEFAULT_FORMAT_LIST_FSET "$[12]1 $[-5]2   $[40]3-"
#define DEFAULT_FORMAT_MAIL_FSET "%K>%n>%W> You've got mail!@#"
#define DEFAULT_FORMAT_MSGCOUNT_FSET "[$0-]"
	
#define DEFAULT_FORMAT_MSGLOG_FSET "[$[8]0] [$1] - $2-"
	
#define DEFAULT_FORMAT_MODE_FSET ansi?"$G %nmode%K/%c$3 %K[%W$4-%K]%n by %W$1":"$G mode/$3 [$4-] by $1"
#define DEFAULT_FORMAT_SMODE_FSET "$G %RServerMode%K/%c$3 %K[%W$4-%K]%n by %W$1"

#define DEFAULT_FORMAT_MODE_CHANNEL_FSET "$G %nmode%K/%c$3 %K[%W$4-%K]%n by %W$1"

#define DEFAULT_FORMAT_MSG_FSET ansi?"%@%K[%P$1%K(%p$2%K)]%n $3-":"%@[$1($2)] $3-"
#define DEFAULT_FORMAT_MSG_AR_FSET ansi?"%@%K[%Y$1%K(%Y$2%K)]%n $3-":"%@[$1($2)] $3-"

#define DEFAULT_FORMAT_OPER_FSET "%C$1 %K[%c$2%K]%n )s now %Wan%w %GIRC%n whore"

#define DEFAULT_FORMAT_IGNORE_INVITE_FSET "%K>%n>%W> You have been invited to $1-"
#define DEFAULT_FORMAT_IGNORE_MSG_FSET "%K[%P$1%P$2%K(%p$3%K)]%n $4-"
#define DEFAULT_FORMAT_IGNORE_MSG_AWAY_FSET "%K[%P$1%P$2%K(%p$3%K)]%n $4-"
#define DEFAULT_FORMAT_IGNORE_NOTICE_FSET "%K-%P$2%K(%p$3%K)-%n $4-"
#define DEFAULT_FORMAT_IGNORE_WALL_FSET "%K%P$1%n $2-"
#define DEFAULT_FORMAT_MSG_GROUP_FSET "%K-%P$1%K:%p$2%K-%n $3-"
#define DEFAULT_FORMAT_MSG_GROUP_AR_FSET "%K-%Y$1%K:%Y$2%K-%n $3-"

#define DEFAULT_FORMAT_NAMES_FSET ansi?"$G %K[%GUsers%K(%g$1%K:%g$2%K)]%c $3":"$G [Users($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_BOT_FSET ansi?"$G %K[%GBots%K(%g$1%K:%g$2%K)]%c $3":"$G [Bots($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_FRIEND_FSET ansi?"$G %K[%GFriends%K(%g$1%K:%g$2%K)]%c $3":"$G [Friends($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_BOTCOLOR_FSET ansi?"%K[%C$0%G$[10]1%K]":"[$0$[10]1]"
#define DEFAULT_FORMAT_NAMES_FRIENDCOLOR_FSET ansi?"%K[%C$0%Y$[10]1%K]":"[$0$[10]1]"
#define DEFAULT_FORMAT_NAMES_NICKCOLOR_FSET ansi?"%K[%B $[10]1%K]":"[ $[10]1]"
#define DEFAULT_FORMAT_NAMES_NONOP_FSET ansi?"$G %K[%GNonChanOps%K(%g$1%K:%g$2%K)]%c $3":"$G [NonChanOps($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_VOICECOLOR_FSET ansi?"%K[%Mv%B$[10]1%K]":"[v$[10]1]"
#define DEFAULT_FORMAT_NAMES_OP_FSET ansi?"$G %K[%GChanOps%K(%g$1%K:%g$2%K)]%c $3":"$G [ChanOps($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_IRCOP_FSET ansi?"$G %K[%GIrcOps%K(%g$1%K:%g$2%K)]%c $3":"$G [IrcOps($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_SHIT_FSET ansi?"$G %K[%MShitUsers%K(%m$1%K:%m$2%K)]%c $3":"$G [ShitUsers(_$1:$2_)] $3"
#define DEFAULT_FORMAT_NAMES_SHITCOLOR_FSET ansi?"%K[%C$0%n%R$[10]1%K]":"[_$0$[10]1_]"
#define DEFAULT_FORMAT_NAMES_VOICE_FSET ansi?"$G %K[%MVoiceUsers%K(%m$1%K:%m$2%K)]%c $3":"$G [VoiceUsers($1:$2)] $3"
#define DEFAULT_FORMAT_NAMES_OPCOLOR_FSET ansi?"%K[%C$0%n%B$[10]1%K]":"[$0$[10]1]"

#define DEFAULT_FORMAT_NETADD_FSET "$G %nAdded: %W$1 $2"
#define DEFAULT_FORMAT_NETJOIN_FSET "$G %nNetjoined: %W$1 $2"
#define DEFAULT_FORMAT_NETSPLIT_FSET "$G %nNetSplit: %W$1%n split from %W$2 %K[%c$0%K]"
#define DEFAULT_FORMAT_NICKNAME_FSET "$G %W$1 %nis now known as %c$3"
#define DEFAULT_FORMAT_NICKNAME_OTHER_FSET "$G %W$1 %nis now known as %c$3"
#define DEFAULT_FORMAT_NICKNAME_USER_FSET "%K>%n>%W> %WYou%K(%n$1%K)%n are now known as %c$3"
#define DEFAULT_FORMAT_NONICK_FSET "%W$1%K:%n $3-"


#define DEFAULT_FORMAT_NOTE_FSET "($0) ($1) ($2) ($3) ($4) ($5-)"


#define DEFAULT_FORMAT_NOTICE_FSET ansi?"%K-%P$1%K(%p$2%K)-%n $3-":"-$1($2)- $3-"

#define DEFAULT_FORMAT_REL_FSET "%K[%rmsg->$1%K]%n $4-"
#define DEFAULT_FORMAT_RELN_FSET "%K-%P$1%K(%p$2%K)-%n $4-"
#define DEFAULT_FORMAT_RELM_FSET "%K[%P%P$1%K(%p$2%K)]%n $4-"

#define DEFAULT_FORMAT_RELSN_FSET "%K[%rnotice%K(%R$1%K)] %n$2-"
#define DEFAULT_FORMAT_RELS_FSET "$1-"
#define DEFAULT_FORMAT_RELSM_FSET "%K[%rmsg%K(%R$1%K)] %n$2-"

#define DEFAULT_FORMAT_NOTIFY_SIGNOFF_FSET "$G %GSignoff%n by %r$1%K!%r$2%n at $0"
#define DEFAULT_FORMAT_NOTIFY_SIGNON_FSET "$G %GSignon%n by %R$1%K!%R$2%n at $0"
#define DEFAULT_FORMAT_PASTE_FSET "%K[%W$1%K]%n $2-"
#define DEFAULT_FORMAT_PUBLIC_FSET ansi?"%@%B<%n$1%B>%n $3-":"%@<$1> $3-"
#define DEFAULT_FORMAT_PUBLIC_AR_FSET ansi?"%@%B<%Y$1%B>%n $3-":"%@<$1> $3-"
#define DEFAULT_FORMAT_PUBLIC_MSG_FSET ansi?"%@%b(%n$1%K/%n$3%b)%n $4-":"%@($1/$3) $4-"
#define DEFAULT_FORMAT_PUBLIC_MSG_AR_FSET ansi?"%@%b(%Y$1%K/%Y$3%b)%n $4-":"%@($1/$3) $4-"

#define DEFAULT_FORMAT_PUBLIC_NOTICE_FSET ansi?"%@%K-%P$1%K:%p$3%K-%n $4-":"%@-$1:$3- $4-"
#define DEFAULT_FORMAT_PUBLIC_NOTICE_AR_FSET ansi?"%@%K-%Y$1%K:%Y$3%K-%n $4-":"%@-$1:$3- $4-"

#define DEFAULT_FORMAT_PUBLIC_OTHER_FSET ansi?"%@%b<%n$1%K:%n$2%b>%n $3-":"%@<$1:$2> $3-"
#define DEFAULT_FORMAT_PUBLIC_OTHER_AR_FSET ansi?"%@%b<%Y$1%K:%n$2%b>%n $3-":"%@<$1:$2> $3-"

#ifdef ONLY_STD_CHARS
#define DEFAULT_FORMAT_SEND_ACTION_FSET "%K* %W$1 %n$3-"
#define DEFAULT_FORMAT_SEND_ACTION_OTHER_FSET "%K* %n-> %W$1%n/%c$2 %n$3-"
#else
#define DEFAULT_FORMAT_SEND_ACTION_FSET "%Kð %W$1 %n$3-"
#define DEFAULT_FORMAT_SEND_ACTION_OTHER_FSET "%Kð %n-> %W$1%n/%c$2 %n$3-"
#endif

#define DEFAULT_FORMAT_SEND_AWAY_FSET "[Away ($strftime($1 %a %b %d %I:%M%p %Z))] [$tdiff2(${time() - u})] [BX-MsgLog $2]"
#define DEFAULT_FORMAT_SEND_CTCP_FSET ansi?"%K[%rctcp%K(%R$1%K)] %n$2":"[ctcp($1)] $2"
#define DEFAULT_FORMAT_SEND_RCTCP_FSET ansi?"%K[%rrctcp%K(%R$1%K)] %n$2-":"^B[rctcp(^B$1^B)]^B $2-"
#define DEFAULT_FORMAT_SEND_DCC_CHAT_FSET ansi?"%K[%rdcc%K(%R$1%K)] %n$2-":"[dcc($1)] $2-"
#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K-%Y$1%K(%p$2%K)-%n $2-"
#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%Y$1%K(%p$2%K)]%n $2-"

#define DEFAULT_FORMAT_SEND_MSG_FSET ansi?"%K[%rmsg%K(%R$1%K)] %n$3-":"[msg($1)] $3-"
#define DEFAULT_FORMAT_SEND_NOTICE_FSET ansi?"%K[%rnotice%K(%R$1%K)] %n$3-":"[notice($1)] $3-"
#define DEFAULT_FORMAT_SEND_PUBLIC_FSET ansi?"%P<%n$2%P>%n $3-":"<$2> $3-"
#define DEFAULT_FORMAT_SEND_PUBLIC_OTHER_FSET ansi?"%p<%n$2%K:%n$1%p>%n $3-":"<$2:$1> $3-"


#define DEFAULT_FORMAT_SERVER_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG1_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG1_FROM_FSET "$G%n $1: $2-"
#define DEFAULT_FORMAT_SERVER_MSG2_FSET "$G%n $1-"
#define DEFAULT_FORMAT_SERVER_MSG2_FROM_FSET "$G%n $1-"

#define DEFAULT_FORMAT_SERVER_NOTICE_FSET " $2-"
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT_FSET " Possible bot: %C$1 %K[%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT1_FSET " Possible $1 bot: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_BOT_ALARM_FSET " $1 alarm activated: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_CONNECT_FSET " Client Connecting: %C$1 %K[%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_EXIT_FSET " Client Exiting: %C$1 %K[%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_INVALID_FSET " Invalid username: %C$1 %K[%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_CLIENT_TERM_FSET " Terminating client for excess flood %C$1%K [%c$2-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_FAKE_FSET " Fake Mode detected on $1 -> $2-"
#define DEFAULT_FORMAT_SERVER_NOTICE_KILL_FSET " Foreign OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_KILL_LOCAL_FSET " Local OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET " %W$1%n added a new K-Line %K[%c$2%K]%n for $3-"
#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET " %W$1%n added a new K-Line %K[%c$2%K]%n from $3 for $4-"
#define DEFAULT_FORMAT_SERVER_NOTICE_NICK_COLLISION_FSET " Nick collision %W$1%n killed %c$2%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_OPER_FSET " %C$1 %K[%c$2%K]%n is now %Wa%w %GIRC%n whore"
#define DEFAULT_FORMAT_SERVER_NOTICE_REHASH_FSET " %W$1%n is rehashing the Server config file"
#define DEFAULT_FORMAT_SERVER_NOTICE_STATS_FSET " Stats $1: %C$2 %K[%c$3-%K]%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_TRAFFIC_HIGH_FSET " Entering high-traffic mode %K(%n$1 > $2-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_TRAFFIC_NORM_FSET " Resuming standard operation %K(%n$1 $2 $3-%K)%n"
#define DEFAULT_FORMAT_SERVER_NOTICE_UNAUTH_FSET " Unauthorized Connection from $1-"

#define DEFAULT_FORMAT_SET_FSET "%g$[-30.]0 %w$1-"
#define DEFAULT_FORMAT_CSET_FSET "%r$[-14]1 %R$[-20.]0   %w$2-"
#define DEFAULT_FORMAT_SET_NOVALUE_FSET "%g$[-30.]0 has no value"
#define DEFAULT_FORMAT_SHITLIST_FSET " $[3]0 $[34]1 $[10]2  $3-"
#define DEFAULT_FORMAT_SHITLIST_FOOTER_FSET "There are $1 users on the shitlist"
#define DEFAULT_FORMAT_SHITLIST_HEADER_FSET " lvl nick!user at host                     channels   reason"
#define DEFAULT_FORMAT_SIGNOFF_FSET "$G %nSignOff: %W$1 %K(%n$3-%K)"


#define DEFAULT_FORMAT_SILENCE_FSET "$G %RWe are $1 silencing $2 at $0"

#define DEFAULT_FORMAT_TRACE_OPER_FSET "%R$1%n %K[%n$3%K]"
#define DEFAULT_FORMAT_TRACE_SERVER_FSET "%R$1%n $2 $3 $4 %K[%n$5%K]%n $6-"
#define DEFAULT_FORMAT_TRACE_USER_FSET "%R$1%n %K[%n$3%K]"

#define DEFAULT_FORMAT_TIMER_FSET "$G $[-5]0 $[-10]1 $[-6]2 $3-"

#define DEFAULT_FORMAT_TOPIC_FSET "$G Topic %K(%c$1%K):%n $2-"
#define DEFAULT_FORMAT_TOPIC_CHANGE_FSET "$G Topic %K(%c$2%K):%n changed by %c$1%K:%n $3-"
#define DEFAULT_FORMAT_TOPIC_SETBY_FSET "$G Topic %K(%c$1%K):%n set by %c$2%n at %c$stime($3)%n"
#define DEFAULT_FORMAT_TOPIC_UNSET_FSET "$G Topic %K(%c$2%K):%n unset by %c$1%n"
	
#define DEFAULT_FORMAT_USAGE_FSET "$G Usage: /$0  $1-"
#define DEFAULT_FORMAT_USERMODE_FSET "$G %nMode change %K[%W$4-%K]%n for user %c$3"

#define DEFAULT_FORMAT_USERLIST_FSET "$[16]0 $[10]1 $[-10]2   $[-25]3 $[10]4"

#define DEFAULT_FORMAT_USERLIST_FOOTER_FSET "There are $1 users on the userlist"
#define DEFAULT_FORMAT_USERLIST_HEADER_FSET "level            nick       password     host                      channels"

#define DEFAULT_FORMAT_USERS_FSET "%K[%n%C$5%B$[9]2%K]%K[%n$[41]3%K]%K[%n$0%K]%n$4"
#define DEFAULT_FORMAT_USERS_USER_FSET "%K[%n%C$5%B$[9]2%K]%K[%n%B$[41]3%K]%K[%n$0%K]%n$4"
#define DEFAULT_FORMAT_USERS_SHIT_FSET "%K[%n%C$5%B$[9]2%K]%K[%n%r$[41]3%K]%K[%n$[-15]0%K]%n$4"
#define DEFAULT_FORMAT_USERS_TITLE_FSET "$G Channel userlist for %W$1%n at ($0):"
#define DEFAULT_FORMAT_USERS_HEADER_FSET NULL /*"%K[ %WC%nhannel  %K][ %WN%wickname %K][%n %Wu%wser at host                       %K][%n %Wl%wevel         %K]"*/

#define DEFAULT_FORMAT_VERSION_FSET "\002$0+$4$5\002 by panasync \002-\002 $2 $3"


#define DEFAULT_FORMAT_WALL_FSET "%@%G!%g$1:$2%G!%n $3-"
#define DEFAULT_FORMAT_WALL_AR_FSET "%@%G!%Y$1:$2%G!%n $3-"


#define DEFAULT_FORMAT_WALLOP_FSET "%G!%g$1$2%G!%n $3-"
#define DEFAULT_FORMAT_WHO_FSET "%Y$[10]0 %W$[10]1%w %c$[3]2 %w$3%R@%w$4 ($6-)"

#ifdef ONLY_STD_CHARS
#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway     : $0 - $1-":"| away     : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not      : A:$0 P:$1 [$2] $3-":"| bot      : A:$0 P:$1 [$2] $3-"
#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET ansi?"%g| %Wc%nhannels : $0-":"| channels : $0-"
#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET ansi?"%g| %Wf%nriend   : F:$0 $1-":"| friend   : F:$0 $1-"
#define DEFAULT_FORMAT_WHOIS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ --  -":".----------------------------------------- --  -"
#define DEFAULT_FORMAT_WHOIS_IDLE_FSET ansi?"%K: %Wi%ndle     : $0 hours $1 mins $2 secs (signon: $stime($3))":": idle     : $0 hours $1 mins $2 secs (signon: $stime($3))"
#define DEFAULT_FORMAT_WHOIS_SHIT_FSET ansi?"%g| %Ws%nhit     : L:$0 [$1] $2 $3-":"| shit     : L:$0 [$1] $2 $3-"
#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET ansi?"%K| %Ws%nignon   : $0-":"| signon   : $0-"
#define DEFAULT_FORMAT_WHOIS_ACTUALLY_FSET ansi?"%K: %Wa%nctually : $0-":": actually : $0-"
#define DEFAULT_FORMAT_WHOIS_NAME_FSET ansi?"%G: %Wi%nrcname  : $0-":": ircname  : $0-"
#define DEFAULT_FORMAT_WHOIS_NICK_FSET ansi?"%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)":"| $0 ($1@$2) ($3-)"
#define DEFAULT_FORMAT_WHOIS_OPER_FSET ansi?"%K| %Wo%nperator : $0 $1-":"| operator : $0 $1-"
#define DEFAULT_FORMAT_WHOIS_SERVER_FSET ansi?"%K| %Ws%nerver   : $0 ($1-)":"| server   : $0 ($1-)"
#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET ansi?"%G.----- %WWho %G-----%g---%G---%g--%G-----%g--%G-- %WChannel%g--- %wServer %G-%g----%G--%g--%G----%g %wSeconds":".----- Who ---------------------- Channel--- Server ------------- Seconds"
#define DEFAULT_FORMAT_WHOLEFT_USER_FSET ansi?"%G|%n $[-10]0!$[20]1 $[10]2 $[20]4 $3":"| $[-10]0!$[20]1 $[10]2 $[20]4 $3"
#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ --  -":".----------------------------------------- --  -"
#define DEFAULT_FORMAT_WHOWAS_NICK_FSET ansi?"%G| %W$0%n was %K(%n$1@$2%K)":"| $0 was ($1@$2)"
#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET ansi?"%K| %Wa%ndmin    : $0 - $1-":"| admin    : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET ansi?"%K| %Ws%nervice  : $0 - $1-":"| service  : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_HELP_FSET ansi?"%K| %Wh%nelp     : $0 - $1-":"| help     : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET ansi?"%K| %Wr%negister : $0 - $1-":"| register : $0 - $1-"
#else
#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway     : $0 - $1-":"| away     : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not      : A:$0 P:$1 [$2] $3-":"| bot      : A:$0 P:$1 [$2] $3-"
#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET ansi?"%g| %Wc%nhannels : $0-":"| channels : $0-"
#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET ansi?"%g| %Wf%nriend   : F:$0 $1-":"| friend   : F:$0 $1-"
#define DEFAULT_FORMAT_WHOIS_HEADER_FSET ansi?"%GÚÄÄÄÄÄ---%gÄ%G--%gÄÄ%G-%gÄÄÄÄÄÄ---%KÄ%g--%KÄÄ%g-%KÄÄÄÄÄÄÄÄÄ--- --  -":"ÚÄÄÄÄÄ---Ä--ÄÄ-ÄÄÄÄÄÄ---Ä--ÄÄ-ÄÄÄÄÄÄÄÄÄ--- --  -"
#define DEFAULT_FORMAT_WHOIS_IDLE_FSET ansi?"%K: %Wi%ndle     : $0 hours $1 mins $2 secs (signon: $stime($3))":": idle     : $0 hours $1 mins $2 secs (signon: $stime($3))"
#define DEFAULT_FORMAT_WHOIS_SHIT_FSET ansi?"%g| %Ws%nhit     : L:$0 [$1] $2 $3-":"| shit     : L:$0 [$1] $2 $3-"
#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET ansi?"%K %Ws%nignon   : $0-":" signon   : $0-"
#define DEFAULT_FORMAT_WHOIS_ACTUALLY_FSET ansi?"%K| %Wa%nctually : $0-":"| actually : $0-"
#define DEFAULT_FORMAT_WHOIS_NAME_FSET ansi?"%G³ %Wi%nrcname  : $0-":"³ ircname  : $0-"
#define DEFAULT_FORMAT_WHOIS_NICK_FSET ansi?"%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)":"| $0 ($1@$2) ($3-)"
#define DEFAULT_FORMAT_WHOIS_OPER_FSET ansi?"%K| %Wo%nperator : $0 $1-":"| operator : $0 $1-"
#define DEFAULT_FORMAT_WHOIS_SERVER_FSET ansi?"%K³ %Ws%nerver   : $0 ($1-)":"³ server   : $0 ($1-)"
#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET ansi?"%GÚÄÄÄÄÄ %WWho %GÄÄÄÄÄ%g---%GÄÄÄ%g--%GÄÄÄÄÄ%gÄ-%GÄÄ %WChannel%gÄÄÄ %wServer %G-%gÄÄ--%GÄÄ%g--%GÄÄÄÄ%g %wSeconds":"ÚÄÄÄÄÄ Who ÄÄÄÄÄ---ÄÄÄ--ÄÄÄÄÄÄ-ÄÄ ChannelÄÄÄ Server -ÄÄ--ÄÄ--ÄÄÄÄ Seconds"
#define DEFAULT_FORMAT_WHOLEFT_USER_FSET ansi?"%G|%n $[-10]0!$[20]1 $[10]2 $[20]4 $3":"| $[-10]0!$[20]1 $[10]2 $[20]4 $3"
#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET ansi?"%GÚÄÄÄÄÄ---%gÄ%G--%gÄÄ%G-%gÄÄÄÄÄÄ---%KÄ%g--%KÄÄ%g-%KÄÄÄÄÄÄÄÄÄ--- --  -":"ÚÄÄÄÄÄ---Ä--ÄÄ-ÄÄÄÄÄÄ---Ä--ÄÄ-ÄÄÄÄÄÄÄÄÄ--- --  -"
#define DEFAULT_FORMAT_WHOWAS_NICK_FSET ansi?"%G| %W$0%n was %K(%n$1@$2%K)":"| $0 was ($1@$2)"
#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET ansi?"%K| %Wa%ndmin    : $0 - $1-":"| admin    : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET ansi?"%K| %Ws%nervice  : $0 - $1-":"| service  : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_HELP_FSET ansi?"%K| %Wh%nelp     : $0 - $1-":"| help     : $0 - $1-"
#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET ansi?"%K| %Wr%negister : $0 - $1-":"| register : $0 - $1-"
#endif

#define DEFAULT_FORMAT_WIDELIST_FSET "$1-"
#define DEFAULT_FORMAT_WINDOW_SET_FSET "$0-"
	
#define DEFAULT_FORMAT_NICK_MSG_FSET "$0 $1 $2-"

#define DEFAULT_FORMAT_NICK_COMP_FSET "$0\002:\002$1-"
#define DEFAULT_FORMAT_NICK_AUTO_FSET "$0\002:\002$1-"

#define DEFAULT_FORMAT_STATUS_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS1_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS2_FSET "%4%W$0-"
#define DEFAULT_FORMAT_STATUS3_FSET "%4%W$0-"
#define DEFAULT_FORMAT_NOTIFY_OFF_FSET "$[10]0 $[35]1 $[-6]2 $[-10]3 $4 $5"
#define DEFAULT_FORMAT_NOTIFY_ON_FSET "$[10]0 $[35]1 $[-6]2 $[-10]3 $4-"

#define DEFAULT_FORMAT_OV_FSET "%S %>[OperView] "
#define DEFAULT_FORMAT_DEBUG_FSET "DEBUG"

#define DEFAULT_FORMAT_WHOIS_FOOTER_FSET NULL
#define DEFAULT_FORMAT_XTERM_TITLE_FSET NULL
#define DEFAULT_FORMAT_DCC_FSET NULL
#define DEFAULT_FORMAT_NAMES_FOOTER_FSET NULL
#define DEFAULT_FORMAT_NETSPLIT_HEADER_FSET NULL
#define DEFAULT_FORMAT_TOPIC_CHANGE_HEADER_FSET NULL
#define DEFAULT_FORMAT_WHOLEFT_FOOTER_FSET NULL

#define DEFAULT_STATUS_FORMAT " [%T][%*%@%=%N%#%A]%M [%C%+%W] %Q %H%B%F "
#define DEFAULT_STATUS_FORMAT1 " [%T][%*%@%=%N%#%A]%M [%C%+%W] %Q %H%B%F "
#define DEFAULT_STATUS_FORMAT2 " %L %! %K %>%D %J[%u:%a:%f:%b:%h]"
#define DEFAULT_STATUS_FORMAT3 "BitchX by panasync "

#define DEFAULT_STATUS_AWAY " (zZzZ %A)"
#define DEFAULT_STATUS_CHANNEL "%C"
#define DEFAULT_STATUS_CHANOP "@"
#define DEFAULT_STATUS_HALFOP "%"
#define DEFAULT_STATUS_CLOCK "%T"
#define DEFAULT_STATUS_HOLD " -- more --"
#define DEFAULT_STATUS_HOLD_LINES " (%B)"
#define DEFAULT_STATUS_INSERT ""
#define DEFAULT_STATUS_LAG "[Lag %L]"
#define DEFAULT_STATUS_MODE "(+%+)"
#define DEFAULT_STATUS_MAIL "[Mail: %M]"
#define DEFAULT_STATUS_MSGCOUNT " Aw[%^]"
#define DEFAULT_STATUS_NICK "%N"
#define DEFAULT_STATUS_NOTIFY " [Act: %F]"
#define DEFAULT_STATUS_OPER "*"
#define DEFAULT_STATUS_VOICE "+"
#define DEFAULT_STATUS_OVERWRITE "(overtype) "
#define DEFAULT_STATUS_QUERY " [Query: %Q]"
#define DEFAULT_STATUS_SERVER " via %S"
#define DEFAULT_STATUS_TOPIC "%-"
#define DEFAULT_STATUS_UMODE "(+%#)"
#define DEFAULT_STATUS_USER " * type /help for help "

#define DEFAULT_STATUS_DCCCOUNT  "[DCC  gets/%& sends/%&]"
#define DEFAULT_STATUS_CDCCCOUNT "[CDCC gets/%| offer/%|]"

#define DEFAULT_STATUS_OPER_KILLS "[nk/%K ok/%K]"
#define DEFAULT_STATUS_USERS "[O/%! N/%! I/%! V/%! F/%!]"
#define DEFAULT_STATUS_CPU_SAVER " (%J)"

#define DEFAULT_STATUS_USER1 ""
#define DEFAULT_STATUS_USER2 ""
#define DEFAULT_STATUS_USER3 ""
#define DEFAULT_STATUS_USER4 ""
#define DEFAULT_STATUS_USER5 ""
#define DEFAULT_STATUS_USER6 ""
#define DEFAULT_STATUS_USER7 ""
#define DEFAULT_STATUS_USER8 ""
#define DEFAULT_STATUS_USER9 ""
#define DEFAULT_STATUS_USER10 ""
#define DEFAULT_STATUS_USER11 ""
#define DEFAULT_STATUS_USER12 ""
#define DEFAULT_STATUS_USER13 ""
#define DEFAULT_STATUS_USER14 ""
#define DEFAULT_STATUS_USER15 ""
#define DEFAULT_STATUS_USER16 ""
#define DEFAULT_STATUS_USER17 ""
#define DEFAULT_STATUS_USER18 ""
#define DEFAULT_STATUS_USER19 ""
#define DEFAULT_STATUS_USER20 ""
#define DEFAULT_STATUS_USER21 ""
#define DEFAULT_STATUS_USER22 ""
#define DEFAULT_STATUS_USER23 ""
#define DEFAULT_STATUS_USER24 ""
#define DEFAULT_STATUS_USER25 ""
#define DEFAULT_STATUS_USER26 ""
#define DEFAULT_STATUS_USER27 ""
#define DEFAULT_STATUS_USER28 ""
#define DEFAULT_STATUS_USER29 ""
#define DEFAULT_STATUS_USER30 ""
#define DEFAULT_STATUS_USER31 ""
#define DEFAULT_STATUS_USER32 ""
#define DEFAULT_STATUS_USER33 ""
#define DEFAULT_STATUS_USER34 ""
#define DEFAULT_STATUS_USER35 ""
#define DEFAULT_STATUS_USER36 ""
#define DEFAULT_STATUS_USER37 ""
#define DEFAULT_STATUS_USER38 ""
#define DEFAULT_STATUS_USER39 ""
#define DEFAULT_STATUS_WINDOW "^^^^^^^^"
#define DEFAULT_STATUS_FLAG ""
#define DEFAULT_STATUS_SCROLLBACK " (Scroll)"

#define DEFAULT_FORMAT_LASTLOG_FSET "$strftime($0 %H:%M) $1-"

#define DEFAULT_INPUT_PROMPT "[$C] "

#ifndef ONLY_STD_CHARS
#define DEFAULT_SHOW_NUMERICS_STR "ùíù"
#else
#ifndef LATIN1
#define DEFAULT_SHOW_NUMERICS_STR "***"
#else
#define DEFAULT_SHOW_NUMERICS_STR "-:-"
#endif
#endif

#define DEFAULT_SERVER_PROMPT "[$0]"

#define DEFAULT_FORMAT_WATCH_SIGNOFF_FSET "$G $0!$1@$2 has signed off"
#define DEFAULT_FORMAT_WATCH_SIGNON_FSET "$G $0!$1@$2 has signed on $3"

#endif

#endif

--- NEW FILE: PMbitchx.h ---

/* PM specific stuff */
#ifndef PM_BitchX_h
#define PM_BitchX_h

#define FONTDIALOG      256

#define LB_FONTLIST     101
#define CB_DEFAULT      102
#define CB_CHANGEFORALL 103 

#define IDM_LOGO        355
#define IDM_MAINMENU    356

/* Properties book */
#define PROPNBK         357
#define ID_PROP         359
#define PB_DISMISS      360
#define NBKP_SETS1      362
#define SPB_SETS        363
#define SETS1           364
#define EF_ENTRY1       365
#define CB_ONOFF1       366
#define NBKP_OSSETTINGS 367
#define NBKP_SETS2      368
#define SETS2           369
#define EF_ENTRY2       370
#define CB_ONOFF2       371
#define NBKP_SETS3      372
#define SETS3           373
#define EF_ENTRY3       374
#define CB_ONOFF3       375
#define NBKP_SETS4      376
#define SETS4           377
#define EF_ENTRY4       378
#define CB_ONOFF4       379
#define CB_LFN          380
#define CB_SOUND        381

void pm_resize(Screen *this_screen);
void pm_clrscr(Screen *tmp);
void load_default_font(Screen *font_screen);

void pm_new_window(Screen *new, Window *win);
void pm_seticon(Screen *screen);
void wm_process(int param);

MRESULT EXPENTRY GenericWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
MRESULT EXPENTRY FrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);

MenuStruct *findmenu(char *menuname);

#define QWP_USER 0

/* Not sure how to decide this */
#define MMPM 1

#endif

--- NEW FILE: window.h ---
/*
 * window.h: header file for window.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: window.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __window_h_
#define __window_h_

#include "irc_std.h"
#include "lastlog.h"

/* used by the update flag to determine what needs updating */
#define REDRAW_DISPLAY_FULL	1
#define REDRAW_DISPLAY_FAST	2
#define UPDATE_STATUS		4
#define REDRAW_STATUS		8

#define	LT_UNLOGGED		0
#define	LT_LOGHEAD		1
#define	LT_LOGTAIL		2

/* var_settings indexes */
#define OFF			0
#define ON			1
#define TOGGLE			2

#define WINDOW_NO_SERVER	-1
#define WINDOW_DLL		-2
#define WINDOW_SERVER_CLOSED	-3

	Window	*BX_new_window			(struct ScreenStru *);
	void	BX_delete_window			(Window *);
	void	BX_add_to_invisible_list		(Window *);
	Window	*BX_add_to_window_list		(struct ScreenStru *, Window *);
	void	BX_remove_from_window_from_screen	(Window *);
	void	BX_recalculate_window_positions	(struct ScreenStru *);
	void	BX_redraw_all_windows		(void);
	void	BX_recalculate_windows		(struct ScreenStru *);
	void	BX_rebalance_windows		(struct ScreenStru *);
	void	BX_update_all_windows		(void);
	void	BX_set_current_window		(Window *);
	void	BX_hide_window			(Window *);
	void	BX_swap_last_window		(char, char *);
	void	BX_next_window			(char, char *);
	void	BX_swap_next_window		(char, char *);
	void	BX_previous_window			(char, char *);
	void	BX_swap_previous_window		(char, char *);
	void	BX_back_window			(char, char *);
	Window	*BX_get_window_by_refnum		(unsigned);
	Window	*BX_get_window_by_name		(const char *);
	char	*BX_get_refnum_by_window		(const Window *);
	int	is_window_visible		(char *);
	void	BX_update_window_status		(Window *, int);
	void	BX_update_all_status		(Window *, char *, int);
	void	BX_set_prompt_by_refnum		(unsigned, char *);
	char	*BX_get_prompt_by_refnum		(unsigned);
	char	*BX_get_target_by_refnum		(unsigned);
const	char	*BX_query_nick			(void);
	void	BX_set_query_nick			(char *, char *, char *);
	int	BX_is_current_channel		(char *, int, int);
const	char	*BX_set_current_channel_by_refnum	(unsigned, char *);
	char	*BX_get_current_channel_by_refnum	(unsigned);
	int	BX_is_bound_to_window		(const Window *, const char *);
	Window	*BX_get_window_bound_channel	(const char *);
	int	BX_is_bound_anywhere		(const char *);
	int	BX_is_bound			(const char *, int);
	void	BX_unbind_channel 			(const char *, int);
	char	*BX_get_bound_channel		(Window *);
	int	BX_get_window_server		(unsigned);
	void	BX_set_window_server		(int, int, int);
	int	windows_connected_to_server	(int);
	void	window_close_server		(int);
	void	BX_set_level_by_refnum		(unsigned, unsigned long);
	void	BX_message_to			(unsigned long);

#if 0
	void	save_message_from		(char **, unsigned long *);
	void	restore_message_from		(char *, unsigned long);
	void	message_from			(char *, unsigned long);
	int	message_from_level		(unsigned long);
#endif
	void	BX_set_display_target		(const char *, unsigned long);
	void	set_display_target_by_winref	(unsigned int);
	void	BX_set_display_target_by_desc	(char *);
	void	BX_reset_display_target		(void);
	void	BX_save_display_target		(const char **, unsigned long *);
	void	BX_restore_display_target		(const char *, unsigned long);

	void	BX_clear_all_windows		(int, int);
	void	BX_clear_window_by_refnum		(unsigned);
	void	set_scroll			(Window *, char *, int);
	void	BX_set_scroll_lines		(Window *, char *, int);
	void	BX_set_continued_lines		(Window *, char *, int);
	unsigned BX_current_refnum			(void);
	int	BX_number_of_windows_on_screen	(Window *);
	void	delete_display_line		(Display *);
	Display	*new_display_line		(Display *);
	void	BX_scrollback_backwards_lines	(int);
	void	BX_scrollback_forwards_lines	(int);
	void	BX_scrollback_backwards		(char, char *);
	void	BX_scrollback_forwards		(char, char *);
	void	BX_scrollback_end			(char, char *);
	void	BX_scrollback_start		(char, char *);
	void	BX_hold_mode			(Window *, int, int);
	void	BX_unstop_all_windows		(char, char *);
	void	BX_reset_line_cnt			(Window *, char *, int);
	void	BX_toggle_stop_screen		(char, char *);
	void	BX_flush_everything_being_held	(Window *);
	int	BX_unhold_a_window			(Window *);
	char	*BX_get_target_cmd_by_refnum	(u_int);
	void	BX_recalculate_window_cursor	(Window *);
	int	BX_is_window_name_unique		(char *);
	int	BX_get_visible_by_refnum		(char *);
	void	BX_resize_window			(int, Window *, int);
	Window	*window_list			(Window *, char **, char *);
	void	BX_move_window			(Window *, int);
	void	BX_show_window			(Window *);
	int	BX_traverse_all_windows		(Window **);
	Window	*BX_get_window_by_desc		(const char *);
	char	*BX_get_nicklist_by_window		(Window *); /* XXX */
	void	BX_set_scrollback_size		(Window *, char *, int);
	void	BX_make_window_current		(Window *);
	Window	*window_query			(Window *, char **, char *);
	int	BX_unhold_windows			(void);
	void	free_window			(Window *);
	Window	*BX_get_window_target_by_desc	(char *);
	BUILT_IN_COMMAND(windowcmd);

	char	*BX_get_status_by_refnum		(unsigned , unsigned);
	void	BX_unclear_window_by_refnum	(unsigned);
	void	BX_set_screens_current_window	(Screen *, Window *);
	void	BX_clear_scrollback		(Window *);
	void 	BX_clear_window			(Window *window);
	void	BX_repaint_window			(Window *, int, int);
	void	BX_remove_window_from_screen	(Window *);
	void	BX_set_screens_current_window	(Screen *, Window *);
	void	BX_make_window_current		(Window *);
	void	BX_make_window_current_by_refnum	(int);
	void	BX_free_formats			(Window *);
	void	BX_goto_window			(Screen *, int);
	void	BX_update_window_status_all	(void);
const	char	*BX_query_host			(void);
const	char	*BX_query_cmd			(void);
	void	BX_window_check_servers		(int);
	int	windows_connected_to_server	(int);
	void	window_change_server		(int, int);
	void	make_window_current_by_winref	(int);
	void	make_window_current_by_desc	(char *);
	int	get_winref_by_desc		(const char *);
	int	get_current_winref		(void);
	void	make_to_window_by_desc		(char *);
	Window	*is_querying			(char *);
	void	open_window			(char *);
	void	close_window			(char *);
	void	win_create(int, int);
	void	BX_change_window_server		(int, int);	
unsigned long	message_from_level		(unsigned long);
						
extern	Window	*invisible_list;
extern	unsigned long	who_level;
extern	int	in_window_command;
extern	unsigned int	window_display;
extern	Window	*target_window;
extern	Window	*current_window;
extern	void	*default_output_function;
extern	int	status_update_flag;

#define BUILT_IN_WINDOW(x) Window *x (Window *window, char **args, char *usage) 

BUILT_IN_WINDOW(window_server);

#define WINDOW_NOTIFY	((unsigned) 0x0001)
#define WINDOW_NOTIFIED	((unsigned) 0x0002)

#endif /* __window_h_ */

--- NEW FILE: hold.h ---
/*
 * hold.h: header for hold.c
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: hold.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __hold_h_
#define __hold_h_

	void	remove_from_hold_list (Window *);
	void	add_to_hold_list (Window *, char *, int);
	void	hold_mode (Window *, int, int);
	int	hold_output (Window *);
	char	*hold_queue (Window *);
	void	reset_hold (Window *);
	int	hold_queue_logged (Window *);
	void	toggle_stop_screen (char, char *);

#endif /* __hold_h_ */

--- NEW FILE: log.h ---
/*
 * log.h: header for log.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: log.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __log_h_
#define __log_h_

	void	do_log (int, char *, FILE **);
	void	logger (Window *, char *, int);
	void	set_log_file (Window *, char *, int);
	void	BX_add_to_log (FILE *, time_t, const char *, int mangler);


#endif /* __log_h_ */

--- NEW FILE: irc.h ---
/*
 * irc.h: header file for all of ircII! 
 *
 * Written By Michael Sandrof
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: irc.h,v 1.1.1.1 2003/04/11 01:09:07 dan Exp $
 */

#ifndef __irc_h
#define __irc_h
#define IRCII_COMMENT   "\002 Keep it to yourself!\002"

#define FSET 1

#ifndef __irc_c
extern const char irc_version[];
extern const char internal_version[];
#endif
extern char	*thing_ansi;
extern char	thing_star[4];

/*
 * Here you can set the in-line quote character, normally backslash, to
 * whatever you want.  Note that we use two backslashes since a backslash is
 * also C's quote character.  You do not need two of any other character.
 */
#define QUOTE_CHAR '\\'

#include "defs.h"
#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>

#include <signal.h>
#include <sys/param.h>

#ifdef __EMX__
# ifdef __EMXPM__
#   define AVIO_BUFFER 2048
#   define INCL_GPI
#   define INCL_AVIO
#   define INCL_DOS
# endif
#define INCL_WIN       /* Window Manager Functions */
#define INCL_BASE
#define INCL_VIO
#include <os2.h>
#elif defined(WINNT)
#  include <windows.h>
#  ifdef SOUND
#    include <mmsystem.h>
#  endif
#elif defined(GTK)
#  include <gtk/gtk.h>
#  include <gtk/gtkmenu.h>
#endif

#include <sys/socket.h>
#include <netinet/in.h>

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif /* HAVE_SYS_TIME_H */
#endif /* TIME_WITH_SYS_TIME */

#ifdef HAVE_SYS_FCNTL_H
# include <sys/fcntl.h>
#else
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h> 
  #endif /* HAVE_FCNTL_H */
#endif

#include <stdarg.h>
#include <unistd.h>
#ifdef __EMX__
#include <sys/select.h>
#endif

#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#include "bsdglob.h"

#include "irc_std.h"
#include "debug.h"
#include "newio.h"

/* these define what characters do, inverse, underline, bold and all off */
#define REV_TOG		'\026'		/* ^V */
#define REV_TOG_STR	"\026"
#define UND_TOG		'\037'		/* ^_ */
#define UND_TOG_STR	"\037"
#define BOLD_TOG	'\002'		/* ^B */
#define BOLD_TOG_STR	"\002"
#define ALL_OFF		'\017'		/* ^O */
#define ALL_OFF_STR	"\017"
#define BLINK_TOG	'\006'		/* ^F (think flash) */
#define BLINK_TOG_STR	"\006"
#define ROM_CHAR        '\022'          /* ^R */
#define ROM_CHAR_STR    "\022"
#define ALT_TOG		'\005'		/* ^E (think Extended) */
#define ALT_TOG_STR	"\005"
#define ND_SPACE	'\023'		/* ^S */
#define ND_SPACE_STR	"\023"

#define IRCD_BUFFER_SIZE	512
#define BIG_BUFFER_SIZE		(4 * IRCD_BUFFER_SIZE)
#define MAX_PROTOCOL_SIZE	(IRCD_BUFFER_SIZE - 2)

#ifndef INPUT_BUFFER_SIZE
#define INPUT_BUFFER_SIZE	(IRCD_BUFFER_SIZE - 20)
#endif


#define REFNUM_MAX 10

#ifndef RAND_MAX
#define RAND_MAX 2147483647
#endif

#define NICKNAME_LEN 30
#define NAME_LEN 80
#define REALNAME_LEN 50
#define PATH_LEN 1024

#ifndef MIN
#define MIN(a,b) ((a < b) ? (a) : (b))
#endif

#ifndef MAX
#define MAX(a,b) ((a > b) ? (a) : (b))
#endif

/* This section is for keeping track internally
 * the CVS revision info of the running client.
 * Since so many people are using CVS versions
 * for debugging purposes it's good to know what
 * file revisions they are running.
 */
#define CVS_REVISION(id) \
void id (char *buf)                 \
{                       \
    strcpy(buf, cvsrevision);       \
}

void alias_c(char *);
void alist_c(char *);
void array_c(char *);
void banlist_c(char *);
void botlink_c(char *);
void cdcc_c(char *);
void chelp_c(char *);
void commands_c(char *);
void commands2_c(char *);
void cset_c(char *);
void ctcp_c(char *);
void dcc_c(char *);
void debug_c(char *);
void encrypt_c(char *);
void exec_c(char *);
void files_c(char *);
void flood_c(char *);
void fset_c(char *);
void functions_c(char *);
void funny_c(char *);
void hash_c(char *);
void help_c(char *);
void history_c(char *);
void hook_c(char *);
void if_c(char *);
void ignore_c(char *);
void input_c(char *);
void irc_c(char *);
void ircaux_c(char *);
void keys_c(char *);
void lastlog_c(char *);
void list_c(char *);
void log_c(char *);
void mail_c(char *);
void misc_c(char *);
void modules_c(char *);
void names_c(char *);
void network_c(char *);
void newio_c(char *);
void notice_c(char *);
void notify_c(char *);
void numbers_c(char *);
void output_c(char *);
void parse_c(char *);
void queue_c(char *);
void readlog_c(char *);
void reg_c(char *);
void screen_c(char *);
void server_c(char *);
void stack_c(char *);
void status_c(char *);
void struct_c(char *);
void tcl_public_c(char *);
void term_c(char *);
void timer_c(char *);
void translat_c(char *);
void user_c(char *);
void userlist_c(char *);
void vars_c(char *);
void who_c(char *);
void whowas_c(char *);
void window_c(char *);
void words_c(char *);

/*
 * declared in irc.c 
 */
extern	int	current_numeric;
extern	char	*cut_buffer;
extern	char	oper_command;
extern	int	irc_port;
extern	int	current_on_hook;
extern	int	use_flow_control;
extern	char	*joined_nick;
extern	char	*public_nick;
extern	char	empty_string[];
extern	char	zero[];
extern	char	one[];
extern	char	on[];
extern	char	off[];
extern	char	space[];
extern	char	space_plus[];
extern	char	space_minus[];
extern	char	dot[];
extern	char	star[];
extern	char	comma[];
extern	char	nickname[];
extern	char	*ircrc_file;
extern	char	*bircrc_file;
extern	char	*LocalHostName;
extern	char	hostname[];
extern	char	userhost[];
extern	char	realname[];
extern	char	username[];
extern	char	*send_umode;
extern	char	*last_notify_nick;
extern	int	away_set;
extern	int	background;
extern	char	*my_path;
extern	char	*irc_path;
extern	char	*irc_lib;
extern	char	*args_str;
extern	char	*invite_channel;
extern	int	who_mask;
extern	char	*who_name;
extern	char	*who_host;
extern	char	*who_server;
extern	char	*who_file;
extern	char	*who_nick;
extern	char	*who_real;
extern	int	dumb_mode;
extern	int	use_input;
extern	time_t	idle_time;
extern	time_t	now;
extern  time_t  start_time;
extern	int	waiting_out;
extern	int	waiting_in;
extern	char	wait_nick[];
extern	char	whois_nick[];
extern	char	lame_wait_nick[];
extern	char	**environ;
extern	int	cuprent_numeric;
extern	int	quick_startup;
extern	char	version[];
extern 	fd_set	readables, writables;
extern	int	strip_ansi_in_echo;
extern	int	loading_global;
extern	const unsigned long bitchx_numver;
extern	const	char *unknown_userhost;
extern	char	*forwardnick;
extern	int	inhibit_logging;

extern	char	MyHostName[];
extern	struct	sockaddr_foobar MyHostAddr;
extern	struct	sockaddr_foobar LocalHostAddr;
extern	int	cpu_saver;
extern	struct	sockaddr_foobar	local_ip_address;


int	BX_is_channel (char *);
void	BX_irc_exit (int, char *, char *, ...);
void	BX_beep_em (int);
void	got_initial_version (char *);
void	parse_notice (char *, char **);
void	irc_quit (char, char *);
char	get_a_char (void);
void	load_scripts (void);
void	clear_whowas (void);
void	clear_variables (void);
void	clear_fset (void);
void	start_memdebug (void);

void	dump_load_stack		(int);	/* XXX command.c */
const char *  current_filename	(void);	/* XXX command.c */
int	current_line		(void);	/* XXX command.c */
	
char	*getenv (const char *);
void	get_line_return (char, char *);
void	get_line (char *, int, void (*)(char, char *));
void	BX_io (const char *);

#ifdef NEED_OSPEED
/* We need this for broken linux systems. */
extern short ospeed;
#endif

void reattach_tty(char *, char *);
int create_ipc_socket(void);
void init_socketpath(void);
void kill_attached_if_needed(int);
void setup_pid();

#ifdef CLOAKED
void initsetproctitle(int, char **, char **);
void setproctitle(const char *, ...);
#endif

#endif /* __irc_h */

--- NEW FILE: cset.h ---
/*
 * cset.h: header for cset.c
 */

#ifndef _CSET_H_
#define _CSET_H_

#include "struct.h"
/* This ensures we always have the offsetof() macro */
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif

/* the types of IrcVariables (repeated in vars.h) */
#define BOOL_TYPE_VAR 0
#define CHAR_TYPE_VAR 1
#define INT_TYPE_VAR 2
#define STR_TYPE_VAR 3

/* var_settings indexes ... also used in display.c for highlights */
#define OFF 0
#define ON 1
#define TOGGLE 2

enum CSET_TYPES
{
	AINV_CSET,
	ANNOY_KICK_CSET,
	AOP_CSET,
	AUTO_JOIN_ON_INVITE_CSET,
	AUTO_LIMIT_CSET,
	AUTO_REJOIN_CSET,
	BANTIME_CSET,
	BITCH_CSET,
	CHANMODE_CSET,
	CHANNEL_LOG_CSET,
	CHANNEL_LOG_FILE_CSET,
	CHANNEL_LOG_LEVEL_CSET,
	COMPRESS_MODES_CSET,
	CTCP_FLOOD_BAN_CSET,
	DEOPFLOOD_CSET,
	DEOPFLOOD_TIME_CSET,
	DEOP_ON_DEOPFLOOD_CSET,
	DEOP_ON_KICKFLOOD_CSET,
	HACKING_CSET,
	JOINFLOOD_CSET,
	JOINFLOOD_TIME_CSET,
	KICKFLOOD_CSET,
	KICKFLOOD_TIME_CSET,
	KICK_IF_BANNED_CSET,
	KICK_ON_DEOPFLOOD_CSET,
	KICK_ON_JOINFLOOD_CSET,
	KICK_ON_KICKFLOOD_CSET,
	KICK_ON_NICKFLOOD_CSET,
	KICK_ON_PUBFLOOD_CSET,
	KICK_OPS_CSET,
	LAMEIDENT_CSET,
	LAMELIST_CSET,
	NICKFLOOD_CSET,
	NICKFLOOD_TIME_CSET,
	PUBFLOOD_CSET,
	PUBFLOOD_IGNORE_TIME_CSET,
	PUBFLOOD_TIME_CSET,
	SHITLIST_CSET,
	USERLIST_CSET,
	NUMBER_OF_CSETS
};

enum WSET_TYPES
{
	STATUS_AWAY_WSET,
	STATUS_CDCCCOUNT_WSET,
	STATUS_CHANNEL_WSET,
	STATUS_CHANOP_WSET,
	STATUS_CLOCK_WSET,
	STATUS_CPU_SAVER_WSET,
	STATUS_DCCCOUNT_WSET,
	STATUS_FLAG_WSET,
	STATUS_FORMAT_WSET,
	STATUS_FORMAT1_WSET,
	STATUS_FORMAT2_WSET,
	STATUS_FORMAT3_WSET,
	STATUS_HALFOP_WSET,
	STATUS_HOLD_WSET,
	STATUS_HOLD_LINES_WSET,
	STATUS_LAG_WSET,
	STATUS_MAIL_WSET,
	STATUS_MODE_WSET,
	STATUS_MSGCOUNT_WSET,
	STATUS_NICKNAME_WSET,
	STATUS_NOTIFY_WSET,
	STATUS_OPER_KILLS_WSET,
	STATUS_QUERY_WSET,
	STATUS_SCROLLBACK_WSET,
	STATUS_SERVER_WSET,
	STATUS_TOPIC_WSET,
	STATUS_UMODE_WSET,
	STATUS_USER0_WSET,
	STATUS_USER1_WSET,
	STATUS_USER10_WSET,
	STATUS_USER11_WSET,
	STATUS_USER12_WSET,
	STATUS_USER13_WSET,
	STATUS_USER14_WSET,
	STATUS_USER15_WSET,
	STATUS_USER16_WSET,
	STATUS_USER17_WSET,
	STATUS_USER18_WSET,
	STATUS_USER19_WSET,
	STATUS_USER2_WSET,
	STATUS_USER20_WSET,
	STATUS_USER21_WSET,
	STATUS_USER22_WSET,
	STATUS_USER23_WSET,
	STATUS_USER24_WSET,
	STATUS_USER25_WSET,
	STATUS_USER26_WSET,
	STATUS_USER27_WSET,
	STATUS_USER28_WSET,
	STATUS_USER29_WSET,
	STATUS_USER3_WSET,
	STATUS_USER30_WSET,
	STATUS_USER31_WSET,
	STATUS_USER32_WSET,
	STATUS_USER33_WSET,
	STATUS_USER34_WSET,
	STATUS_USER35_WSET,
	STATUS_USER36_WSET,
	STATUS_USER37_WSET,
	STATUS_USER38_WSET,
	STATUS_USER39_WSET,
	STATUS_USER4_WSET,
	STATUS_USER5_WSET,
	STATUS_USER6_WSET,
	STATUS_USER7_WSET,
	STATUS_USER8_WSET,
	STATUS_USER9_WSET,
	STATUS_USERS_WSET,
	STATUS_VOICE_WSET,
	STATUS_WINDOW_WSET,
	NUMBER_OF_WSETS
};

enum FSET_TYPES
{
FORMAT_ACTION_FSET,
FORMAT_ACTION_AR_FSET,
FORMAT_ACTION_CHANNEL_FSET,
FORMAT_ACTION_OTHER_FSET,
FORMAT_ACTION_OTHER_AR_FSET,
FORMAT_ACTION_USER_FSET,
FORMAT_ACTION_USER_AR_FSET,
FORMAT_ALIAS_FSET,
FORMAT_ASSIGN_FSET,
FORMAT_AWAY_FSET,
FORMAT_BACK_FSET,

FORMAT_BANS_FSET,
FORMAT_BANS_FOOTER_FSET,
FORMAT_BANS_HEADER_FSET,
FORMAT_BITCH_FSET,
FORMAT_BOT_FSET,
FORMAT_BOT_FOOTER_FSET,
FORMAT_BOT_HEADER_FSET,
FORMAT_BWALL_FSET,

FORMAT_CHANNEL_SIGNOFF_FSET,

FORMAT_COMPLETE_FSET,
FORMAT_CONNECT_FSET,
FORMAT_CSET_FSET,
FORMAT_CTCP_FSET,
FORMAT_CTCP_CLOAK_FSET,
FORMAT_CTCP_CLOAK_FUNC_FSET,
FORMAT_CTCP_CLOAK_FUNC_USER_FSET,
FORMAT_CTCP_CLOAK_UNKNOWN_FSET,
FORMAT_CTCP_CLOAK_UNKNOWN_USER_FSET,
FORMAT_CTCP_CLOAK_USER_FSET,
FORMAT_CTCP_FUNC_FSET,
FORMAT_CTCP_FUNC_USER_FSET,
FORMAT_CTCP_REPLY_FSET,
FORMAT_CTCP_UNKNOWN_FSET,
FORMAT_CTCP_UNKNOWN_USER_FSET,
FORMAT_CTCP_USER_FSET,
FORMAT_DCC_FSET,
FORMAT_DCC_CHAT_FSET,
FORMAT_DCC_CONNECT_FSET,
FORMAT_DCC_ERROR_FSET,
FORMAT_DCC_LOST_FSET,
FORMAT_DCC_REQUEST_FSET,
FORMAT_DESYNC_FSET,
FORMAT_DISCONNECT_FSET,
FORMAT_EBANS_FSET,
FORMAT_EBANS_FOOTER_FSET,
FORMAT_EBANS_HEADER_FSET,
FORMAT_ENCRYPTED_NOTICE_FSET,
FORMAT_ENCRYPTED_PRIVMSG_FSET,
FORMAT_FLOOD_FSET,
FORMAT_FRIEND_JOIN_FSET,
FORMAT_HELP_FSET,
FORMAT_HOOK_FSET,

FORMAT_IGNORE_INVITE_FSET,
FORMAT_IGNORE_MSG_FSET,
FORMAT_IGNORE_MSG_AWAY_FSET,
FORMAT_IGNORE_NOTICE_FSET,
FORMAT_IGNORE_WALL_FSET,

FORMAT_INVITE_FSET,
FORMAT_INVITE_USER_FSET,
FORMAT_JOIN_FSET,
FORMAT_KICK_FSET,
FORMAT_KICK_USER_FSET,
FORMAT_KILL_FSET,
FORMAT_LASTLOG_FSET,
FORMAT_LEAVE_FSET,
FORMAT_LINKS_FSET,
FORMAT_LIST_FSET,
FORMAT_MAIL_FSET,
FORMAT_MODE_FSET,
FORMAT_MODE_CHANNEL_FSET,
FORMAT_MSG_FSET,
FORMAT_MSGCOUNT_FSET,
FORMAT_MSGLOG_FSET,
FORMAT_MSG_GROUP_FSET,

FORMAT_NAMES_FSET,
FORMAT_NAMES_BANNER_FSET,
FORMAT_NAMES_BOT_FSET,
FORMAT_NAMES_BOTCOLOR_FSET,
FORMAT_NAMES_FOOTER_FSET,
FORMAT_NAMES_FRIEND_FSET,
FORMAT_NAMES_FRIENDCOLOR_FSET,
FORMAT_NAMES_IRCOP_FSET,
FORMAT_NAMES_NICKCOLOR_FSET,
FORMAT_NAMES_NONOP_FSET,
FORMAT_NAMES_OP_FSET,
FORMAT_NAMES_OPCOLOR_FSET,
FORMAT_NAMES_SHIT_FSET,
FORMAT_NAMES_SHITCOLOR_FSET,
FORMAT_NAMES_VOICE_FSET,
FORMAT_NAMES_VOICECOLOR_FSET,

FORMAT_NETADD_FSET,
FORMAT_NETJOIN_FSET,
FORMAT_NETSPLIT_FSET,
FORMAT_NETSPLIT_HEADER_FSET,

FORMAT_NICKNAME_FSET,
FORMAT_NICKNAME_OTHER_FSET,
FORMAT_NICKNAME_USER_FSET,
FORMAT_NICK_AUTO_FSET,
FORMAT_NICK_COMP_FSET,
FORMAT_NICK_MSG_FSET,

FORMAT_NONICK_FSET,
FORMAT_NOTE_FSET,
FORMAT_NOTICE_FSET,
FORMAT_NOTIFY_OFF_FSET,
FORMAT_NOTIFY_ON_FSET,
FORMAT_NOTIFY_SIGNOFF_FSET,
FORMAT_NOTIFY_SIGNON_FSET,
FORMAT_OPER_FSET,
FORMAT_OV_FSET,
FORMAT_PASTE_FSET,
FORMAT_PUBLIC_FSET,
FORMAT_PUBLIC_AR_FSET,
FORMAT_PUBLIC_MSG_FSET,
FORMAT_PUBLIC_MSG_AR_FSET,
FORMAT_PUBLIC_NOTICE_FSET,
FORMAT_PUBLIC_NOTICE_AR_FSET,
FORMAT_PUBLIC_OTHER_FSET,
FORMAT_PUBLIC_OTHER_AR_FSET,
FORMAT_REL_FSET,
FORMAT_RELM_FSET,
FORMAT_RELN_FSET,
FORMAT_RELS_FSET,
FORMAT_RELSM_FSET,
FORMAT_RELSN_FSET,
FORMAT_SEND_ACTION_FSET,
FORMAT_SEND_ACTION_OTHER_FSET,
FORMAT_SEND_AWAY_FSET,
FORMAT_SEND_CTCP_FSET,
FORMAT_SEND_DCC_CHAT_FSET,
FORMAT_SEND_ENCRYPTED_MSG_FSET,
FORMAT_SEND_ENCRYPTED_NOTICE_FSET,
FORMAT_SEND_MSG_FSET,

FORMAT_SEND_NOTICE_FSET,
FORMAT_SEND_PUBLIC_FSET,
FORMAT_SEND_PUBLIC_OTHER_FSET,
FORMAT_SERVER_FSET,
FORMAT_SERVER_MSG1_FSET,
FORMAT_SERVER_MSG1_FROM_FSET,
FORMAT_SERVER_MSG2_FSET,
FORMAT_SERVER_MSG2_FROM_FSET,

FORMAT_SERVER_NOTICE_FSET,
FORMAT_SERVER_NOTICE_BOT_FSET,
FORMAT_SERVER_NOTICE_BOT1_FSET,
FORMAT_SERVER_NOTICE_BOT_ALARM_FSET,
FORMAT_SERVER_NOTICE_CLIENT_CONNECT_FSET,
FORMAT_SERVER_NOTICE_CLIENT_EXIT_FSET,
FORMAT_SERVER_NOTICE_CLIENT_INVALID_FSET,
FORMAT_SERVER_NOTICE_CLIENT_TERM_FSET,
FORMAT_SERVER_NOTICE_FAKE_FSET,
FORMAT_SERVER_NOTICE_GLINE_FSET,
FORMAT_SERVER_NOTICE_KILL_FSET,
FORMAT_SERVER_NOTICE_KILL_LOCAL_FSET,
FORMAT_SERVER_NOTICE_KLINE_FSET,
FORMAT_SERVER_NOTICE_NICK_COLLISION_FSET,
FORMAT_SERVER_NOTICE_OPER_FSET,
FORMAT_SERVER_NOTICE_REHASH_FSET,
FORMAT_SERVER_NOTICE_STATS_FSET,
FORMAT_SERVER_NOTICE_TRAFFIC_HIGH_FSET,
FORMAT_SERVER_NOTICE_TRAFFIC_NORM_FSET,
FORMAT_SERVER_NOTICE_UNAUTH_FSET,

FORMAT_SET_FSET,
FORMAT_SET_NOVALUE_FSET,
FORMAT_SHITLIST_FSET,
FORMAT_SHITLIST_FOOTER_FSET,
FORMAT_SHITLIST_HEADER_FSET,

FORMAT_SIGNOFF_FSET,
FORMAT_SILENCE_FSET,
FORMAT_SMODE_FSET,
FORMAT_STATUS_FSET,
FORMAT_STATUS1_FSET,
FORMAT_STATUS2_FSET,
FORMAT_STATUS3_FSET,
FORMAT_TIMER_FSET,
FORMAT_TOPIC_FSET,
FORMAT_TOPIC_CHANGE_FSET,
FORMAT_TOPIC_CHANGE_HEADER_FSET,
FORMAT_TOPIC_SETBY_FSET,
FORMAT_TOPIC_UNSET_FSET,
FORMAT_TRACE_OPER_FSET,
FORMAT_TRACE_SERVER_FSET,
FORMAT_TRACE_USER_FSET,
FORMAT_USAGE_FSET,
FORMAT_USERLIST_FSET,
FORMAT_USERLIST_FOOTER_FSET,
FORMAT_USERLIST_HEADER_FSET,

FORMAT_USERMODE_FSET,
FORMAT_USERS_FSET,
FORMAT_USERS_HEADER_FSET,
FORMAT_USERS_SHIT_FSET,
FORMAT_USERS_TITLE_FSET,
FORMAT_USERS_USER_FSET,
FORMAT_VERSION_FSET,
FORMAT_WALL_FSET,
FORMAT_WALLOP_FSET,
FORMAT_WALL_AR_FSET,
FORMAT_WATCH_SIGNOFF_FSET,
FORMAT_WATCH_SIGNON_FSET,
FORMAT_WHO_FSET,
FORMAT_WHOIS_ADMIN_FSET,
FORMAT_WHOIS_AWAY_FSET,
FORMAT_WHOIS_BOT_FSET,
FORMAT_WHOIS_CHANNELS_FSET,
FORMAT_WHOIS_FOOTER_FSET,
FORMAT_WHOIS_FRIEND_FSET,
FORMAT_WHOIS_HEADER_FSET,
FORMAT_WHOIS_HELP_FSET,
FORMAT_WHOIS_IDLE_FSET,
FORMAT_WHOIS_NAME_FSET,
FORMAT_WHOIS_NICK_FSET,
FORMAT_WHOIS_OPER_FSET,
FORMAT_WHOIS_REGISTER_FSET,
FORMAT_WHOIS_SERVER_FSET,
FORMAT_WHOIS_SERVICE_FSET,
FORMAT_WHOIS_SHIT_FSET,
FORMAT_WHOIS_SIGNON_FSET,
FORMAT_WHOIS_ACTUALLY_FSET,
FORMAT_WHOLEFT_FOOTER_FSET,
FORMAT_WHOLEFT_HEADER_FSET,
FORMAT_WHOLEFT_USER_FSET,
FORMAT_WHOWAS_HEADER_FSET,
FORMAT_WHOWAS_NICK_FSET,
FORMAT_WIDELIST_FSET,
FORMAT_WINDOW_SET_FSET,
FORMAT_XTERM_TITLE_FSET,
NUMBER_OF_FSET
};


typedef struct cset_array_struc
{
	char *name;
	int type;
	int offset;
	void (*func) (struct cset_array_struc *, CSetList *);
	int flag;
}	CSetArray;

typedef struct wset_array_struc
{
	char *name;
	int type;
	int offset;
	int format_offset;
	void (*func) (Window *, char *, int);
	int flag;
}	WSetArray;


void		cset_variable(char *, char *, char *, char *);
int		BX_get_cset_int_var(CSetList *, int);
void		BX_set_cset_int_var(CSetList *, int, int);
char		*BX_get_cset_str_var(CSetList *, int);
void		BX_set_cset_str_var(CSetList *, int, char *);

CSetList	*create_csets_for_channel(char *channel);
void		remove_csets_for_channel(CSetList *);
char		*BX_get_wset_string_var(WSet *, int);
void		BX_set_wset_string_var(WSet *, int, char *);
void		wset_variable(char *, char *, char *, char *);
WSet		*create_wsets_for_window(Window *);
void		create_fsets(Window *, int);
void		remove_wsets_for_window(Window *);
char		*BX_fget_string_var(enum FSET_TYPES);
void		BX_fset_string_var(enum FSET_TYPES, char *);
void		fset_variable(char *, char *, char *, char *);
char		*make_fstring_var(const char *);
char		**get_wset_format_var_address(WSet *, int);
char		*get_cset(char *, ChannelList *, char *);
void		delete_all_ext_fset(void);
CSetList	*check_cset_queue(char *, int);
void		do_logchannel(unsigned long, ChannelList *, char *, ...);
void		check_channel_limit(ChannelList *chan);

void add_numeric_fset(char *name, int remove, char *args, int);
char *find_numeric_fset(int numeric);

#endif /* _CSETS_H_ */

--- NEW FILE: tcl_bx.h ---
/*
 *
 * CopyRight Colten Edwards Oct 96
 *
 */

#ifndef _IRCTCL_H
#define _IRCTCL_H

int handle_dcc_bot (int, char *);
int handle_tcl_chan (int, char *, char *, char *);

typedef struct {
	char *name;
	int  (*func) ();
	int access;
	char *help;
} cmd_t;

extern cmd_t C_msg[];
extern cmd_t C_dcc[];
int check_tcl_dcc (char *, char *, char *, int);

void tcl_command (char *, char *, char *, char *);
void tcl_load (char *, char *, char *, char *);

#ifdef WANT_TCL


#include <tcl.h>
extern Tcl_Interp *tcl_interp;
void check_tcl_tand (char *, char *, char *);
void check_tcl_msgm (char *, char *, char *, char *, char *);
void check_tcl_pubm (char *, char *, char *, char *);
int check_tcl_pub (char *, char *, char *, char *);
int check_tcl_msg (char *, char *, char *, char *, char *);
int check_tcl_ctcp (char *, char *, char *, char *, char *, char *);


void check_tcl_join (char *,char *, char *, char *);
int check_tcl_raw (char *, char *);
void check_tcl_rejoin (char *,char *,char *,char *);
void check_tcl_split (char *,char *,char *,char *);
void check_tcl_chat (char *,int, char *);
int check_tcl_ctcr (char *,char *,char *,char *,char *,char *);
void check_tcl_mode (char *,char *,char *,char *,char *);
void check_tcl_kick (char *,char *,char *,char *,char *,char *);
void check_tcl_nick (char *,char *,char *,char *, char *);
void check_tcl_topc (char *,char *,char *,char *,char *);
void check_tcl_sign (char *, char *,char *, char *,char *);
void check_tcl_part (char *, char *, char *, char *);
int check_help_bind (char *);
int check_tcl_input (char *);
int check_on_hook (int, char *);
void check_timers (void);
void check_utimers (void);
void tcl_list_timer (Tcl_Interp *, TimerList *);
int check_on_hook (int, char *);
void add_tcl_vars(void);

void tcl_init (void);
void add_to_tcl(Window *, char *);
void init_public_tcl(Tcl_Interp *);
void init_public_var(Tcl_Interp *);
int Tcl_Invoke(Tcl_Interp *, char *, char *);


#define STDVAR (ClientData cd, Tcl_Interp *irp, int argc, char *argv[])

#define BADARGS(nl,nh,example) \
  if ((argc<(nl)) || (argc>(nh))) { \
    Tcl_AppendResult(irp,"wrong # args: should be \"",argv[0], \
		     (example),"\"",NULL); \
    return TCL_ERROR; \
  }


#endif

#endif




More information about the dslinux-commit mailing list