home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / compat / d_setdat.txh < prev    next >
Encoding:
Text File  |  1995-10-09  |  938 b   |  44 lines

  1. @node _dos_setdate, dos
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <dos.h>
  6.  
  7. unsigned int _dos_setdate(struct dosdate_t *date);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function sets the current date. The @var{dosdate_t} structure
  13. is as follows:
  14.  
  15. @example
  16. struct dosdate_t @{
  17.   unsigned char  day;       /* 1-31          */
  18.   unsigned char  month;     /* 1-12          */
  19.   unsigned short year;      /* 1980-2099     */
  20.   unsigned char  dayofweek; /* 0-6, 0=Sunday */
  21. @};
  22. @end example
  23.  
  24. @var{dayofweek} field has no effect at this function call.
  25.  
  26. @xref{_dos_getdate}. @xref{_dos_gettime}. @xref{_dos_settime}.
  27.  
  28. @subheading Return Value
  29.  
  30. Returns 0 if successful and non-zero on error (and sets @var{errno}=EINVAL).
  31.  
  32. @subheading Example
  33.  
  34. @example
  35. struct dosdate_t date;
  36.  
  37. date->year  = 1999;
  38. date->month = 12;
  39. date->day   = 31;
  40. if ( !_dos_setdate(&date) )
  41.   puts("It was a valid date.");
  42. @end example
  43.  
  44.