Mail Archives: djgpp/1997/06/18/20:53:09
Goretec3 <goretec3 AT aol DOT com> wrote in article
<19970614031600 DOT XAA02194 AT ladder02 DOT news DOT aol DOT com>...
> What are interrupt calbacks. I saw one when I was looking through some
> allegro code.
A callback is a user defined function that you pass to another procedure.
With an interrupt callback, you pass a pointer to a function you've
written to
the interrupt handler. Then when the interrupt occurs, it can call your
function.
(This way you can use the same interrupt code without having to worry about
what function it will be calling, or even call mutiple functions.)
It's much easier to write and debug an interrupt handler once, and re-use
it for
whatever, than write separate interrupt handlers for every program.
Two other common applications of callbacks are windows like systems, and
process schedulers (i.e. multi-tasking systems).
- Raw text -