home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / compat / d_gettim.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  565 b   |  26 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. /*
  3.  * D_GETTIM.C.
  4.  *
  5.  * Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
  6.  *
  7.  * This file is distributed WITHOUT ANY WARRANTY; without even the implied
  8.  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9.  *
  10.  */
  11.  
  12. #include <dpmi.h>
  13. #include <dos.h>
  14.  
  15. void _dos_gettime(struct _dostime_t *time)
  16. {
  17.   __dpmi_regs r;
  18.  
  19.   r.h.ah = 0x2C;
  20.   __dpmi_int(0x21, &r);
  21.   time->hour    = r.h.ch;
  22.   time->minute  = r.h.cl;
  23.   time->second  = r.h.dh;
  24.   time->hsecond = r.h.dl;
  25. }
  26.