/*------------------------------------------------------------------------*
  Filename....: fzpl_plugin.h
  Scope.......: Definitions for Plugins.
				This file is exposed to plugins.
  Last Change.:

  Version      Date                Description      Author
	 1.0        05/21/01            New				Tim Hanes

  COPYRIGHT (C) 2000.  All Rights Reserved.
  auto*des*sys, Inc., Columbus, Ohio, USA.
 *------------------------------------------------------------------------*/

#ifndef FZPL_PLUGIN_H
#define FZPL_PLUGIN_H


#ifdef  __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <stdio.h>
#include <string.h>

#include "fzrt_api_type.h"

#include "fzpl_uuid_type.h"


/* @doc EXTERNAL FZPL_PLUGIN */
/********************************************************************************************************

	@module Plugin Manager
	
	@desc	Manages formZ Plugins.  The formZ plugin manager provides functions for
			registering plugins and function sets with formZ and acquiring function
			sets from formZ and other plugins.

	@toc	fzpl

*********************************************************************************************************/


/********************************************************************************************************

	@def
	
	@desc	formZ plugin manager error context.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_CONTEXT_ID		1

/********************************************************************************************************

	@enum

	@desc	formZ plugin manager error codes.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef enum fz_error_code_enum
{
	FZPL_BAD_TYPE_ERROR					= 1,		/* @emem Unknown function set type. */
	FZPL_BAD_SIZE_ERROR					= 2,		/* @emem Invalid function set size. */
	FZPL_BAD_VERSION_ERROR				= 3,		/* @emem Invalid version. */
	FZPL_BAD_FILE_TYPE_ERROR			= 4,		/* @emem File type is not "fzpl" */
	FZPL_NO_PLUGIN_DESC_ERROR			= 5,		/* @emem Plugin file symbol "fz_descriptor" not defined. */
	FZPL_BAD_PLUGIN_DESC_ERROR			= 6,		/* @emem Plugin file symbol "fz_descriptor" is not a valid value. */
	FZPL_NO_PLUGIN_VERSION_ERROR		= 7,		/* @emem Plugin file symbol "fz_API_version" not defined. */
	FZPL_NO_PLUGIN_ENTRY_ERROR			= 8,		/* @emem Plugin file symbol "fz_plugin_entry" not defined. */
	FZPL_DLL_LOAD_ERROR					= 9,		/* @emem Plugin file load failed. */
	FZPL_CONTEXT_NOT_INITIALIZED_ERROR	= 10,		/* @emem Plugin context not initialized. */
	FZPL_PLUGIN_ALREADY_LOADED			= 11,		/* @emem Plugin already loaded. */
	FZPL_DISABLED_ERROR					= 12,		/* @emem Plugin is disabled. */
	FZPL_BAD_FUNCTION_SET_ERROR			= 13,		/* @emem NULL or invalid function set. */
	FZPL_INVALID_PLUGIN_ERROR			= 14,		/* @emem Invalid plugin id. */
	FZPL_DUPLICATE_ERROR				= 15,		/* @emem Attempt to register a duplicate plugin type. */
	FZPL_NULL_PLUGIN_ENTRY_ERROR		= 16,		/* @emem NULL plugin entry function pointer. */
	FZPL_PLUGIN_MISSING_REQD_FUNC		= 17,		/* @emem Required function not implemented in plugin. */
	FZPL_PLUGIN_BAD_APP_VARIANT_ERROR	= 18,		/* @emem Plugin is not supported by this application variant. */  
	
	FZPL_ERROR_CODE_MAX	
}  fz_error_code_enum;


/*********************************************************
 *
 *	Versioning
 *
 *********************************************************/

/********************************************************************************************************

	@type

	@desc	formZ plugin version type
			Represents the version of a plugin and data.
			The version number is made up of 4 values:<nl>
				The major version number.<nl>
				The minor version number.<nl>
				The patch major version number.<nl>
				The patch minor version number.<nl>
			As an example, for version 3.9.5, the major version
			number is 3, the minor version number is 9, the patch
			major version number is 5 and the patch minor version
			number is 0.<nl>

			These version numbers are encoded such that values of
			type fzpl_vers_td can be directly compared using
			standard c/c++ comparison operators (>, <, ==, !=).
			
	@avail	5.0.0.0
	
	@see	FZPL_VERS_MAKE

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_unsigned_int fzpl_vers_td;

/********************************************************************************************************

	@enum

	@desc	formZ plugin version comparison options.
			Passed into functions which do version comparisons.
			Specifies whether the version should be older, newer,
			or an exact match.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef enum fzpl_vers_op_td
{
	FZPL_VERSION_OP_OLDER,		/* @emem Specifies that the version must be older or the same */
	FZPL_VERSION_OP_NEWER,		/* @emem Specifies that the version must be newer or the same */
	FZPL_VERSION_OP_EXACT		/* @emem Specifies that the version must be the same */
}  fzpl_vers_op_td;

/*  version macros */
/********************************************************************************************************

	@def

	@desc	Fills a version.  This macro does the bit encoding of the major, minor,
			patch major and patch minor version numbers to produce
			a number suitable for a fzpl_vers_td.

	@parm	fzrt_int | va | <in> | The major version number.
	@parm	fzrt_int | vb | <in> | The minor version number.
	@parm	fzrt_int | vc | <in> | The patch major version number.
	@parm	fzrt_int | vd | <in> | The patch minor version number.

	@return	The bit encoded version number.
			
	@rtype	fzpl_vers_td
			
	@avail	5.0.0.0
	
	@see	FZPL_VERS_GET_MAJ, FZPL_VERS_GET_MIN,
			FZPL_VERS_GET_BUG_MAJ, FZPL_VERS_GET_BUG_MIN

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_MAKE(va,vb,vc,vd)      ((fzpl_vers_td)((va)<<24)|((vb)<<16)|((vc)<<8)|(vd))

/********************************************************************************************************

	@def
	
	@desc	A version number which indicates a don't care condition.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_ANY				((fzpl_vers_td)0xffffffff)

/********************************************************************************************************

	@def
	
	@desc	Extracts the major version number from a fzpl_vers_td

	@parm	fzpl_vers_td | va | <in> | The version.

	@return	The major version number.

	@rtype	fzrt_int
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_GET_MAJ(va)		((fzrt_int)(((va)&0xff000000)>>24))

/********************************************************************************************************

	@def
	
	@desc	Extracts the minor version number from a fzpl_vers_td

	@parm	fzpl_vers_td | va | <in> | The version.

	@return	The minor version number.

	@rtype	fzrt_int
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_GET_MIN(va)		((fzrt_int)(((va)&0x00ff0000)>>16))

/********************************************************************************************************

	@def
	
	@desc	Extracts the patch major version number from a fzpl_vers_td

	@parm	fzpl_vers_td | va | <in> | The version.

	@return	The patch major version number.

	@rtype	fzrt_int
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_GET_BUG_MAJ(va)	((fzrt_int)(((va)&0x0000ff00)>>8))

/********************************************************************************************************

	@def
	
	@desc	Extracts the patch minor version number from a fzpl_vers_td

	@parm	fzpl_vers_td | va | <in> | The version.

	@return	The patch minor version number.
			
	@rtype	fzrt_int
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_VERS_GET_BUG_MIN(va)	((fzrt_int)((va)&0x000000ff))


/*********************************************************
 *
 *	String Size Constants
 *
 *********************************************************/

/********************************************************************************************************

	@def
	
	@desc	The string size of a type string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_TYPESTR_SIZE		64
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a type string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_TYPESTR_LEN	(FZPL_TYPESTR_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_NAME_SIZE			64
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_NAME_LEN		(FZPL_NAME_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a plugin symbol name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_SYMBOL_SIZE		32
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a plugin symbol name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_SYMBOL_LEN		(FZPL_SYMBOL_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a path name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_PATH_SIZE			256
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a path name string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_PATH_LEN		(FZPL_PATH_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a URL string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_URL_SIZE			512
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a URL string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_URL_LEN		(FZPL_URL_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of an attribute key value list string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_ATTR_SIZE			512
/********************************************************************************************************

	@def
	
	@desc	The maximum length of an attribute key value list string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_ATTR_LEN		(FZPL_ATTR_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a plugin descriptor string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_DESCRIPTOR_SIZE	64
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a plugin descriptor string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_DESCRIPTOR_LEN	(FZPL_DESCRIPTOR_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a file extension string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_FEXTENSION_SIZE	8
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a file extension string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_FEXTENSION_LEN	(FZPL_FEXTENSION_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a file type string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_FTYPE_SIZE			8
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a file type string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_FTYPE_LEN		(FZPL_FTYPE_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The string size of a plugin description string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_DESC_SIZE			512
/********************************************************************************************************

	@def
	
	@desc	The maximum length of a plugin description string.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_MAX_DESC_LEN		(FZPL_DESC_SIZE-1)

/********************************************************************************************************

	@def
	
	@desc	The size (in bytes) of a function set private header block.
			
	@avail	5.0.0.0
  
	@see	fzpl_fset_td

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_PRVT_DATA_SIZE		64

#define FZPL_DEFAULT_NO_LOAD_BIT		0
/********************************************************************************************************

	@def
	
	@desc	A flag assigned to fz_defaults data symbol exported from plugins.
			This flag instructs formZ to not load this plugin when this plugin
			is first encountered.
			
	@avail	6.1.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_DEFAULT_NO_LOAD_FLAG		(1 << FZPL_DEFAULT_NO_LOAD_BIT)


/*********************************************************
 *
 *	Type To String Macros
 *  Runtime type checking macros for fzpl_functionset_td.
 *
 *********************************************************/

/********************************************************************************************************

	@def
	
	@desc	Converts a data or function type to a string and compares it to another string.

	@parm	type | type | <in> | The type to compare.
	@parm	char * | type_string | <in> | The string to compare with the type.

	@return	TRUE - the type matches the string.<nl>
  			FALSE - no match.
			
	@rtype	fzrt_boolean
			
	@avail	5.0.0.0
  			
	@see	FZPL_TYPE_2_STRING, FZPL_TYPE_STRING

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_CHECK_TYPE(type,type_string)	(strcmp(#type,type_string) ? FALSE : TRUE)

/********************************************************************************************************

	@def
	
	@desc	Converts a data or function type to a string and copies it to another string.

	@parm	type | type | <in> | The type to convert.
	@parm	char * | type_string | <in> | The string to copy the type to.
	@parm	fzrt_int | maxlen | <in> | The maximum number of characters to copy into type_string.
			
	@avail	5.0.0.0
  			
	@see	FZPL_CHECK_TYPE, FZPL_TYPE_STRING

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_TYPE_2_STRING(type,type_string,maxlen)	strncpy((type_string),#type,(maxlen))

/********************************************************************************************************

	@def
	
	@desc	Coverts a data type to a string.

	@parm	type | type | <in> | The type to convert.

	@return	The string.

	@rtype	char *
			
	@avail	5.0.0.0
   			
	@see	FZPL_TYPE_2_STRING, FZPL_CHECK_TYPE

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_TYPE_STRING(type)	(#type)




/********************************************************************************************************

	@def
	
	@desc	Plugin runtime id specifying a plugin that could not loaded.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_PLUGIN_NONE_ID	0xffffffff


/*********************************************************
 *
 *	Plugin Registration Type Definitions
 *
 *********************************************************/

/********************************************************************************************************

	@type

 	@desc	formZ plugin registration flags type.
 			Bit encoded flags used to describe general plugin capabilities.<nl>
 			NOTE: No general capability flags are defined at this time,
 			so this should always be set to FZPL_REG_FLAGS_NONE.
 			
	@avail	5.0.0.0
			
 	@see	fzpl_plugin_register

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_int fzpl_plugin_reg_flags_td;

/********************************************************************************************************

	@def
	
	@desc	No plugin registration flags set.
			
	@avail	5.0.0.0
			
 	@see	fzpl_plugin_register, fzpl_plugin_reg_flags_td

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_REG_FLAGS_NONE				0x00000000


/*********************************************************
 *
 *	Plugin Dependency Type Definitions
 *
 *********************************************************/

/********************************************************************************************************

	@def
	
	@desc	The size (in bytes) of a plugin dependency private header block.
			
	@avail	5.0.0.0
			
 	@see	fzpl_plugin_register, fzpl_plugin_dependency_td

	@toc	fzpl

*********************************************************************************************************/
#define FZPL_DEPENDENCY_DATA_SIZE		64

/********************************************************************************************************

	@struct

 	@desc	A plugin dependency definition.
 			If a plugin is dependent on one or more other plugins for its operation,
 			it will create and fill an array of these and pass it to fzpl_plugin_register.
 			If one or more of the plugins a plugin is dependent on is not loaded, formZ
 			can use the information in this structure to inform the user that the other
 			plugins are needed and possibly provide information which would allow the
 			user to obtain those plugin (vendor name and URL).  formZ will also unload
 			the plugin.<nl><nl>
 			
 			The values for the fields of this structure should be obtainable from the other
 			plugins' public header files.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef struct fzpl_plugin_dependency_td
{
	char						prvt_data[FZPL_DEPENDENCY_DATA_SIZE];	/* @field Private data block */
	fzrt_UUID_td				plugin_id;								/* @field The UUID of the plugin depended on */
	char						plugin_name[FZPL_NAME_SIZE];			/* @field The name of the plugin depended on */
	char						plugin_vendor_name[FZPL_NAME_SIZE];		/* @field The vendor name for the plugin depended on */
	char						plugin_URL[FZPL_URL_SIZE];				/* @field The vendor internet URL for the plugin depended on */
	fzpl_vers_td				plugin_version;							/* @field The minimum version of the plugin required */
}  fzpl_plugin_dependency_td;

/*********************************************************
 *
 *	Function Set Type Definitions
 *
 *********************************************************/

/********************************************************************************************************

	@type

 	@desc	Function set private data.  Storage for private data used by formZ plugin manager.
 			
	@avail	5.0.0.0
			
 	@see	fzpl_fset_td

	@toc	fzpl

**********************************************************/
typedef char fzpl_fset_prvt_data_td[FZPL_PRVT_DATA_SIZE];

/********************************************************************************************************

	@struct

 	@desc	Function set.
 			This is the type for a basic function set.  When passing function sets as parameters to
 			functions, cast them to this type.<nl>
 			IMPORTANT NOTE: All function set structures must begin with the prvt_data field.
 			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef struct fzpl_fset_td
{
	fzpl_fset_prvt_data_td		prvt_data;		/* @field Private data block */
}  fzpl_fset_td;

/********************************************************************************************************

	@type	A function set definition.

 	@desc	This defines a function set.  This is used in the fzpl_fset_def_check function to determine
 			if a function set to be filled matches the fill function's implementation.
 			
	@avail	5.0.0.0
			
 	@see	fzpl_fset_def_check

	@toc	fzpl

*********************************************************************************************************/
typedef struct fzpl_fset_def_t *fzpl_fset_def_ptr;

/********************************************************************************************************

	@func

 	@desc	A reserved function place holder.
 			This is a function type which can be used in function set structures as a place
 			holder for future functions.
 			
	@avail	5.0.0.0
			
 	@see	fzpl_fset_td

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_reserved_func) ( void );


/********************************************************************************************************

	@func	Fills a function set.

 	@desc	This is a plugin implemented function.  The plugin needs to implement one of these
 			functions for each function set it implements.  A pointer to each of these functions
 			is passed into fzpl_plugin_add_fset.  This function checks the type and version of a function
 			set that the plugin is to fill.  If the type and version are ok, this function sets the
 			function pointers of the function set.  This function should use fzpl_fset_def_check of the
 			function set glue (fzpl_fset_glue_fset) to do the type and version checking.
 
 	@return	FZRT_NOERR on success.<nl>
			FZRT_BAD_PARAM_ERROR		- fset_def is NULL.<nl>
			This also can return errors generated by fzpl_fset_def_check of the function set factory.
 
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_def_get_fset_func)(
										const fzpl_fset_def_ptr fset_def,		/* @parm <in> | The function set definition. 
																									Use this for type and version checking. */
										fzpl_fset_td * const fset				/* @parm <in> | The function set to fill. */
);

/*********************************************************
 *
 *	Function Set Factory
 *
 *********************************************************/

/********************************************************************************************************

	@fsfunc_t

 	@desc		Acquires a function set.
 				This function fills a pre allocated function set.  It provides runtime type and version
				checking.  It also bumps the function set's reference count so any plugin implementing
				the function set won't be unloaded.  Function pointers for any unimplemented functions
				will be NULL.  
 
 	@return		FZRT_NOERR on success.<nl>
 				FZRT_BAD_PARAM_ERROR	- A parameter is NULL or out of range.<nl>
 				FZPL_BAD_SIZE_ERROR		- fset_size does not match the size of the fset registered with the plugin manager.<nl>
 				FZPL_BAD_VERSION_ERROR	- The requested version of the function set is not available.<nl>
 				FZPL_BAD_TYPE_ERROR		- fset_typestr does not match the type string of the fset registered with the plugin manager.<nl>
 				FZRT_NO_MATCH_ERROR		- The requested function set type is not available.<nl>
 				FZPL_INVALID_PLUGIN_ERROR	- The plugin identified by pluginId is not loaded.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td, fzpl_fset_release

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_acquire_func)(
									const fzrt_UUID_td funcset_id,		/* @parm <in> | The UUID of the function set. */
									fzpl_vers_td funcset_version,	/* @parm <in> | The version of the function set.
																							Use the version in the appropriate
																							header file or FZPL_VERS_ANY. */
									const fzrt_UUID_td pluginId,		/* @parm <in> | The UUID of the plugin which implements
																							the function set.  Use FZRT_UUID_NULL
																							if don't care or formZ implementation. */
									const char *fset_typestr,			/* @parm <in> | The type string of the struct to be filled
																							with function set function pointers.
																							Use FZPL_TYPE_STRING(<type>). */
									fzrt_unsigned_int fset_size,			/* @parm <in> | The size of the struct to be filled
														 									with function set function pointers.
																							Use sizeof(<type>). */
									fzpl_fset_td * const fset			/* @parm <out> | A pointer to the struct containing
																							the function pointers.  This struct
																							must have fzpl_fset_prvt_data_td prvt_data;
																							as its first member.  Will need to cast
																							it to (fzpl_fset_td *). */
);

/********************************************************************************************************

	@fsfunc_t

 	@desc		Releases a function set.
				Releases a function set acquired by fzpl_fset_acquire.  After calling this it will
 				no longer be safe to call any of the function in the function set.  This function
 				decrements the function set's reference count and when it reaches 0, a plugin
 				implementing the function set may be unloaded.
 
 	@return		FZRT_NOERR on success.<nl>
 				FZRT_BAD_PARAM_ERROR	- fset is NULL
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td, fzpl_fset_is_available

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_release_func)(
									fzpl_fset_td * const fset		/* @parm <in> | the function set to be released. */
);

/********************************************************************************************************

	@fsfunc_t	Checks the availability of a function set.

 	@desc		This function checks the availability of a function set without acquiring it (without
 				incrementing its reference count).
 
 	@return		TRUE - The function set is available.<nl>
 				FALSE - The function set is not available.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_acquire

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_boolean (FZRT_SPEC *fzpl_fset_is_available_func)(
									const fzrt_UUID_td funcset_id,		/* @parm <in> | The UUID of the function set. */
									fzpl_vers_td funcset_version,	/* @parm <in> | The version of the function set.
																							Use the version in the appropriate
																							header file or FZPL_VERS_ANY. */
									const fzrt_UUID_td pluginId			/* @parm <in> | The UUID of the plugin which implements
																							the function set.  Use FZRT_UUID_NULL
																							if don't care or formZ implementation. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's UUID.

 	@desc		Queries a function set for its type UUID.  The function set must have been
				acquired by fzpl_fset_acquire.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or id is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_id_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									fzrt_UUID_td id						/* @parm <out> | The type UUID. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's name.

 	@desc		Queries a function set for its human readable name.  The function set must have been
				acquired by fzpl_fset_acquire.  The name string must be pre-allocated by the caller.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or fs_name is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_name_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									char *fs_name,						/* @parm <out> | The type name string. */
									fzrt_unsigned_int max_len				/* @parm <in> | The maximum number of bytes to copy into fs_name. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's version.

 	@desc		Queries a function set for its version.  The function set must have been
				acquired by fzpl_fset_acquire.  fs_version must be pre-allocated by the caller.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or fs_version is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_version_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									fzpl_vers_td * const fs_version	/* @parm <out> | The function set's version. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's UUID of the plugin which implements a function set.

 	@desc		Queries a function set for the UUID of the plugin which implements it.
 				If the function set is implemented by the application, pl_id is set to FZRT_UUID_NULL.
				The function set must have been acquired by fzpl_fset_acquire.
				The UUID must be pre-allocated by the caller.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or pl_id is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_plugin_id_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									fzrt_UUID_td pl_id					/* @parm <out> | The UUID of the implementing plugin. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's type string.

 	@desc		Queries a function set for its human readable type string.
				The function set must have been acquired by fzpl_fset_acquire.
				The type string must be pre-allocated by the caller.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or typestr is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_typestr_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									char *typestr,						/* @parm <out> | The type name string. */
									fzrt_unsigned_int max_len				/* @parm <in> | The maximum number of bytes to copy into typestr. */
);

/********************************************************************************************************

	@fsfunc_t	Checks if a function set is a certain type.

 	@desc		This provides a runtime type check of a function set.
 				The function set must have been acquired by fzpl_fset_acquire.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset, typestr, is_type is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
										  Most likely caused by passing in a function set
										  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_is_type_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to check. */
									const char *typestr,				/* @parm <in> | The type name string for the comparison. */
									fzrt_boolean *is_type				/* @parm <out> | TRUE  if the types match.<nl>
																						  FALSE if the types don't match. */
);

/********************************************************************************************************

	@fsfunc_t	Checks the type size and version of a function set definition.

 	@desc		This provides a runtime type, size and version check of a function set.
 				This function is usually calls from a function set's fill function (fzpl_fset_def_get_fset_func)
 				with version_op set to FZPL_VERSION_OP_NEWER prior to setting the function set's function pointers.
 				This allows the plugin to make sure the function set is the right size, version, and type before filling it.
 
 	@return		FZRT_NOERR if everything matches.<nl>
				FZRT_BAD_PARAM_ERROR	- A parameter is NULL or out of range.<nl>
				FZPL_BAD_SIZE_ERROR		- fset_size does not match the size of the
										  fset registered with the plugin manager.<nl>
				FZPL_BAD_VERSION_ERROR	- The requested version of the function set
										  is not available.<nl>
				FZPL_BAD_TYPE_ERROR		- fset_typestr does not match the type string
										  of the fset registered with the plugin manager.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_def_check_func)(
									const fzpl_fset_def_ptr fset_def,	/* @parm <in> | The function set definition to check. */
									fzpl_vers_td version,			/* @parm <in> | The version to compare.
														  									Use FZPL_VERS_ANY to disable
														 									version checking. */
									const char *fset_typestr,			/* @parm <in> | The type string to compare.
																							Use FZPL_TYPE_STRING(<type>). */
									fzrt_unsigned_int fset_size,			/* @parm <in> | The size to compare.
																							Use sizeof(<type>). */
									fzpl_vers_op_td version_op		/* @parm <in> | The version operation to use in the comparison. */
);

/********************************************************************************************************

	@fsfunc_t	Checks the availability of a function set using it's encrypted UUID.

 	@desc		This function checks the availability of a function set without acquiring it (without
 				incrementing its reference count).
 
 	@return		TRUE - The function set is available.<nl>
 				FALSE - The function set is not available.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_acquire

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_boolean (FZRT_SPEC *fzpl_fset_is_available_crypt_func)(
									const fzrt_UUID_td funcset_id,		/* @parm <in> | The UUID of the function set. */
									fzpl_vers_td funcset_version,	/* @parm <in> | The version of the function set.
																							Use the version in the appropriate
																							header file or FZPL_VERS_ANY. */
									const fzrt_UUID_td pluginId			/* @parm <in> | The UUID of the plugin which implements
																							the function set.  Use FZRT_UUID_NULL
																							if don't care or formZ implementation. */
);

/********************************************************************************************************

	@fsfunc_t	Acquires a function set using an encrypted UUID.

 	@desc		This function fills a pre allocated function set.  It provides runtime type and version
				checking.  It also bumps the function set's reference count so any plugin implementing
				the function set won't be unloaded.  Function pointers for any unimplemented functions
				will be NULL.  
 
 	@return		FZRT_NOERR on success.<nl>
 				FZRT_BAD_PARAM_ERROR	- A parameter is NULL or out of range.<nl>
 				FZPL_BAD_SIZE_ERROR		- fset_size does not match the size of the fset registered with the plugin manager.<nl>
 				FZPL_BAD_VERSION_ERROR	- The requested version of the function set is not available.<nl>
 				FZPL_BAD_TYPE_ERROR		- fset_typestr does not match the type string of the fset registered with the plugin manager.<nl>
 				FZRT_NO_MATCH_ERROR		- The requested function set type is not available.<nl>
 				FZPL_INVALID_PLUGIN_ERROR	- The plugin identified by pluginId is not loaded.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td, fzpl_fset_release

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_acquire_crypt_func)(
									const fzrt_UUID_td funcset_id,		/* @parm <in> | The UUID of the function set. */
									fzpl_vers_td funcset_version,	/* @parm <in> | The version of the function set.
																							Use the version in the appropriate
																							header file or FZPL_VERS_ANY. */
									const fzrt_UUID_td pluginId,		/* @parm <in> | The UUID of the plugin which implements
																							the function set.  Use FZRT_UUID_NULL
																							if don't care or formZ implementation. */
									const char *fset_typestr,			/* @parm <in> | The type string of the struct to be filled
																							with function set function pointers.
																							Use FZPL_TYPE_STRING(<type>). */
									fzrt_unsigned_int fset_size,			/* @parm <in> | The size of the struct to be filled
														 									with function set function pointers.
																							Use sizeof(<type>). */
									fzpl_fset_td * const fset			/* @parm <out> | A pointer to the struct containing
																							the function pointers.  This struct
																							must have fzpl_fset_prvt_data_td prvt_data;
																							as its first member.  Will need to cast
																							it to (fzpl_fset_td *). */
);

/********************************************************************************************************

	@fsfunc_t	Gets a function set's encrypted UUID.

 	@desc		Queries a function set for its encrypted type UUID.  The function set must have been
				acquired by fzpl_fset_acquire.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- fset or id is NULL.<nl>
				FZPL_BAD_FUNCTION_SET_ERROR	- the function set is uninitialized or corrupt.
									  Most likely caused by passing in a function set
									  which was not acquired by fzpl_fset_acquire.
 
	@avail		5.0.0.0
			
 	@see		fzpl_fset_td

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_fset_get_id_crypt_func)(
									const fzpl_fset_td * const fset,	/* @parm <in> | The function set to query. */
									fzrt_UUID_td id						/* @parm <out> | The type UUID. */
);

/********************************************************************************************************

	@fsfunc_t	Registers a plugin with the application.

 	@desc		Used in the FZPL_PLUGIN_INITIALIZE phase of fzpl_plugin_entry_func() to register
				the plugins with the formZ plugin manager.  This function also associates function sets with
				plugins which implement them.
 
 	@return		FZRT_NOERR on success.<nl>
				FZPL_PLUGIN_ALREADY_LOADED	- A plugin matching this plugins description is already loaded.<nl>
				FZPL_DISABLED_ERROR			- The user has disabled this plugin, thus preventing it from
											  being registered.<nl>
				FZRT_NO_MATCH_ERROR			- formZ does not recognize this plugin type or it's version is
											  not acceptable.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_register_func)(
									const fzrt_UUID_td id,						/* @parm <in> | The Unique UUID which identifies this plugin. */
									const char *plugin_name,					/* @parm <in> | The human readable name for the plugin. */
									fzpl_vers_td plugin_version,				/* @parm <in> | The version of the plugin. */
									const char *plugin_vendor_name,				/* @parm <in> | The name of the company which develops or markets the plugin. */
									const char *plugin_URL,						/* @parm <in> | The URL of the company which develops or markets the plugin. */
									const fzrt_UUID_td plugin_type,				/* @parm <in> | The plugin type UUID. */
									fzpl_vers_td plugin_type_version,		/* @parm <in> | The version of the plugin type. */
									fzrt_context_str_func err_str_fcn,			/* @parm <in> | A function which is called to get an error string when the
																									plugin returns a plugin defined error. */
									fzrt_int num_depends,							/* @parm <in> | The number of other plugins this plugin depends on (for
																									function set implementations). */
									const fzpl_plugin_dependency_td *depends,	/* @parm <in> | an array of plugin dependencies.  This array must contain
																									num_depends elements. */
									fzrt_unsigned_int * const plugin_id				/* @parm <out> | An application generated runtime id used to identify this plugin. */
);

/********************************************************************************************************

	@fsfunc_t	Unregisters a plugin.

 	@desc		Used in the FZPL_PLUGIN_EXIT phase of fzpl_plugin_entry_func to unregister
				the plugins that were successfully registered with fzpl_plugin_register.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- plugin_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_unregister_func)(
									fzrt_unsigned_int pluginId			/* @parm <in> | A runtime id used to identify this plugin.
																 						This was set by fzpl_plugin_register. */
);

/********************************************************************************************************

	@fsfunc_t	Sets the description string for a plugin.

 	@desc		Used in the FZPL_PLUGIN_INITIALIZE phase of fzpl_plugin_entry_func, after a plugin is successfully
 				registered, to provide descriptive text about the plugin.  the maximum size if the text is
 				FZPL_MAX_DESCRIPTOR_LEN.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- plugin_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_set_desc_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | A runtime id used to identify this plugin.
																 						This was set by fzpl_plugin_register. */
									char *desc_str					/* @parm <in> | The plugin's description string. */
);

/********************************************************************************************************

	@fsfunc_t

 	@desc		Associates a function set with the plugin which implements it.
 				Used in the FZPL_PLUGIN_INITIALIZE phase of fzpl_plugin_entry_func.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- plugin_id is not valid.<nl>
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_add_fset_func)(
									fzrt_unsigned_int plugin_id,					/* @parm <in> | The plugin to add to function set to. */
									const fzrt_UUID_td fset_id,					/* @parm <in> | The UUID type of the function set.
																									Usually provided by a formZ header file. */
									fzpl_vers_td fset_version,				/* @parm <in> | The version of the function set. */
									const char *fset_name,						/* @parm <in> | A human readable name of the function set.
																									Usually provided by a formZ header file. */
									const char *fset_type_str,					/* @parm <in> | The type of the function set struct.
																									Use FZPL_TYPE_STRING(<type>). */
									fzrt_unsigned_int fset_size,					/* @parm <in> | The size of the function set struct.
																									Use sizeof(<type>). */
									fzpl_fset_def_get_fset_func fset_get_fset,	/* @parm <in> | The plugin implemented function used
																									to set the function pointers of the
																									function set struct. */
									fzrt_boolean is_dynamic						/* @parm <in> | TRUE - The function pointers can change.
																									Tells the application not to
																									cache function pointers.<nl>
																								 FALSE - The function pointers will never change. */
);

/********************************************************************************************************

	@fsfunc_t

 	@desc		Associates a function set with the plugin which implements it.
 				Used in the FZPL_PLUGIN_INITIALIZE phase of fzpl_plugin_entry_func.
 				This function uses encrypted UUIDs.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR		- plugin_id is not valid.<nl>
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_add_fset_crypt_func)(
									fzrt_unsigned_int plugin_id,					/* @parm <in> | The plugin to add to function set to. */
									const fzrt_UUID_td fset_id,					/* @parm <in> | The UUID type of the function set.
																									Usually provided by a formZ header file. */
									fzpl_vers_td fset_version,				/* @parm <in> | The version of the function set. */
									const char *fset_name,						/* @parm <in> | A human readable name of the function set.
																									Usually provided by a formZ header file. */
									const char *fset_type_str,					/* @parm <in> | The type of the function set struct.
																									Use FZPL_TYPE_STRING(<type>). */
									fzrt_unsigned_int fset_size,					/* @parm <in> | The size of the function set struct.
																									Use sizeof(<type>). */
									fzpl_fset_def_get_fset_func fset_get_fset,	/* @parm <in> | The plugin implemented function used
																									to set the function pointers of the
																									function set struct. */
									fzrt_boolean is_dynamic						/* @parm <in> | TRUE - The function pointers can change.
																									Tells the application not to
																									cache function pointers.<nl>
																								 FALSE - The function pointers will never change. */
);

/********************************************************************************************************

	@fsfunc_t

 	@desc		Gets the plugin file's floc.  This function gets the floc for the plugin whose entry point
 				function (fzpl_plugin_entry_func) has been called.
 				
 				IMPORTANT NOTE:  This function is only valid within the plugin's entry point.  If the file's
 				floc is needed at other times, use fzpl_plugin_get_floc in the fzpl_plugin_query_fset function set.
 
 	@return		FZRT_NOERR on success.<nl>
				An error otherwise.
 
	@avail		5.0.0.0

	@toc		fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_file_get_floc_func)(
					fzrt_floc_ptr		floc					/* @parm <out> | The plugin file's floc. */
					);

/********************************************************************************************************

	@fset	fzpl_fset_glue_fset

 	@desc	A function set used to obtain and query other function sets and register plugins.
 			Used to acquire and release function sets and to get info about function sets.
 			This function set is passed to a plugin as a parameter to the plugin's main
 			entry point (fzpl_plugin_entry_func).
			
	@avail	5.0.0.0
			
 	@see	fzpl_fset_td

	@toc	fzpl

*********************************************************************************************************/
/********************************************************************************************************

	@fsdef	Function set glue function set UUID.

*********************************************************************************************************/
/* UUID : {72c37192-25fc-4443-9bdc-4613a4933764} */
#define FZPL_FSG_FSET_TYPE		"\x72\xc3\x71\x92\x25\xfc\x44\x43\x9b\xdc\x46\x13\xa4\x93\x37\x64"	/* Reference : 796 */
/********************************************************************************************************

	@fsdef	Function set glue function set name.

*********************************************************************************************************/
#define FZPL_FSG_FSET_NAME		"Function set glue"
/********************************************************************************************************

	@fsdef	Function set glue function set version.

*********************************************************************************************************/
#define FZPL_FSG_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct fzpl_fset_glue_fset
{
	fzpl_fset_prvt_data_td				prvt_data;

	fzpl_fset_is_available_func			fzpl_fset_is_available;				/* @fsfunc */
	fzpl_fset_acquire_func				fzpl_fset_acquire;					/* @fsfunc */
	fzpl_fset_release_func				fzpl_fset_release;					/* @fsfunc */
	fzpl_fset_get_id_func				fzpl_fset_get_id;					/* @fsfunc */
	fzpl_fset_get_name_func				fzpl_fset_get_name;					/* @fsfunc */
	fzpl_fset_get_version_func			fzpl_fset_get_version;				/* @fsfunc */
	fzpl_fset_get_plugin_id_func		fzpl_fset_get_plugin_id;			/* @fsfunc */
	fzpl_fset_get_typestr_func			fzpl_fset_get_typestr;				/* @fsfunc */
	fzpl_fset_is_type_func				fzpl_fset_is_type;					/* @fsfunc */
	fzpl_fset_def_check_func			fzpl_fset_def_check;				/* @fsfunc */
	fzpl_fset_is_available_crypt_func	fzpl_fset_is_available_crypt;		/* @fsfunc */
	fzpl_fset_acquire_crypt_func		fzpl_fset_acquire_crypt;			/* @fsfunc */
	fzpl_fset_get_id_crypt_func			fzpl_fset_get_id_crypt;				/* @fsfunc */

	fzpl_plugin_register_func			fzpl_plugin_register;				/* @fsfunc */
	fzpl_plugin_unregister_func			fzpl_plugin_unregister;				/* @fsfunc */
	fzpl_plugin_set_desc_func			fzpl_plugin_set_desc;				/* @fsfunc */
	fzpl_plugin_add_fset_func			fzpl_plugin_add_fset;				/* @fsfunc */
	fzpl_plugin_add_fset_crypt_func		fzpl_plugin_add_fset_crypt;			/* @fsfunc */
	fzpl_plugin_file_get_floc_func		fzpl_plugin_file_get_floc;			/* @fsfunc */
	
	/************************************************************************************
	 *																					*
	 *		DO NOT MAKE ANY CHANGES TO THE ABOVE FUNCTIONS!!!							*
	 *		DO NOT ADD ANY FUNCTION ABOVE THIS LINE!!!									*
	 *		@comm  End of version 5.0.0.0 functions.									*
	 *																					*
	 ************************************************************************************/

	fzpl_fset_reserved_func				reserved00;	/* TAH 04/02/03 Begin { */
	fzpl_fset_reserved_func				reserved01;
	fzpl_fset_reserved_func				reserved02;
	fzpl_fset_reserved_func				reserved03;
	fzpl_fset_reserved_func				reserved04;
	fzpl_fset_reserved_func				reserved05;
	fzpl_fset_reserved_func				reserved06;
	fzpl_fset_reserved_func				reserved07;
	fzpl_fset_reserved_func				reserved08;
	fzpl_fset_reserved_func				reserved09;
	fzpl_fset_reserved_func				reserved10;
	fzpl_fset_reserved_func				reserved11;
	fzpl_fset_reserved_func				reserved12;
	fzpl_fset_reserved_func				reserved13;
	fzpl_fset_reserved_func				reserved14;
	fzpl_fset_reserved_func				reserved15;
	fzpl_fset_reserved_func				reserved16;
	fzpl_fset_reserved_func				reserved17;
	fzpl_fset_reserved_func				reserved18;
	fzpl_fset_reserved_func				reserved19;	/* TAH 04/02/03 End } */
} fzpl_fset_glue_fset;


/*********************************************************
 *
 *	Plugin Main Entry Point Definitions
 *
 *********************************************************/

/********************************************************************************************************

	@enum	Plugin entry point commands.

	@desc	These commands tell the plugin what to do each time the entry point is called.
			
	@avail	5.0.0.0
			
 	@see	fzpl_plugin_entry_func

	@toc	fzpl

*********************************************************************************************************/
typedef enum fzpl_command_td
{
	FZPL_PLUGIN_CHECK,		
	FZPL_PLUGIN_INITIALIZE,	/*  @emem Also called the first time a plugin file is loaded. */
	FZPL_PLUGIN_EXIT 		/*  @emem Called just before the application terminates. */
}  fzpl_command_td;

/********************************************************************************************************

	@struct Information about the host application.

 	@desc	The information in this structure can be used to determine if a plugin can run.  For
 			example if a plugin only runs with version 5.0 of formZ RadioZity with an API version 
 			of 4.2, the information can be found in the host_name, host_version, and host_API_version
 			fields.
			
	@avail	5.0.0.0
			
 	@see	fzpl_plugin_entry_func

	@toc	fzpl

*********************************************************************************************************/
typedef struct fzpl_host_config_td
{
	char				host_name[FZPL_NAME_SIZE];			/* @field the name of the host application. */
	char				host_vendor_name[FZPL_NAME_SIZE];	/* @field the vendor name of the host application. */
	char				host_URL[FZPL_URL_SIZE];			/* @field the URL of the host application vendor. */
	fzpl_vers_td		host_version;						/* @field the version of the host application. */
	fzpl_vers_td		host_API_version;					/* @field the version of the API the host application was built with. */
	fzrt_floc_ptr		host_floc;							/* @field the volum spec of the host application disk file. */
}  fzpl_host_config_td;


/********************************************************************************************************

	@func	function type of a plugin's entry point.

 	@desc	This is the prototype for a plugin's entry point.  The symbol name for this function can vary
 			from application to application.  Currently, for all formZ applications this symbol name is
 			fz_plugin_entry.<nl><nl>
 			
 			This function will be called with cmd set to one of the following:<nl>
					FZPL_PLUGIN_INITIALIZE:<nl>
						At this point, the plugin file should check if its plugins
 						can run in the environment described by hostConfig.  If the plugins are licensed,
 						licensing should be checked.  The plugin file should check the availability of all
 						host application implemented function sets.  If for any reason, none of the plugins
 						can run, an appropriate error with an error severity of FZRT_ERROR_SEVERITY_ERROR
 						should be returned.  In this case, formZ will unload the plugin file.
 						If only some of the plugins can not run an appropriate error with an error severity
 						of FZRT_ERROR_SEVERITY_WARNING should be returned.  The plugin file will remain
 						loaded.  The plugin file will register its plugins by calling
						fzpl_plugin_register.  If the registration is successful (fzpl_plugin_register
						returns FZRT_NOERR), the plugin can allocate any memory for global data it needs and
						perform any other one time initialization.<nl>
					FZPL_PLUGIN_EXIT:<nl>
						The host application is about to exit and the plugin is about to be unloaded.
						The plugin should call fzpl_plugin_unregister, free up any allocated memory,
						and perform any uninitialization tasks.

 
 	@return	FZRT_NOERR if the plugin can run.<nl>
 			Otherwise an appropriate error code.
 
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_entry_func)(
							const fzpl_fset_glue_fset * const	fsg,			/* @parm <in> | the function set factory */
							fzpl_command_td						cmd,			/* @parm <in> | the entry point command */
							const fzpl_host_config_td * const	hostConfig		/* @parm <in> | information about the host application */
);




/************************************************************************
 *
 *   fzpl_plugin_query_functionset
 *   Function Set type declaration for querying of Plugin Data
 *		This function set is implemented by the formZ plugin manager.
 *   UUID : {E13CC4FF-9A68-41b0-877E-4FEFF7621124}
 *
 ***********************************************************************/

/********************************************************************************************************

	@fsfunc_t	Gets the name of a plugin.

 	@desc		Gets the human readable name of a plugin.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_name is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_name_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *pl_name,					/* @parm <out> | The plugin's name. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into pl_name. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the UUID of a plugin.

 	@desc		Gets the UUID of a plugin from its runtime id.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_name is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_id_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									fzrt_UUID_td pl_id				/* @parm <out> | The plugin's UUID. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the type UUID of a plugin.

 	@desc		Gets the type UUID of a plugin from its runtime id.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_type is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_type_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									fzrt_UUID_td pl_type			/* @parm <out> | The plugin's type UUID. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the name of a plugin's type.

 	@desc		Gets the human readable name of a plugin's type.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- type_name is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_type_name_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *type_name,				/* @parm <out> | The plugin's type name. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into type_name. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the version of a plugin.

 	@desc		Gets the version of a plugin.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_version is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_version_func)(
									fzrt_unsigned_int plugin_rt_id,				/* @parm <in> | The plugin's runtime id. */
									fzpl_vers_td *const pl_version		/* @parm <out> | The plugin's version. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the version of a plugin's type.

 	@desc		Gets the version of a plugin's type.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_version is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_type_version_func)(
									fzrt_unsigned_int plugin_rt_id,				/* @parm <in> | The plugin's runtime id. */
									fzpl_vers_td *const pl_version		/* @parm <out> | The plugin's type version. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the version of APi a plugin was built with.

 	@desc		Gets the version of APi a plugin was built with.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- api_version is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_API_version_func)(
							fzrt_unsigned_int plugin_rt_id,				/* @parm <in> | The plugin's runtime id. */
							fzpl_vers_td *const api_version		/* @parm <out> | The plugin's API version. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the plugin vendor's name.

 	@desc		Gets the plugin vendor's name.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- vendor_name is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_vendor_name_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *vendor_name,				/* @parm <out> | The plugin vendor's name. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into vendor_name. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the plugin's attribute string.

 	@desc		Gets the plugin's attribute string.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- attr_str is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_attr_string_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *attr_str,					/* @parm <out> | The plugin's attribute string. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into attr_str. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the internet URL for plugin's vendor.

 	@desc		Gets the internet URL for plugin's vendor.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- URL_str is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_URL_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *URL_str,					/* @parm <out> | The plugin's vendor's URL. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into URL_str. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the description for plugin.

 	@desc		Gets the description for plugin.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- desc_str is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_desc_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *desc_str,					/* @parm <out> | The plugin's description string. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into desc_str. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the plugin's file name.

 	@desc		Gets the name of the file the plugin is in.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- file_name is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_file_name_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									char *file_name,				/* @parm <out> | The plugin's file name. */
									fzrt_int max_len						/* @parm <in> | The maximum number of characters to
																						copy into file_name. */
);

/********************************************************************************************************

	@fsfunc_t	Gets the plugin file's runtime library index.

 	@desc		Gets the plugin file's runtime library index which the application assigned when the plugin file was loaded.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- rlib_idx is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_rlib_idx_func)(
									fzrt_unsigned_int plugin_rt_id,		/* @parm <in> | The plugin's runtime id. */
									short * const rlib_idx			/* @parm <out> | The plugin file's library runtime id. */
);


/********************************************************************************************************

	@fsfunc_t	Gets the plugin file's folder locator.

 	@desc		Gets the plugin file's folder locator.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- vspec is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_floc_func)(
									fzrt_unsigned_int plugin_rt_id,			/* @parm <in> | The plugin's runtime id. */
									fzrt_floc_ptr const vspec			/* @parm <out> | The plugin file's folder locator */
);



/********************************************************************************************************

	@fsfunc_t	Gets the the number of function sets implemented by the plugin.

 	@desc		Gets the the number of function sets implemented by the plugin.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- num_fsets is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_num_fsets_func)(
									fzrt_unsigned_int plugin_rt_id,			/* @parm <in> | The plugin's runtime id. */
									fzrt_unsigned_int *const num_fsets		/* @parm <out> | The number of function sets
																							implemented by the plugin. */
);

/********************************************************************************************************

	@fsfunc_t	Gets a plugin's runtime id.

 	@desc		Gets a plugin's runtime id from its UUID.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- pl_id is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_get_runtime_id_func)(
									fzrt_UUID_td pl_id,						/* @parm <in> | The plugin's UUID. */
									fzrt_unsigned_int * const plugin_rt_id		/* @parm <out> | The plugin's runtime id. */
);

/********************************************************************************************************

	@fsfunc_t	Checks if a plugin has been marked as disabled.

 	@desc		Checks if a plugin has been marked as disabled.  This usually means that the user has
 				turned off this plugin and it won't be loaded next time the application runs.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- is_disabled is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_is_disabled_func)(
						fzrt_unsigned_int plugin_rt_id,				/* @parm <in> | The plugin's runtime id. */
						fzrt_boolean * const is_disabled		/* @parm <out> | TRUE - The plugin has been marked
																  					as disabled.<nl>
																 				  FALSE - otherwise. */
);

/********************************************************************************************************

	@fsfunc_t	Checks if a plugin was loaded properly.

 	@desc		Checks if a plugin was loaded properly and can run.
 
 	@return		FZRT_NOERR on success.<nl>
				FZRT_BAD_PARAM_ERROR	- is_valid is NULL or plugin_rt_id is invalid.
 
	@avail		5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
typedef fzrt_error_td (FZRT_SPEC *fzpl_plugin_is_valid_func)(
									fzrt_unsigned_int plugin_rt_id,			/* @parm <in> | The plugin's runtime id. */
									fzrt_boolean * const is_valid		/* @parm <out> | TRUE - the plugin is loaded.
																						  FALSE - otherwise. */
);


/********************************************************************************************************

	@fset	fzpl_plugin_query_fset
	
	@desc	A function set used for getting information about plugins.
			
	@avail	5.0.0.0

	@toc	fzpl

*********************************************************************************************************/
/********************************************************************************************************

	@fsdef	Plugin Query function set UUID.

*********************************************************************************************************/
#define FZPL_PLUGIN_QUERY_FSET_TYPE		"\xe1\x3c\xc4\xff\x9a\x68\x41\xb0\x87\x7e\x4f\xef\xf7\x62\x11\x24"	/* Reference : 2 */
/********************************************************************************************************

	@fsdef	Plugin Query function set name.

*********************************************************************************************************/
#define FZPL_PLUGIN_QUERY_FSET_NAME		"Plugin Query"
/********************************************************************************************************

	@fsdef	Plugin Query function set version.

*********************************************************************************************************/
#define FZPL_PLUGIN_QUERY_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct fzpl_plugin_query_fset
{
	fzpl_fset_prvt_data_td				prvt_data;

	fzpl_plugin_get_name_func			fzpl_plugin_get_name;				/* @fsfunc */
	fzpl_plugin_get_id_func				fzpl_plugin_get_id;					/* @fsfunc */
	fzpl_plugin_get_type_func			fzpl_plugin_get_type;				/* @fsfunc */
	fzpl_plugin_get_type_name_func		fzpl_plugin_get_type_name;			/* @fsfunc */
	fzpl_plugin_get_version_func		fzpl_plugin_get_version;			/* @fsfunc */
	fzpl_plugin_get_type_version_func	fzpl_plugin_get_type_version;		/* @fsfunc */
	fzpl_plugin_get_API_version_func	fzpl_plugin_get_API_version;		/* @fsfunc */
	fzpl_plugin_get_vendor_name_func	fzpl_plugin_get_vendor_name;		/* @fsfunc */
	fzpl_plugin_get_attr_string_func	fzpl_plugin_get_attr_string;		/* @fsfunc */
	fzpl_plugin_get_URL_func			fzpl_plugin_get_URL;				/* @fsfunc */
	fzpl_plugin_get_desc_func			fzpl_plugin_get_desc;				/* @fsfunc */
	fzpl_plugin_get_file_name_func		fzpl_plugin_get_file_name;			/* @fsfunc */
	fzpl_plugin_get_rlib_idx_func		fzpl_plugin_get_rlib_idx;			/* @fsfunc */
	fzpl_plugin_get_num_fsets_func		fzpl_plugin_get_num_fsets;			/* @fsfunc */
	fzpl_plugin_get_runtime_id_func		fzpl_plugin_get_runtime_id;			/* @fsfunc */
	fzpl_plugin_is_disabled_func		fzpl_plugin_is_disabled;			/* @fsfunc */
	fzpl_plugin_is_valid_func			fzpl_plugin_is_valid;				/* @fsfunc */
	fzpl_plugin_get_floc_func			fzpl_plugin_get_floc;				/* @fsfunc */	/* KDA 10/10/03  */
	
	/************************************************************************************
	 *																					*
	 *		DO NOT MAKE ANY CHANGES TO THE ABOVE FUNCTIONS!!!							*
	 *		DO NOT ADD ANY FUNCTION ABOVE THIS LINE!!!									*
	 *		@comm  End of version 5.0.0.0 functions.									*
	 *																					*
	 ************************************************************************************/
}  fzpl_plugin_query_fset;



#ifdef  __cplusplus
}
#endif /* __cplusplus */


#endif /* FZPL_PLUGIN_H */

