#ifndef	MBASE_H
#define	MBASE_H

#include <../source/TAL/objbase.h>
#include <../source/vfs/iobase.h>

typedef struct io_section_s
{
	ioport_base_t	vtbl;
	vsize_t			size, ptr;
	u8_t			*base;
	char			section_name[_MAX_PATH];
}	io_section_t, *io_section_p;

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/*
	 * One of the most useful (and widely used) routines.
	 *
	 * Creates 'private named section' object and returns handle for use
	 * with fileXXXX calls. Handle mast be closed with fileClose().
	 *
	 * Note: block of data not duplicated (mmap_base must be valid
	 * until handle is closed).
	 */
	io_section_p V_CALL	ioAllocNamedSection(vsize_t
		real_port_size,	/* amount of bytes to allocate */
		void *mmap_base,
		vsize_t mmap_size,
		char *section_name);
	/*
	 * Same as above, uses empty string as name.
	 */
	io_section_p V_CALL	ioAllocSection(vsize_t
		real_port_size,	/* amount of bytes to allocate */
		void *mmap_base,
		vsize_t mmap_size);
	/*
	 * Same as ioAllocNamedSection(), but duplicates memory block.
	 */
	io_section_p V_CALL	ioStoreInNamedSection(void_p buf,vsize_t len,char *section_name);
#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* MBASE_H */
