home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC1.ZIP / GETSWIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.8 KB  |  65 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.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1987, 1992 by Borland International
  14.  *      All Rights Reserved.
  15.  *
  16.  */
  17.  
  18.  
  19. #include <dos.h>
  20.  
  21. /*---------------------------------------------------------------------*
  22.  
  23. Name            getswitchar - gets the MS-DOS switch character
  24.  
  25. Usage           char getswitchar(void);
  26.  
  27. Prototype in    dos.h
  28.  
  29. Description     getswitchar returns the current MS-DOS switch character
  30.                 value.
  31.  
  32. Return value    the current MS-DOS switch character value.
  33.  
  34. *---------------------------------------------------------------------*/
  35. int getswitchar(void)
  36. {
  37.         _AX = 0x3700;
  38.         geninterrupt(0x21);
  39.         return(_DL);
  40. }
  41.  
  42. /*---------------------------------------------------------------------*
  43.  
  44. Name            setswitchar - sets the MS-DOS switch character
  45.  
  46. Usage           void setswitch(char byte);
  47.  
  48. Prototype in    dos.h
  49.  
  50. Description     setswitchar set the current MS-DOS switch character
  51.                 value to the value of byte.  This call uses the
  52.                 undocumented MS-DOS system call 0x37, and works for
  53.                 MS-DOS versions 2.0 to 3.0 (Future versions of MS-DOS
  54.                 may alter or discontinue this call.)
  55.  
  56. Return value    Nothing
  57.  
  58. *---------------------------------------------------------------------*/
  59. void setswitchar(char ch)
  60. {
  61.         _AX = 0x3701;
  62.         _DL = ch;
  63.         geninterrupt(0x21);
  64. }
  65.