| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef _RTC_H
- #define _RTC_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*
- * The struct used to pass data via the following ioctl. Similar to the
- * struct tm in <time.h>, but it needs to be here so that the kernel
- * source is self contained, allowing cross-compiles, etc. etc.
- */
- typedef struct rtc_time {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- } SystemTime_t;
- static inline int is_leap_year(unsigned int year)
- {
- return (!(year % 4) && (year % 100)) || !(year % 400);
- }
- int iGetLocalTime(SystemTime_t *tm);
- int iSetLocalTime(SystemTime_t *tm);
- #ifdef __cplusplus
- }
- #endif
- #endif
|