home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / internet / freedomc_112 / sourcecode / freeexplorer / freecheckmain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-10  |  2.6 KB  |  123 lines

  1. /* Main-Header File inserted by GenCodeC */
  2. /* Libraries */
  3. #include <libraries/mui.h>
  4. #include <libraries/gadtools.h> /* for BARLABEL in MenuItem */
  5.  
  6. /* Prototypes */
  7. #ifdef __SASC
  8. #include <clib/muimaster_protos.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/alib_protos.h>
  11. #include <clib/dos_protos.h>
  12. #else
  13. #include <proto/muimaster.h>
  14. #include <proto/exec.h>
  15. #include <proto/alib.h>
  16. #include <proto/dos.h>
  17. #endif
  18.  
  19. /*  Pragmas  */
  20. #include <pragmas/muimaster_pragmas.h>
  21.  
  22. /*  Ansi  */
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include <string.h>
  26.  
  27. /* Increase stack size */
  28. LONG __stack=8192;
  29. /* GenCodeC header end */
  30.  
  31. /* Include generated by GenCodeC */
  32. #include "FreeCheckGUI.h"
  33. #include "FreeCheckExtern.h"
  34. #include "Hook_Utility.h"
  35.  
  36. struct ObjApp * App; /* Object */
  37.  
  38. /* Declarations for libraries (inserted by GenCodeC) */
  39. struct Library * IntuitionBase;
  40. struct Library * MUIMasterBase;
  41. struct Library * LocaleBase;
  42.  
  43. /* Init() function */
  44. void init( void )
  45. {
  46.     if (!(IntuitionBase = OpenLibrary("intuition.library",37)))
  47.     {
  48.         printf("Can't Open Intuition Library\n");
  49.         exit(20);
  50.     }
  51.     if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  52.     {
  53.         printf("Can't Open MUIMaster Library\n");
  54.         CloseLibrary(IntuitionBase);
  55.         exit(20);
  56.     }
  57.     if (!(LocaleBase = OpenLibrary("locale.library",38)))
  58.     {
  59.         printf("Can't Open Locale Library\n");
  60.         printf("Built-in Language will be used !!!\n");
  61.     }
  62.     OpenAppCatalog(NULL,NULL);
  63. }
  64. /* GenCodeC init() end */
  65.  
  66. /* End() function */
  67. void end( void )
  68. {
  69.     CloseAppCatalog();
  70.     if (LocaleBase)
  71.         CloseLibrary(LocaleBase);
  72.     CloseLibrary(MUIMasterBase);
  73.     CloseLibrary(IntuitionBase);
  74.     exit(20);
  75. }
  76. /* GenCodeC end() end */
  77.  
  78. /* Main Function inserted by GenCodeC */
  79. int main(int argc,char **argv)
  80. {
  81.     BOOL    running = TRUE;
  82.     ULONG    signal;
  83.   
  84.   static struct Hook CarregaConfigHook;
  85.   static struct Hook CarregaUpdateHook;
  86.  
  87.   InstallHook(&CarregaConfigHook, CarregaConfig, NULL);
  88.   InstallHook(&CarregaUpdateHook, CarregaUpdate, NULL);
  89.  
  90.  
  91.     /* Program initialisation : generated by GenCodeC */
  92.     init();
  93.  
  94.     /* Create Object : generated by GenCodeC */
  95.     if (!(App = CreateApp()))
  96.     {
  97.         printf("Can't Create App\n");
  98.         end();
  99.     }
  100.  
  101.   DoMethod(App->App, MUIM_CallHook, &CarregaConfigHook);
  102.   DoMethod(App->App, MUIM_CallHook, &CarregaUpdateHook);
  103.  
  104.     while (running)
  105.     {
  106.         switch (DoMethod(App->App,MUIM_Application_Input,&signal))
  107.         {
  108.             case MUIV_Application_ReturnID_Quit:
  109.                 running = FALSE;
  110.                 break;
  111.  
  112.             /* Insert your code between the "case" statement and comment "end of case ..." */
  113.             /* End computing of IDCMP */
  114.  
  115.             default:
  116.                 break;
  117.         }
  118.         if (running && signal) Wait(signal);
  119.     }
  120.     DisposeApp(App);
  121.     end();
  122. }
  123.