/*
 * cset.h: header for cset.c
 */

#ifndef _CSET_H_
#define _CSET_H_

/* This ensures we always have the offsetof() macro */
#ifndef offsetof
#include <stddef.h>
/*#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_REJOIN_CSET,
	BITCH_CSET,
	COMPRESS_MODES_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_OPS_CSET,
	KICK_ON_DEOPFLOOD_CSET,
	KICK_ON_JOINFLOOD_CSET,
	KICK_ON_KICKFLOOD_CSET,
	KICK_ON_NICKFLOOD_CSET,
	KICK_ON_PUBFLOOD_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_FORMAT_WSET,
	STATUS_FORMAT1_WSET,
	STATUS_FORMAT2_WSET,
	STATUS_FORMAT3_WSET,
	STATUS_HOLD_WSET,
	STATUS_HOLD_LINES_WSET,
	STATUS_LAG_WSET,
	STATUS_MAIL_WSET,
	STATUS_MODE_WSET,
	STATUS_MSGCOUNT_WSET,
	STATUS_NOTIFY_WSET,
	STATUS_OPER_KILLS_WSET,
	STATUS_QUERY_WSET,
	STATUS_SERVER_WSET,
	STATUS_TOPIC_WSET,
	STATUS_UMODE_WSET,
	STATUS_USER_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_USER3_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,
	NUMBER_OF_WSETS
};

enum FSET_TYPES
{
FORMAT_381_FSET,
FORMAT_391_FSET,
FORMAT_443_FSET,
FORMAT_471_FSET,
FORMAT_473_FSET,
FORMAT_474_FSET,
FORMAT_475_FSET,
FORMAT_476_FSET,
FORMAT_ACTION_FSET,
FORMAT_ACTION_AR_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_HEADER_FSET,
FORMAT_BITCH_FSET,
FORMAT_BOT_FSET,
FORMAT_BOT_FOOTER_FSET,
FORMAT_BOT_HEADER_FSET,
FORMAT_BWALL_FSET,

FORMAT_CHANNEL_SIGNOFF_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_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_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_SIGNOFF_UH_FSET,
FORMAT_NOTIFY_SIGNON_FSET,
FORMAT_NOTIFY_SIGNON_UH_FSET,
FORMAT_OPER_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_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_BOT_FSET,
FORMAT_USERS_HEADER_FSET,
FORMAT_USERS_SHIT_FSET,
FORMAT_USERS_USER_FSET,
FORMAT_VERSION_FSET,
FORMAT_WALL_FSET,
FORMAT_WALLOP_FSET,
FORMAT_WALL_AR_FSET,
FORMAT_WHO_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_IDLE_FSET,
FORMAT_WHOIS_NAME_FSET,
FORMAT_WHOIS_NICK_FSET,
FORMAT_WHOIS_OPER_FSET,
FORMAT_WHOIS_SERVER_FSET,
FORMAT_WHOIS_SHIT_FSET,
FORMAT_WHOIS_SIGNON_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,
NUMBER_OF_FSET
};


typedef struct cset_array_struc
{
	char *name;
	int type;
	int offset;
	void (*func) _((Window *, char *, int));
}	CSetArray;


void	cset_variable(char *, char *, char *, char *);
int	get_cset_int_var(CSetList *, int);
void	set_cset_int_var(CSetList *, int, int);
CSetList *create_csets_for_channel(char *channel);
void	remove_csets_for_channel(CSetList *);
char	*get_wset_string_var(WSet *, int);
void	set_wset_string_var(WSet *, int, char *);
void	wset_variable(char *, char *, char *, char *);
WSet	*create_wsets_for_window(Window *);
void	remove_wsets_for_window(Window *);
char	*fget_string_var(enum FSET_TYPES);
void	fset_string_var(enum FSET_TYPES, char *);
void	fset_variable(char *, char *, char *, char *);
char	*make_fstring_var(char *);

#endif /* _CSETS_H_ */
