Borland C++ reference

ctrlbrk

raw OCR

Sets control-break handler.

Defined in header <dos.h>

Syntax

#include <dos.h>
void ctrlbrk(int {*handler){Yo\d));

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

ctrlbrk sets a new control-break handler function pointed to by handler. The interrupt vector 0x23 is modified to call the named function.

ctrlbrk establishes a DOS interrupt handler that calls the named function; the named function is not called directly.

The handler function can perform any number of operations and system calls. The handler does not have to return; it can use longjmp to return to an arbitrary point in the program. The handler function returns 0 to abort the current program; any other value causes the program to resume execution.

Return value

ctrlbrk returns nothing.

See also

Example

#include <stdio.h>
#include <dos.h>

int c_break(void)

   printf ("Control-Break pressed. Program aborting  ...\n");
   return (0);
}
void main (void)
{
   ctrlbrk (c_break);
   for(;;)
      printf ("Looping... Press <Ctrl-Break> to quit:\n");

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.