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

  1. /**
  2. *
  3. * Name        qyrettim -- Return the system time
  4. *
  5. * Synopsis    qyrettim(phours,pmins,psecs,phunds);
  6. *
  7. *        int ret       The returned value is always 0.
  8. *        int *phours      The hour (0 - 23)
  9. *        int *pmins      The minutes (0 - 59)
  10. *        int *psecs      The seconds (0 - 59)
  11. *        int *phunds      The hundredths of seconds (0 - 99)
  12. *
  13. * Description    The system time is returned in the variables specified.
  14. *        The value 0 is always returned as the functional value.
  15. *
  16. *        Use STSTIME to return the system time as a character
  17. *        string as well as as numbers.
  18. *
  19. * Returns    ret          The returned value is always 0.
  20. *        *phours       The hour (0 - 23)
  21. *        *pmins          The minutes (0 - 59)
  22. *        *psecs          The seconds (0 - 59)
  23. *        *phunds       The hundredths of seconds (0 - 99)
  24. *
  25. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  26. *
  27. **/
  28.  
  29. #include <bquery.h>
  30.  
  31. int qyrettim(phours,pmins,psecs,phunds)
  32. int *phours,*pmins,*psecs,*phunds;
  33. {
  34.     DOSREG dos_reg;
  35.  
  36.     dos_reg.ax = 0x2c00;          /* DOS function 0x2C          */
  37.     dos(&dos_reg);
  38.     *phours = uthibyte(dos_reg.cx);
  39.     *pmins  = utlobyte(dos_reg.cx);
  40.     *psecs  = uthibyte(dos_reg.dx);
  41.     *phunds = utlobyte(dos_reg.dx);
  42.  
  43.     return(0);
  44. }
  45.