home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d126
/
suplib.lha
/
Suplib
/
openlibs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-01-02
|
1KB
|
63 lines
#include "xmisc.h"
long GfxBase;
long IntuitionBase;
long ExpansionBase;
long DiskfontBase;
long TranslatorBase;
long IconBase;
long MathBase;
long MathTransBase;
long MathIeeeDoubBasBase;
long MathIeeeSingBasBase;
long LayersBase;
long ClistBase;
long PotgoBase;
long TimerBase;
long xfiller15;
long xfiller16;
struct OLI strvar[] = {
"graphics", &GfxBase,
"intuition", &IntuitionBase,
"expansion", &ExpansionBase,
"diskfont", &DiskfontBase,
"translator", &TranslatorBase,
"icon", &IconBase,
"mathffp", &MathBase,
"mathtrans", &MathTransBase,
"mathieeedoubbas", &MathIeeeDoubBasBase,
"mathieeesingbas", &MathIeeeSingBasBase,
"layers", &LayersBase,
"clist", &ClistBase,
"potgo", &PotgoBase,
"timer", &TimerBase,
"x15", &xfiller15,
"x16", &xfiller16,
0L, 0L /* end marker for future compatibility */
};
openlibs(mask)
unsigned short mask;
{
register struct OLI *sv;
char buf[64];
long copymask = mask;
for (sv = &strvar[0]; mask && sv->name; mask >>= 1, ++sv) {
if (mask & 1) {
strcpy(buf, sv->name);
strcat(buf, ".library");
if (*sv->var == 0 && (*sv->var = OpenLibrary(buf, 0)) == 0)
goto fail;
}
}
return (1);
fail:
closelibs(copymask);
return (0);
}