******************************************************************************
***
*** Module name		:	EvsApi.h
***
*** Written by		:
***
*** Contents		:	
***
*** Description		:	Environment service API include file
***
***	Modifications	:
***
***	Version 1.0
***
******************************************************************************

*
	This file EvsAPI.h is the include file for C modules that use the

	Environment Service API.  The C modules which include this file must be

	written in Microsoft C.  This module defines the following information

	regarding the Environment Service which could be helpful to a user :


			Request Codes served by the Environment Service

			Error Codes returned by Environment Service

			Request block typedefs

			Evs API procedural definitions
*

*
	general defines
*
typedef unsigned char	Byte;
typedef unsigned int    Word;
typedef unsigned int	ErcType;
typedef char _far *     Pchar;
typedef unsigned _far *	Pword;


*
	Request Codes served by Environment Service
*
define lSpecialRq				0x740B		* terminationabortswap rq *
define lDeinstallRq			0x6626
define lVersionRq				0x6631
define lEnvironmentQueryRq		0x6632
define lEnvironmentSetRq		0x6633
define lEnvironmentStatusRq	0x6634
define lEnvironmentClearRq		0x6635
define lEnvironmentGetImageRq	0x6636
define lEnvironmentSetImageRq	0x6637


*
	Error Codes for Environment Service;
*
define ercInvalidVariable		857
define ercEnvSegmentFull		858
define ercNoSuchVariable		859
define ercInvalidEnvSpec		40136U
define ercImageOverFlow		40137U
define ercConfigFileError		40138U
define ercOSNotSupported		40139U
define ercEvsAlreadyInstalled	40140U
define ercInvalidServiceName	40111U


*
	Request block definitions for Environment Service API
*
typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pword	pUserNumRet;
	Word	cbUserNumRet;
} DeinstallRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbToken;
	Word	cbToken;
	Pchar	pbStringDef;
	Word	cbStringDef;
	Pchar	pbStringRet;
	Word	cbStringRetMax;
	Pword	pcbStringRet;
	Word	scbStringRet;
} EnvironQueryRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbToken;
	Word	cbToken;
	Pchar	pbString;
	Word	cbString;
} EnvironSetRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbEnvtSpec;
	Word	cbEnvtSpec;
	Pword	psMemRet;
	Word	ssMemRet;
	Pword	psMemFreeRet;
	Word	ssMemFreeRet;
	Pword	pnStringsRet;
	Word	snStringsRet;
	Pword	pwEnvtAttrRet;
	Word	swEnvtAttrRet;
} EnvironStatusRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbEnvtSpec;
	Word	cbEnvtSpec;
} EnvironClearRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbEnvtSpec;
	Word	cbEnvtSpec;
	Pchar	pbImage;
	Word	cbImageMax;
	Pword	pcbImage;
	Word	scbImage;
} EnvironImageRqType;

typedef struct
{
	Byte	sCntInfo;
	Byte	RtCode;
	Byte	nReqPbCb;
	Byte	nRespPbCb;
	Word	userNum;
	Word	exchResp;
	Word	ercRet;
	Word	rqCode;
	Byte	rgbUnused[6];
	Pchar	pbEnvtSpec;
	Word	cbEnvtSpec;
	Pword	pwVersionRet;
	Word	swVersionRet;
	Pword	pwRevisionRet;
	Word	swRevisionRet;
} EnvironVersionRqType;



*
	Environment Service API definitions.
*
ErcType _far _plm EnvironmentClear(Pchar pbEnvtSpec, Word cbEnvtSpec);

ErcType _far _plm EnvironmentQuery(Pchar pbToken, Word cbToken,
						Pchar pbStringDef, Word cbStringDef,
						Pchar pbStringRet, Word cbStringRetMax,
						Pchar pcbStringRet);

ErcType _far _plm EnvironmentSet(Pchar pbToken, Word cbToken,
						Pchar pbString, Word cbString);

ErcType _far _plm EnvironmentStatus(Pchar pbEnvtSpec, Word cbEnvtSpec,
						Pword psMemRet, Pword psMemFreeRet,
						Pword pnStringsRet, Pword pwEnvtAttrRet);

ErcType _far _plm EnvironmentVersion(Pchar pbEnvtSpec, Word cbEnvtSpec,
						Pword pwVersionRet, Pword pwRevisionRet);

ErcType _far _plm EnvironmentGetImage(Pchar pbEnvtSpec, Word cbEnvtSpec,
					Pchar pbImageRet, Word cbImageRetMax, Pword pcbImageRet);

ErcType _far _plm EnvironmentSetImage(Pchar pbEnvtSpec, Word cbEnvtSpec,
						Pchar pbImage, Word cbImageMax, Pword pcbImageRet);

ErcType _far _plm EnvironmentDeinstall(Pword pUserNumEvs);

ll(Pword pUserNumEvs);

