home *** CD-ROM | disk | FTP | other *** search
- /*
- ** 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 );
- }
-
-