// Emacs style mode select   -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// DESCRIPTION:
//	Cheat code checking.
//
//-----------------------------------------------------------------------------


#ifndef __M_CHEAT__
#define __M_CHEAT__

//
// CHEAT SEQUENCE PACKAGE
//

#define CHEAT(value, parameters) \
	{ value, sizeof(value) - 1, parameters, 0, 0 }

#define MAX_CHEAT_LEN 15
#define MAX_CHEAT_PARAMS 5

typedef struct
{
	// settings for this cheat

	char sequence[MAX_CHEAT_LEN];
	int sequence_len;
	int parameter_chars;

	// state used during the game

	int chars_read;
	int param_chars_read;
	char parameter_buf[MAX_CHEAT_PARAMS];
} cheatseq_t;

int
cht_CheckCheat
( cheatseq_t*		cht,
 char			key );


void
cht_GetParam
( cheatseq_t*		cht,
 char*			buffer );


#endif
//-----------------------------------------------------------------------------
//
// $Log:$
//
//-----------------------------------------------------------------------------
