home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / QYVERIFY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.3 KB  |  54 lines

  1. /**
  2. *
  3. * Name        qyverify -- Set or return DOS VERIFY state.
  4. *
  5. * Synopsis    old_state = qyverify(set,new_state);
  6. *
  7. *        int old_state      The previous VERIFY state:
  8. *                  VER_ON  (1) if checking is enabled,
  9. *                  VER_OFF (0) if not.
  10. *        int set       VER_SET (1) to set the state,
  11. *                  VER_GET (0) to return it.
  12. *        int new_state      If "set" is nonzero, this is the new
  13. *                  VERIFY state:
  14. *                  VER_ON  (1) to enable checking,
  15. *                  VER_OFF (0) to disable it.
  16. *
  17. * Description    This function returns the DOS VERIFY state and
  18. *        optionally sets that state.
  19. *
  20. *        If the VERIFY state is "on", DOS will verify the success
  21. *        of each disk write as it is performed.
  22. *
  23. * Returns    old_state      The previous VERIFY state:
  24. *                  VER_ON  (1) if checking is enabled,
  25. *                  VER_OFF (0) if not.
  26. *
  27. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  28. *
  29. **/
  30.  
  31. #include <bquery.h>
  32.  
  33. int qyverify(set,new_state)
  34. int set,new_state;
  35. {
  36.     DOSREG dos_reg;
  37.     int    old_state;
  38.  
  39.     dos_reg.ax = 0x5400;          /* DOS function 0x54, return    */
  40.                       /* VERIFY state.              */
  41.     dos(&dos_reg);
  42.     old_state = utlobyte(dos_reg.ax);
  43.  
  44.     if (set != VER_GET)
  45.     {
  46.                       /* DOS function 0x33, set       */
  47.                       /* VERIFY state.              */
  48.     dos_reg.ax = utbyword(0x2e,new_state);
  49.     dos(&dos_reg);
  50.     }
  51.  
  52.     return(old_state);
  53. }
  54.