#if !defined(DMSMGR)
#define DMSMGR

#if !defined(VMSMGR)
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <string.h>
#include <alloc.h>
#endif

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

class dmsmgr	{
	FILE *fp;
	Boolean installed;
	unsigned char errcode;
protected:
	unsigned long thesize;
	unsigned long numelements;
public:
	dmsmgr(unsigned long the_size, unsigned long num_elements = 1);
	~dmsmgr();
	void alloc_dmb();
	inline operator void*() { return (void *)installed; }
	inline int operator!() { return !installed; }
	inline int is_installed() { return installed; }
	inline unsigned char readerr() { return errcode; }
	inline void clearerr() { errcode = 0; }
	char* dmserr();
	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

	
