/*
 *	Name:				omnilib.h
 *
 * Description:	Include file for omnilib system.
 *
 * Copyright:		1992 by David Jones.
 *
 * Distribution:
 *		This program is free software; you can redistribute it and/or modify
 *		it under the terms of the GNU General Public License as published by
 *		the Free Software Foundation; either version 2 of the License, or
 *		(at your option) any later version.
 *
 *		This program is distributed in the hope that it will be useful,
 *		but WITHOUT ANY WARRANTY; without even the implied warranty of
 *		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *		GNU General Public License for more details.
 *
 *		You should have received a copy of the GNU General Public License
 *		along with this program; if not, write to:
 *
 *				The Free Software Foundation		David Jones
 *				675 Mass Ave							6730 Tooney Drive
 *				Cambridge, MA							Orleans, Ontario
 *				02139										K1C 6R4
 *				USA										Canada
 *
 *	Usenet:	gnu@prep.ai.mit.edu					dej@qpoint.ocunix.on.ca
 *	Fidonet:												1:163/109.8
 *
 *		$Log: $
 *
 */

#include <exec/types.h>
#include <exec/libraries.h>
#include <exec/resident.h>
#include <exec/semaphores.h>
#include <dos/dos.h>

/*
 *		struct OmniBase is the structure used by Omnilib for its internal
 *		use.  You are permitted to add stuff to the end of it, but do not
 *		change it.
 */
struct OmniBase {
	struct Library ml_LibNode;
	BPTR ml_SegList;
	BYTE ml_Flags;
	BYTE ml_Pad;
	LONG ml_A4;
	struct SignalSemaphore ml_Lock;
};

/*
 *		struct InitTab is the template for the init table that your C
 *		code must provide.
 */
struct InitTab {
	ULONG it_DataSize;
	APTR it_FuncTable;
	APTR it_DataTable;
	APTR it_InitFunc;
};

/*
 *		Variables that you may want to access.
 */

extern UBYTE __far Version;
extern UBYTE __far Revision;
extern void *__far FuncTable[];
extern struct Resident __far RomTag;
extern char *__far LibName;
extern char *__far LibID;
extern char *__far VerString;

/*
 *		Prototypes for the functions provided by Omnilib.
 *		The LIB* functions are expected to be overridden by functions
 *		of your own design; the prototypes are here to check your interface.
 */

struct Library *LIBInit(void);	/* Low-level */
struct Library *LibInit(void);	/* Called from LIBInit */
struct Library *LibOpen(void);
void LibClose(void);
ULONG LibExpunge(void);
