home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
594b.lha
/
Precognition_rel1
/
std_main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-12
|
1KB
|
57 lines
/*
** File "std_main.c"
**
** Example of a 'standard' main program for Precognition.
**
*/
#include <stdio.h>
#include <exec/types.h>
#include <graphics/gfxbase.h>
#include <intuition/intuitionbase.h>
#include "precognition.h"
/* declare lib structures */
struct IntuitionBase *IntuitionBase = NULL;
struct GfxBase *GfxBase = NULL;
void main( int argc, char **argv )
{
void GracefulExit( short ExitStatus );
void do_window( void );
/* open intuition library */
IntuitionBase = (struct IntuitionBase *)
OpenLibrary ("intuition.library", 0 );
if (IntuitionBase == NULL)
{
printf("couldn't open intuition.library\n");
GracefulExit( FALSE );
}
GfxBase = (struct GfxBase *)
OpenLibrary("graphics.library", 0 );
if (GfxBase == NULL)
{
printf("couldn't open graphics.library\n");
GracefulExit( FALSE );
}
do_window(); /* *** Change this to call your window routine! *** */
GracefulExit( TRUE );
}
void GracefulExit( short ExitStatus )
{
/* Close all libraries. */
if (GfxBase) CloseLibrary (GfxBase);
if (IntuitionBase) CloseLibrary (IntuitionBase);
exit( ExitStatus );
}