home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name kbextend -- Select extended or normal BIOS keyboard
- * services for use by KBGETKEY and KBREADY.
- *
- * Synopsis result = kbextend(new_state);
- *
- * int result KB_ERROR if new_state is unavailable,
- * otherwise former state:
- * KB_USE_EXTEND or KB_USE_NORMAL.
- * int new_state KB_USE_EXTEND or KB_NORMAL.
- *
- * Description This function directs KBGETKEY and KBREADY to use
- * extended or traditional BIOS keyboard services. If the
- * operation is completed successfully, the former
- * selection is returned.
- *
- * An error occurs if KB_USE_EXTEND is selected and the
- * extended BIOS keyboard services are not available.
- *
- * Returns result KB_ERROR if new_state is unavailable,
- * otherwise the former value of b_kbusex.
- * b_kbusex new_state (unless failure).
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
-
- #include <bkeybrd.h>
-
- int kbextend(new_state)
- int new_state;
- {
- int result;
-
- if (new_state == b_kbusex) /* If nothing to do, */
- result = b_kbusex; /* just return setting. */
-
- else if (new_state == KB_USE_NORMAL) /* If requesting traditional */
- { /* services, */
- result = b_kbusex; /* just return former state */
- b_kbusex = new_state; /* and set new state. */
- }
- else if (new_state == KB_USE_EXTEND) /* If requesting extended */
- { /* services, */
- if (kbequip() == KB_EXTENDED) /* first check for presence. */
- { /* Extended services are */
- result = b_kbusex; /* available. */
- b_kbusex = new_state;
- }
- else
- result = KB_ERROR; /* Error: extended services */
- /* are not available. */
- }
- else
- result = KB_ERROR; /* Unknown request. */
-
- return result; /* Return former value or */
- /* error flag. */
- }