#if !defined(VMSMGR)
#define VMSMGR

#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <string.h>
#include <alloc.h>
#include "xmsmgr.hpp"
#include "dmsmgr.hpp"

typedef int Boolean;
#define FALSE	0
#define TRUE	1

class vmsmgr : public xmsmgr, public dmsmgr	{
	Boolean memory;
	Boolean installed;
	unsigned XMSindex;
public:
	vmsmgr(unsigned long the_size, unsigned long num_elements = 1);
	~vmsmgr() { }
	inline operator void*() { return (void *)installed; }
	inline int operator!() { return !installed; }
	inline int is_installed() { return installed; }
	inline unsigned char readerr() {
		return ((memory == TRUE) ? xmsmgr::readerr() : dmsmgr::readerr()); }
	inline void clearerr() {
		xmsmgr::clearerr(); dmsmgr::clearerr(); }
	char* vmserr();
	Boolean inmemory() { return memory; }
	unsigned long size() { return thesize; }
	unsigned long elements() { return numelements; }
	Boolean stow( char far* send, size_t listnum );
	Boolean fetch( char far* receive, size_t listnum );
};

#endif
