/*

Author: Neil Cafferkey
Copyright (C) 2002 Neil Cafferkey

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, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.

*/

#ifndef DATATYPE_H
#define DATATYPE_H


#include <exec/types.h>
#include <exec/libraries.h>
#include <intuition/classes.h>

#ifndef UPINT
typedef ULONG UPINT;
typedef LONG PINT;
#endif


struct GemImgBase
{
   struct Library library;
   APTR seg_list;
   struct IClass *class;
   struct ExecBase *sys_base;
   struct Library *superclass_base;
   struct IntuitionBase *intuition_base;
   struct UtilityBase *utility_base;
   struct Library *datatypes_base;
   struct GfxBase *graphics_base;
   struct DosLibrary *dos_base;
};


#define BEWord(P) ((*(P)<<8)+*((P)+1))


GLOBAL const TEXT datatype_name[];


#define SysBase (base->sys_base)
#define IntuitionBase (base->intuition_base)
#define UtilityBase (base->utility_base)
#define DataTypesBase (base->datatypes_base)
#define GfxBase (base->graphics_base)
#define DOSBase (base->dos_base)

#define BASE_REG "a6"

/*register APTR base asm(BASE_REG);*/


#ifdef AMIGAOS
#define REG(A) __asm(A)
#else
#define REG(A)
#endif


#endif
