home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1997 #3
/
amigamamagazinepolishissue03-1
/
ma_1995
/
05
/
ami044a.txt
< prev
next >
Wrap
Text File
|
1997-04-07
|
2KB
|
111 lines
/* Listing #1 */
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/graphics.h>
#include <proto/mathtrans.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct Library *MathTransBase;
struct Library *lib;
/* Próba otwarcia "intuition.library" (z ROMu) */
IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 0);
if (IntuitionBase)
printf("Udaîo sië otworzyê bibliotekë Intuition z ROMu.\n");
/* Spróbujmy otworzyê kolejnâ. Uwaga: skrót myôlowy rodem z C */
if (GfxBase=(struct GfxBase*)OpenLibrary("graphics.library", 0))
printf("Z ubolewaniem stwierdzam, ûe udaîo siëÚotworzyê bibliotekë graficznâ.\n");
/* Spróbujmy z jakâô bibliotekâ dyskowâ */
if (MathTransBase=OpenLibrary("mathtrans.library", 0))
printf("Udaîo sië otworzyê coô z dysku. To coô to \"mathtrans.library\".\n");
/* Spróbujmy otworzyê coô, czego po prostu nie ma */
if (lib=OpenLibrary("nieznana_biblioteka.library", 0))
printf("Takiej biblioteki w ûyciu byômy sië nie spodziewali.\n");
/* Nie wiemy co to i skâd, ale zamknâê trzeba bëdzie */
else
printf("Skoro takiej biblioteki nie ma, to nic dziwnego, ûe sië nie udaîo jej otworzyê.\n");
/* Jeôli udaîo sië "coô" otworzyê, to równieû naleûaîo by to "coô" zamknâê */
if (IntuitionBase)
CloseLibrary((struct Library*)IntuitionBase);
if (GfxBase)
CloseLibrary((struct Library*)GfxBase);
if (MathTransBase)
CloseLibrary(MathTransBase);
if (lib)
/* Co prawda takiej biblioteki nie znamy, ale skoro jest, to równieû naleûy jâ zamknâê */
CloseLibrary(lib);
return 0;
}