home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name qyctlbrk -- Set or return state of CTRL-BREAK checking.
- *
- * Synopsis old_state = qyctlbrk(set,new_state);
- *
- * int old_state The previous CTRL-BREAK state:
- * CBRK_ON (1) if checking is enabled,
- * CBRK_OFF (0) if not.
- * int set CBRK_SET (1) to set the state,
- * CBRK_GET (0) to return it.
- * int new_state If "set" is nonzero, this is the new
- * CTRL-BREAK state:
- * CBRK_ON (1) to enable checking,
- * CBRK_OFF (0) to disable it.
- *
- * Description This function returns the state of DOS CTRL-BREAK
- * checking and optionally sets that state.
- *
- * If the state is "off" (i.e., checking is disabled), then
- * DOS will check for a CTRL-BREAK only when I/O is
- * performed to the standard input, output, print, or
- * auxiliary devices. If the state is "on", then DOS will
- * check for CTRL-BREAK whenever a DOS function is called.
- *
- * Returns old_state The previous CTRL-BREAK state:
- * CBRK_ON (1) if checking is enabled,
- * CBRK_OFF (0) if not.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bquery.h>
-
- int qyctlbrk(set,new_state)
- int set,new_state;
- {
- DOSREG dos_reg;
- int old_state;
-
- dos_reg.ax = 0x3300; /* DOS function 0x33, return */
- /* CTRL-BREAK state. */
- dos(&dos_reg);
- old_state = utlobyte(dos_reg.dx);
-
- if (set != CBRK_GET)
- {
- dos_reg.ax = 0x3301; /* DOS function 0x33, set */
- /* CTRL-BREAK state. */
- dos_reg.dx = new_state;
- dos(&dos_reg);
- }
-
- return(old_state);
- }