/*
Copyright (C) 1996-1997 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/


// this is the basic shell of an mhscript parsing routine

#include "quakedef.h"
#include "script_common.h"

void XXX_Script_Execute (char *scriptname, FILE *scriptfile)
{
	int i;
	char skey[64], value[64];

	while (1)
	{
		if (!Script_ParseOpeningBrace (scriptfile)) goto finish_script;

		while (1)
		{
			if (!Script_Read (scriptfile, &skey[0])) goto bad_script;
			if (!Script_Read (scriptfile, &value[0])) goto bad_script;

			i = Script_ParseClosingBrace (scriptfile);

			if (i == -1)
				goto bad_script;
			else if (i == 1)
			{
				goto next_script_item;
			}
		}
next_script_item:;
	}

bad_script:
	Con_Printf ("Error parsing scripts/%s.mhs\n", scriptname);

finish_script:
	return;
}

