home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 109
/
EnigmaAmiga109CD.iso
/
software
/
utilities
/
jpeg-dt35
/
source
/
libbase.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-22
|
1KB
|
68 lines
#include <pragma/exec_lib.h>
#include <pragma/intuition_lib.h>
#include <dos/dos.h>
#include <exec/resident.h>
#include "class.h"
struct ClassBase:Library
{
BPTR sb_SegList;
IClass *cb_Class;
};
#pragma libbase ClassBase
extern "C"
{
IClass *ObtainClass(register __a6 ClassBase *cb);
}
extern "C" void abortLibInit();
extern APTR Dispatcher;
char LibNameString[]="jpeg.datatype";
char LibVersionString[]="$VER:jpeg.datatype 46.1 (22.01.00) © 1999-2000 by Achim Stegemann\n";
Library *JpegBase;
Library *SuperClassBase;
Library *CyberGfxBase;
static IClass *InitClass(register __a6 ClassBase *cb)
{
IClass *cl;
if(cl=MakeClass(LibNameString,"picture.datatype",0,sizeof(Data),0))
{
cl->h_Entry=&Dispatcher;
cl->cl_UserData=ULONG(cb);
AddClass(cl);
}
return cl;
}
extern "C" void INIT_7_LibInit(register __a6 ClassBase *cb)
{
if(SuperClassBase=OpenLibrary("datatypes/picture.datatype",44))
{
if(JpegBase=OpenLibrary("jpeg.library",5))
{
CyberGfxBase=OpenLibrary("cybergraphics.library",40);
if(cb->cb_Class=cb->cb_Class=InitClass(cb)) return;
}
}
abortLibInit();
}
extern "C" void EXIT_7_LibInit(register __a6 ClassBase *cb)
{
if(cb->cb_Class) FreeClass(cb->cb_Class);
CloseLibrary(CyberGfxBase);
CloseLibrary(JpegBase);
CloseLibrary(SuperClassBase);
}
extern "C" IClass *ObtainClass(register __a6 ClassBase *cb)
{
return cb->cb_Class;
}