/************************************************************************/
/* Copyright 2010 MBARI													*/
/************************************************************************/
/* Summary	: Definitions for application scripting						*/
/* Filename : script.h													*/
/* Author	: Robert Herlien (rah)										*/
/* Project	: Respirometers												*/
/* Revision : 1.0														*/
/* Created	: 10/05/2010												*/
/*																			*/
/* MBARI provides this documentation and code "as is", with no warranty,	*/
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium	*/
/* Research Institute to assist in its use, correction, modification, or	*/
/* enhancement. This information should not be published or distributed to	*/
/* third parties without specific written permission from MBARI.			*/
/*																			*/
/************************************************************************/
/* Modification History:												*/
/* 05oct2010 rah - created												*/
/* $Log $
*/
/************************************************************************/

#include <mbariTypes.h>			/* MBARI type definitions				*/
#include <mbariConst.h>			/* MBARI constants						*/
#include <oasis.h>				/* OASIS controller definitions			*/
#include <olist.h>				/* Linked list library					*/
#include <file.h>				/* OASIS File I/O routines				*/
#include <script.h>				/* Scripting Language definitions		*/
#include <parse.h>				/* Generic parser declarations			*/
#include <variable.h>			/* Variable definitions					*/
#include <syslog.h>				/* Respirometer system logger			*/
#include <debug.h>
#include <otask.h>
#include <drvr.h>				/* OASIS driver functions				*/
#include <remote.h>				/* Remote I/O library					*/
#include <utils.h>
#include <timer.h>				/* OASIS Clock module					*/

#include <string.h>				/* Standard string library				*/
#include <ctype.h>				/* Standard character library			*/
#include <stdarg.h>
#include <time.h>


/********************************/
/*		External Data			*/
/********************************/


/****************************************/
/*		Script Function Declarations	*/
/****************************************/


/********************************/
/*		Module Local Data		*/
/********************************/

MLocal LstHead	scrList;


/************************************************************************/
/* Function	   : initScript												*/
/* Purpose	   : Initialize this module									*/
/* Inputs	   : None													*/
/* Outputs	   : None													*/
/************************************************************************/
void initScript()
{
	list_init(&scrList);

} /* initScript() */


/************************************************************************/
/* Function	   : parseScript											*/
/* Purpose	   : Parse "script = filename"								*/
/* Inputs	   : Ptr to remainder of parse line							*/
/* Outputs	   : OK or ERROR											*/
/************************************************************************/
Errno parseScript(char *cmdtail)
{
	return(OK);

} /* parseScript() */


/************************************************/
/*		User Functions to control Scripts		*/
/************************************************/

/************************************************************************/
/* Function	   : showScript												*/
/* Purpose	   : Show status of scripts running in system				*/
/* Inputs	   : None													*/
/* Outputs	   : OK														*/
/************************************************************************/
CmdRtn showScript(Void)
{
	return(OK);

} /* showScript() */


/************************************************************************/
/* Function	   : startScript											*/
/* Purpose	   : User func to start a script							*/
/* Inputs	   : Parm mask, script name									*/
/* Outputs	   : OK or ERROR											*/
/************************************************************************/
CmdRtn startScript(Nat16 pmask, char *fname)
{
	return(OK);

} /* startScript() */


/************************************************************************/
/* Function	   : findScript												*/
/* Purpose	   : Look for a script by file name							*/
/* Inputs	   : Script name											*/
/* Outputs	   : ScriptDesc ptr or NULL									*/
/************************************************************************/
ScriptDesc *findScript(char *fname)
{
	return(NULL);

} /* findScript() */


/************************************************************************/
/* Function	   : stopScript												*/
/* Purpose	   : Stop a script											*/
/* Inputs	   : Parm mask, script name									*/
/* Outputs	   : OK or ERROR											*/
/************************************************************************/
CmdRtn stopScript(Nat16 pmask, char *fname)
{
	return(OK);

} /* stopScript() */


/************************************************************************/
/* Function	   : restartScript											*/
/* Purpose	   : User func to stop and restart a script					*/
/* Inputs	   : Parm mask, script name									*/
/* Outputs	   : OK or ERROR											*/
/************************************************************************/
CmdRtn restartScript(Nat16 pmask, char *fname)
{
	if (stopScript(pmask, fname) != OK)
		return(ERROR);

	return(startScript(pmask, fname));

} /* restartScript() */
