/*
 * keys.h: header for keys.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright (c) 1990 Michael Sandrof.
 * Copyright (c) 1991, 1992 Troy Rollo.
 * Copyright (c) 1992-2005 Matthew R. Green.
 * All rights reserved.
 *
 * 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. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
 */

/*
 * @(#)$eterna: keys.h.proto,v 1.27 2005/04/03 02:35:07 mrg Exp $
 */

#ifndef __keys_h_
#define __keys_h_

#define BACKSPACE $
#define BACKWARD_CHARACTER $
#define BACKWARD_HISTORY $
#define BACKWARD_WORD $
#define BEGINNING_OF_LINE $
#define CLEAR_SCREEN $
#define COMMAND_COMPLETION $
#define DELETE_CHARACTER $
#define DELETE_NEXT_WORD $
#define DELETE_PREVIOUS_WORD $
#define END_OF_LINE $
#define ENTER_DIGRAPH $
#define	ENTER_MENU $
#define ERASE_LINE $
#define ERASE_TO_BEG_OF_LINE $
#define ERASE_TO_END_OF_LINE $
#define FORWARD_CHARACTER $
#define FORWARD_HISTORY $
#define FORWARD_WORD $
#define META1_CHARACTER $
#define META2_CHARACTER $
#define META3_CHARACTER $
#define META4_CHARACTER $
#define META5_CHARACTER $
#define META6_CHARACTER $
#define META7_CHARACTER $
#define META8_CHARACTER $
#define NEXT_WINDOW $
#define NOTHING $
#define PARSE_COMMAND $
#define PREVIOUS_WINDOW $
#define QUIT_IRC $
#define QUOTE_CHARACTER $
#define REFRESH_INPUTLINE $
#define REFRESH_SCREEN $
#define	SCROLL_BACKWARD $
#define	SCROLL_END $
#define SCROLL_FORWARD $
#define SCROLL_START $
#define SELF_INSERT $
#define SEND_LINE $
#define STOP_IRC $
#define SWAP_LAST_WINDOW $
#define SWAP_NEXT_WINDOW $
#define SWAP_PREVIOUS_WINDOW $
#define SWITCH_CHANNELS $
#define TOGGLE_INSERT_MODE $
#define TOGGLE_STOP_SCREEN $
#define TRANSPOSE_CHARACTERS $
#define TYPE_TEXT $
#define UNSTOP_ALL_WINDOWS $
#define YANK_FROM_CUTBUFFER $
#define NUMBER_OF_FUNCTIONS $

/* KeyMap: the structure of the irc keymaps */
typedef struct
{
	int	index;
	u_char	changed;
	int	global;
	u_char	*stuff;
}	KeyMap;

/* KeyMapNames: the structure of the keymap to realname array */
typedef struct
{
	char	*name;
	void	(*func)(u_int, u_char *);
}	KeyMapNames;

extern	KeyMap	keys[],
		meta1_keys[],
		meta2_keys[],
		meta3_keys[],
		meta4_keys[],
		meta5_keys[],
		meta6_keys[],
		meta7_keys[],
		meta8_keys[];
extern	KeyMapNames key_names[];

	void	(* get_send_line(void))(u_int, u_char *);
	void	save_bindings(FILE *, int);
	void	change_send_line(void (*)(u_int, u_char *));
	void	bindcmd(u_char *, u_char *, u_char *);
	void	rbindcmd(u_char *, u_char *, u_char *);
	void	parsekeycmd(u_char *, u_char *, u_char *);
	void	typecmd(u_char *, u_char *, u_char *);

#endif /* __keys_h_ */
