25 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
38 return q4 - q100 + q400;
72 while (day_off < 0 || day_off >= days) {
81 static const int MDAY[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
87 static const int YDAY[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
117 if (off.
day < mday) {
int leap_thru(int year)
Leap years completed from year 0 up to but not including the first day of the specified year.
struct leap_off leap_from(int year, int month, int day)
Day from year, month and day of month.
int leap_mday(int year, int month)
Day of month from year and month.
bool is_leap(int year)
Determine if a year is a leap year.
struct leap_date leap_abs_date(int day_off)
Absolute date from day of year.
int leap_add(int year)
Adds one for a leap year otherwise zero.
int leap_day(int year)
Counts leap-adjusted days up to some year.
int leap_yday(int year, int month)
Day of year from year and month.
int leap_abs_from(int year, int month, int day)
Absolute date from year, month, and day of month.
Leap year function prototypes.
int leap_mday(int year, int month)
Day of month from year and month.
int leap_add(int year)
Adds one for a leap year otherwise zero.
int leap_day(int year)
Counts leap-adjusted days up to some year.
int leap_yday(int year, int month)
Day of year from year and month.
Quotient and modulus prototypes.
Leap year date structure.
int month
Month of year starting from 1 for January.
Leap offset by year and day.
int day
Day of year offset.
Quotient and remainder in integer space.