home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 640a.lha / FLUSHLibrary_v1.1 / C-Support / FlushTest / FlushTest.c next >
C/C++ Source or Header  |  1992-04-10  |  769b  |  42 lines

  1. /* Small flush test. */
  2.  
  3. #include <exec/types.h>
  4. #include <exec/libraries.h>
  5. #include <proto/exec.h>
  6. #include <proto/dos.h>
  7. #include "flush.h"
  8.  
  9. #define DATA 0xDEADBEEF
  10.  
  11. struct Library *FlushBase;
  12.  
  13. void __saveds __asm flushHandler(register __d0 ULONG data)
  14. {
  15.    printf("Handler called with data $%08lx.\n",data);
  16. }
  17.  
  18. void main(void)
  19. {
  20.    ULONG id;
  21.  
  22.    if (FlushBase = OpenLibrary("flush.library",0))
  23.    {
  24.       if (id = FlushEnableAnnounce(MODE_HANDLER,flushHandler,DATA,0))
  25.       {
  26.          printf("Flushing...\n");
  27.  
  28.          FlushDo();
  29.  
  30.          printf("I did it...\n");
  31.  
  32.          FlushDisableAnnounce(id);
  33.       }
  34.       else
  35.          printf("FlushEnableAnnounce() failed!\n");
  36.  
  37.       CloseLibrary(FlushBase);
  38.    }
  39.    else
  40.       printf("flush.library not found!\n");
  41. }
  42.