You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

time.h 909B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _TIME_H
  2. #define _TIME_H
  3. /** @file
  4. *
  5. * Date and time
  6. */
  7. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  8. #include <sys/time.h>
  9. #include <ipxe/time.h>
  10. /** Broken-down time */
  11. struct tm {
  12. /** Seconds [0,60] */
  13. int tm_sec;
  14. /** Minutes [0,59] */
  15. int tm_min;
  16. /** Hour [0,23] */
  17. int tm_hour;
  18. /** Day of month [1,31] */
  19. int tm_mday;
  20. /** Month of year [0,11] */
  21. int tm_mon;
  22. /** Years since 1900 */
  23. int tm_year;
  24. /** Day of week [0,6] (Sunday=0) */
  25. int tm_wday;
  26. /** Day of year [0,365] */
  27. int tm_yday;
  28. /** Daylight savings flag */
  29. int tm_isdst;
  30. };
  31. /**
  32. * Get current time in seconds since the Epoch
  33. *
  34. * @v t Time to fill in, or NULL
  35. * @ret time Current time
  36. */
  37. static inline __attribute__ (( always_inline )) time_t time ( time_t *t ) {
  38. time_t now;
  39. now = ( time_now() + time_offset );
  40. if ( t )
  41. *t = now;
  42. return now;
  43. }
  44. extern time_t mktime ( struct tm *tm );
  45. #endif /* _TIME_H */