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

  1. /**
  2. *
  3. * Name        qysettim -- Set the system time
  4. *
  5. * Synopsis    ercode = qysettim(hours,mins,secs,hunds);
  6. *
  7. *        int ercode      1 if the time is invalid, 0 otherwise
  8. *        int hours      The hour (0 - 23) to set
  9. *        int mins      The minutes (0 - 59) to set
  10. *        int secs      The seconds (0 - 59) to set
  11. *        int hunds      The hundredths of seconds to set.
  12. *
  13. * Description    QYSETTIM sets the system time to the values specified.
  14. *        If the format is invalid, the error code is returned
  15. *        with a value of 1; otherwise zero.  Note that only the
  16. *        ranges listed above are checked.
  17. *
  18. * Returns    ercode          1 if the time is invalid, 0 otherwise
  19. *
  20. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  21. *
  22. **/
  23.  
  24. #include <bquery.h>
  25.  
  26. int qysettim(hours,mins,secs,hunds)
  27. int hours,mins,secs,hunds;
  28. {
  29.     DOSREG dos_reg;
  30.  
  31.     dos_reg.ax = 0x2d00;
  32.     dos_reg.cx = utbyword(hours,mins);
  33.     dos_reg.dx = utbyword(secs,hunds);
  34.     dos(&dos_reg);
  35.  
  36.     if (utlobyte(dos_reg.ax))
  37.     return(1);
  38.  
  39.     return(0);
  40. }
  41.