2 * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 typedef long long stamp_t;
68 int is_leap_year(year_t year);
69 int days_in_year(year_t year);
70 int days_in_month(year_t year, month_t month);
71 int weeks_in_month(year_t year, month_t month);
72 wday_t day_of_week(year_t year, month_t month, day_t day);
73 wday_t start_of_month(year_t year, month_t month);
74 day_t start_of_week(year_t year, month_t month, day_t day);
75 void add_days(year_t *year, month_t *month, day_t *day, int days);
76 void add_months(year_t *year, month_t *month, int months);
78 stamp_t get_stamp(date_t *date);
79 int get_mins(date_t *start, date_t *end);
80 int compare(date_t *a, date_t *b);
81 int before(date_t *start, int year, int month, int day, int hour, int min);
83 /* Time to string functions */
84 const char *month_to_str(month_t month);
85 const char *month_to_string(month_t month);
86 const char *day_to_st(wday_t day);
87 const char *day_to_str(wday_t day);
88 const char *day_to_string(wday_t day);