home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
164.lha
/
ARexx
/
WB_ARexx_v1.1
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-04-28
|
1KB
|
61 lines
/** main.c
*
* Copyright 1988, W.G.J. Langeveld
* All Rights Reserved
* Freely Distributable
*
* This just sets up the libraries and calls wbrexx().
*
**/
#include "exec/exec.h"
#include "libraries/dos.h"
#include "libraries/dosextens.h"
#include "intuition/intuition.h"
#include "stdio.h"
#include "functions.h"
struct IntuitionBase *IntuitionBase = 0L;
struct GfxBase *GfxBase = 0L;
struct IconBase *IconBase = 0L;
main(argc, argv)
int argc;
char **argv;
{
char **WB_msg;
IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 0L);
if (IntuitionBase == NULL) cleanup("Can't open intuition library");
GfxBase = (struct GfxBase *) OpenLibrary("graphics.library", 0L);
if (GfxBase == NULL) cleanup("Can't open graphics library");
IconBase = (struct IconBase *) OpenLibrary("icon.library", 0L);
if (IconBase == NULL) cleanup("Can't open icon library");
if (argc == 0)
WB_msg = argv;
else
cleanup("Use only from Workbench");
WBRexx(WB_msg);
cleanup(NULL);
}
cleanup(error)
char *error;
{
struct Process *proc;
if (IntuitionBase != NULL) CloseLibrary(IntuitionBase);
if (GfxBase != NULL) CloseLibrary(GfxBase);
if (IconBase != NULL) CloseLibrary(IconBase);
proc = (struct Process *) FindTask(0L);
if (error) AReqBool(proc->pr_WindowPtr, error, NULL, " Okay ");
exit(0);
}