libcalendars  0.1.0
cl-gregorian.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 - Soroush Rabiei, <soroush@ametisco.ir>
3  * This file is part of libcalendar.
4  *
5  * libcalendar is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcalendar is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with libcalendar. If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 #ifndef LIBCALENDAR_GREGORIAN_H
21 #define LIBCALENDAR_GREGORIAN_H
22 
23 #include <stdint.h>
24 #include "cl-export.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 LIBCALENDAR_API uint8_t gr_is_leap(int16_t year);
31 LIBCALENDAR_API uint8_t gr_days_in_month(uint8_t month, int16_t year);
32 LIBCALENDAR_API uint16_t gr_days_in_year(int16_t year);
33 LIBCALENDAR_API uint8_t gr_month_in_year(int16_t year);
34 LIBCALENDAR_API uint8_t gr_is_valid(int16_t year, uint8_t month, uint16_t day);
35 LIBCALENDAR_API void gr_to_jdn(uint32_t* jd,
36  int16_t year, uint8_t month, uint16_t day);
37 LIBCALENDAR_API void jdn_to_gr(uint32_t jdn,
38  int16_t* year, uint8_t* month, uint16_t* day);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* LIBCALENDAR_GREGORIAN_H */
LIBCALENDAR_API void gr_to_jdn(uint32_t *jd, int16_t year, uint8_t month, uint16_t day)
Definition: cl-gregorian.c:80
LIBCALENDAR_API void jdn_to_gr(uint32_t jdn, int16_t *year, uint8_t *month, uint16_t *day)
Definition: cl-gregorian.c:92
LIBCALENDAR_API uint16_t gr_days_in_year(int16_t year)
Definition: cl-gregorian.c:62
LIBCALENDAR_API uint8_t gr_month_in_year(int16_t year)
Definition: cl-gregorian.c:67
LIBCALENDAR_API uint8_t gr_is_leap(int16_t year)
Definition: cl-gregorian.c:26
#define LIBCALENDAR_API
Definition: cl-export.h:33
LIBCALENDAR_API uint8_t gr_is_valid(int16_t year, uint8_t month, uint16_t day)
Definition: cl-gregorian.c:72
LIBCALENDAR_API uint8_t gr_days_in_month(uint8_t month, int16_t year)
Definition: cl-gregorian.c:35