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

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. /*
  3.  * D_GETDAT.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 <errno.h>
  14. #include <dos.h>
  15.  
  16. void _dos_getdate(struct _dosdate_t *date)
  17. {
  18.   __dpmi_regs r;
  19.  
  20.   r.h.ah = 0x2A;
  21.   __dpmi_int(0x21, &r);
  22.   date->year      = (unsigned short)r.x.cx;
  23.   date->month     = r.h.dh;
  24.   date->day       = r.h.dl;
  25.   date->dayofweek = r.h.al;
  26. }
  27.