|
FreeBSD kernel kern code
|
#include <sys/param.h>#include <sys/types.h>#include <sys/time.h>#include <sys/clock.h>
Go to the source code of this file.
Macros | |
| #define | DAY (24 * 60 * 60) /* Length of day in seconds */ |
| #define | YEAR 365 /* Length of normal year */ |
| #define | LYC (4 * YEAR + 1) /* Length of 4 year leap-year cycle */ |
| #define | T1980 (10 * 365 + 2) /* Days from 1970 to 1980 */ |
| #define | JAN 31 |
| #define | FEB (JAN + 28) |
| #define | MAR (FEB + 31) |
| #define | APR (MAR + 30) |
| #define | MAY (APR + 31) |
| #define | JUN (MAY + 30) |
| #define | JUL (JUN + 31) |
| #define | AUG (JUL + 31) |
| #define | SEP (AUG + 30) |
| #define | OCT (SEP + 31) |
| #define | NOV (OCT + 30) |
| #define | DEC (NOV + 31) |
| #define | ENC(y, m) (((y) << 9) | ((m) << 5)) |
| #define | DCOD(m, y, l) ((m) + YEAR * (y) + (l)) |
Functions | |
| void | timespec2fattime (struct timespec *tsp, int utc, uint16_t *ddp, uint16_t *dtp, uint8_t *dhp) |
| void | fattime2timespec (unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp) |
Variables | |
| struct { | |
| uint16_t days | |
| uint16_t coded | |
| } | mtab [48] |
| static const uint16_t | daytab [64] |
| #define APR (MAR + 30) |
Definition at line 87 of file subr_fattime.c.
| #define AUG (JUL + 31) |
Definition at line 91 of file subr_fattime.c.
| #define DAY (24 * 60 * 60) /* Length of day in seconds */ |
Definition at line 78 of file subr_fattime.c.
Referenced by fattime2timespec(), and timespec2fattime().
| #define DCOD | ( | m, | |
| y, | |||
| l | |||
| ) | ((m) + YEAR * (y) + (l)) |
Definition at line 197 of file subr_fattime.c.
| #define DEC (NOV + 31) |
Definition at line 95 of file subr_fattime.c.
| #define ENC | ( | y, | |
| m | |||
| ) | (((y) << 9) | ((m) << 5)) |
Definition at line 99 of file subr_fattime.c.
| #define FEB (JAN + 28) |
Definition at line 85 of file subr_fattime.c.
Referenced by fattime2timespec(), and timespec2fattime().
| #define JAN 31 |
Definition at line 84 of file subr_fattime.c.
| #define JUL (JUN + 31) |
Definition at line 90 of file subr_fattime.c.
| #define JUN (MAY + 30) |
Definition at line 89 of file subr_fattime.c.
| #define LYC (4 * YEAR + 1) /* Length of 4 year leap-year cycle */ |
Definition at line 80 of file subr_fattime.c.
Referenced by fattime2timespec(), and timespec2fattime().
| #define MAR (FEB + 31) |
Definition at line 86 of file subr_fattime.c.
| #define MAY (APR + 31) |
Definition at line 88 of file subr_fattime.c.
| #define NOV (OCT + 30) |
Definition at line 94 of file subr_fattime.c.
| #define OCT (SEP + 31) |
Definition at line 93 of file subr_fattime.c.
| #define SEP (AUG + 30) |
Definition at line 92 of file subr_fattime.c.
| #define T1980 (10 * 365 + 2) /* Days from 1970 to 1980 */ |
Definition at line 81 of file subr_fattime.c.
Referenced by fattime2timespec(), and timespec2fattime().
| #define YEAR 365 /* Length of normal year */ |
Definition at line 79 of file subr_fattime.c.
| void fattime2timespec | ( | unsigned | dd, |
| unsigned | dt, | ||
| unsigned | dh, | ||
| int | utc, | ||
| struct timespec * | tsp | ||
| ) |
Definition at line 218 of file subr_fattime.c.
References DAY, daytab, FEB, LYC, T1980, and utc_offset().

| void timespec2fattime | ( | struct timespec * | tsp, |
| int | utc, | ||
| uint16_t * | ddp, | ||
| uint16_t * | dtp, | ||
| uint8_t * | dhp | ||
| ) |
Definition at line 138 of file subr_fattime.c.
References DAY, days, FEB, LYC, mtab, T1980, and utc_offset().

| uint16_t coded |
Definition at line 103 of file subr_fattime.c.
| uint16_t days |
Definition at line 102 of file subr_fattime.c.
Referenced by clock_ct_to_ts(), clock_ts_to_ct(), and timespec2fattime().
|
static |
Definition at line 198 of file subr_fattime.c.
Referenced by fattime2timespec().
| const { ... } mtab[48] |
Referenced by timespec2fattime().