From: "Gil Myers" Subject: Re: Callbacks Newsgroups: comp.os.msdos.djgpp References: <19970614031600 DOT XAA02194 AT ladder02 DOT news DOT aol DOT com> Organization: The Unknown Programmers Message-ID: <01bc79c3$7f82e680$fd8033cf@pentium> NNTP-Posting-Host: 207.51.128.253 Date: 15 Jun 97 19:25:30 GMT Lines: 21 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Goretec3 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).