home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / gcc / libnixV0_8.lha / gnu / libnix-sources.lha / sources / amiga / misc / AddTOF.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  685 b   |  33 lines

  1. #include <exec/interrupts.h>
  2. #include <hardware/intbits.h>
  3. #include <graphics/graphint.h>
  4. #include <clib/alib_protos.h>
  5. #ifdef __GNUC__
  6. #include <inline/exec.h>
  7. #include <inline/graphics.h>
  8. #else
  9. #include <clib/exec_protos.h>
  10. #include <clib/graphics_protos.h>
  11. #endif
  12.  
  13. int stub()
  14. {
  15.   register struct Isrvstr *intr asm("a1");
  16.  
  17.   (*intr->ccode)(intr->Carg); return 0;
  18. }
  19.  
  20. void AddTOF(struct Isrvstr *intr, long (*code)(), long arg)
  21. {
  22.    intr->Iptr=intr;
  23.    intr->code=(int (*)())stub;
  24.    intr->ccode=(int (*)())code;
  25.    intr->Carg=(int)arg;
  26.    AddIntServer(INTB_VERTB,(struct Interrupt *)intr);
  27. }
  28.  
  29. void RemTOF(struct Isrvstr *intr)
  30. {
  31.   RemIntServer(INTB_VERTB,(struct Interrupt *)intr);
  32. }
  33.