/*	Cache.c - Caching of MGMT structures (read/write)
*
*******************************************************************************
* Copyright (c) 1996-97 Digi International Inc., All Rights Reserved          *
*                                                                             *
* This  software  contains  proprietary  and  confidential   information   of *
* Digi International  Inc.   By  accepting  transfer  of this copy, Recipient *
* agrees to retain this software in  confidence,  to  prevent  disclosure  to *
* others,  and  to make no  use of this software other than that for which it *
* was delivered.  This is an unpublished copyright work  Digi   International *
* Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is *
* strictly prohibited.                                                        *
*                                                                             *
* Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc. *
* Confidential  when   combined   with   the   aggregated  modules  for  this *
* product) OBJECT CODE ONLY SOURCE MATERIALS                                  *
*                                                                             *
* (C) COPYRIGHT Digi International Inc. 1996-97                               *
*                                                                             *
* All Rights Reserved                                                         *
*                                                                             *
* US   Government   Users   Restricted   Rights   -   Use,   duplication   or *
* disclosure  restricted by GSA ADP Schedule Contract with Digi International *
* Inc.                                                                        *
*                                                                             *
*******************************************************************************
*
*/

#if !defined(__CACHE_H__)
#define	__CACHE_H__

#include "dxbtypes.h"

typedef struct
{
	uint16 eType;
	uint32 iBoard;
	uint32 iGeneric1;
	uint32 iGeneric2;
}
CacheObject_t;

#if defined(VALIDATION_CODE)
typedef enum
{
	Validate_None,
	Validate_Enums,
	Validate_Ranges
}
ValidationType_t;

typedef struct
{
	ValidationType_t eType;
	UINT cItems;
	UINT *auValues;
}
Validate_t;
#endif

typedef struct
{
	size_t iOffset;
	size_t const cb;
	UINT const eAsnType;
#if defined(VALIDATION_CODE)
	Validate_t Validate;
#endif
}
CacheValue_t;

BOOL FlushWriteCache(void);
void ClearWriteCache(void);
BOOL ReadCachedObject(CacheObject_t const * const pco, CacheValue_t const * const pcv, AsnAny * const pValue, AsnInteger * const piaErrorStatus);
BOOL WriteCachedObject(CacheObject_t const * const pco, CacheValue_t const * const pcv, AsnAny * const pValue, AsnInteger * const piaErrorStatus);
void DeleteCache(void);

#endif
