/************************************************************************/
/* Copyright 2012 MBARI													*/
/************************************************************************/
/* Summary	: Definitions for system variables for BEDS controller		*/
/* Filename : variable.h												*/
/* Author	: Robert Herlien (rah)										*/
/* Project	: Benthic Event Detection System (BEDS)						*/
/* Revision : 1.0														*/
/* Created	: 09/24/2012												*/
/*																			*/
/* 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:												*/
/* 24sep2012 rah - created from Oasis4 parm.h							*/
/* $Log$
 */
/************************************************************************/

#ifndef INCvariableh
#define INCvariable		1

typedef enum					/****************************************/
{								/* VarType - enum for variable type		*/
	VAR_LONG,					/* Long integer type					*/
	VAR_FLOAT,					/* Floating point number				*/
	VAR_BOOL,					/* Boolean, true/false					*/
	VAR_STRING,					/* ASCII String (constant)				*/
	VAR_STRINGA,				/* ASCII String from malloc mem			*/
	VAR_ENUM					/* Enumerated type						*/
} VarType;						/****************************************/

typedef struct					/****************************************/
{								/* Var - System Variable Struct			*/
	char		*vname;			/* Name of parameter					*/
	Void		*vval;			/* Pointer to variable					*/
	VarType		vtype;			/* Variable type						*/
	char *		(*vfunc)();		/* Function to call after var changed	*/
	Int32		valMin;			/* Min value (for VAR_LONG only)		*/
	Int32		valMax;			/* Max value (for VAR_LONG only)		*/
	char		*vhelp;			/* Help string for variable				*/
} Var;							/****************************************/

#define VAR_ALLOCATED	1


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

void	initVars(void);
Var		*findVar(char *name);
char	*setVar(char *name, char *value, MBool show);
CmdRtn	varCmd(int argc, char **argv);
void	checkVars(void);

#endif /* INCvariableh */
