home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / GETSWIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  2.1 KB  |  67 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - getswit.c
  3.  *
  4.  * function(s)
  5.  *        getswitchar - gets the MS-DOS switch character
  6.  *        setswitchar - sets the MS-DOS switch character
  7.  * note : these functions are undocumented in the Reference Guide
  8.  *-----------------------------------------------------------------------*/
  9.  
  10. /*[]------------------------------------------------------------[]*/
  11. /*|                                                              |*/
  12. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  13. /*|                                                              |*/
  14. /*|                                                              |*/
  15. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  16. /*|     All Rights Reserved.                                     |*/
  17. /*|                                                              |*/
  18. /*[]------------------------------------------------------------[]*/
  19.  
  20. #include <dos.h>
  21.  
  22. /*---------------------------------------------------------------------*
  23.  
  24. Name        getswitchar - gets the MS-DOS switch character
  25.  
  26. Usage        char getswitchar(void);
  27.  
  28. Prototype in    dos.h
  29.  
  30. Description    getswitchar returns the current MS-DOS switch character
  31.         value.
  32.  
  33. Return value    the current MS-DOS switch character value.
  34.  
  35. *---------------------------------------------------------------------*/
  36. int getswitchar(void)
  37. {
  38.     _AX = 0x3700;
  39.     geninterrupt(0x21);
  40.     return(_DL);
  41. }
  42.  
  43.  
  44. /*---------------------------------------------------------------------*
  45.  
  46. Name        setswitchar - sets the MS-DOS switch character
  47.  
  48. Usage        void setswitch(char byte);
  49.  
  50. Prototype in    dos.h
  51.  
  52. Description    setswitchar set the current MS-DOS switch character
  53.         value to the value of byte.  This call uses the
  54.         undocumented MS-DOS system call 0x37, and works for
  55.         MS-DOS versions 2.0 to 3.0 (Future versions of MS-DOS
  56.         may alter or discontinue this call.)
  57.  
  58. Return value    Nothing
  59.  
  60. *---------------------------------------------------------------------*/
  61. void setswitchar(char ch)
  62. {
  63.     _AX = 0x3701;
  64.     _DL = ch;
  65.     geninterrupt(0x21);
  66. }
  67.