2 * hdate_hdate.c: convert georgean and hebrew calendars.
5 * Yaacov Zamir <kzamir@walla.co.il>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <https://www.gnu.org/licenses/>.
31 @brief Return the days from the start
34 @warning internal function.
37 hdate_days_from_start (int y
);
40 @brief compute hebrew date from gregorian date
42 @param d Day of month 1..31
43 @param m Month 1..12 , if m or d is 0 return current date.
44 @param y Year in 4 digits e.g. 2001
47 hdate_gdate_to_hdate (int d
, int m
, int y
, int *hd
, int *hm
, int *hy
);
50 @brief compute general date structure from hebrew date
52 @param d Day of month 1..31
53 @param m Month 0..13 , if m or d is 0 return current date.
54 @param y Year in 4 digits e.g. 5731
56 @attention no sanity cheak !!
59 hdate_hdate_to_gdate (int d
, int m
, int y
, int *gd
, int *gm
, int *gy
);
62 @brief Compute Julian day (jd from Gregorian day, month and year (d, m, y)
63 Algorithm from 'Julian and Gregorian Day Numbers' by Peter Meyer
64 @author Yaacov Zamir ( algorithm from Henry F. Fliegel and Thomas C. Van Flandern ,1968)
66 @param d Day of month 1..31
68 @param y Year in 4 digits e.g. 2001
71 hdate_gdate_to_jd (int d
, int m
, int y
);
74 @brief Converting from the Julian day to the Gregorian day
75 Algorithm from 'Julian and Gregorian Day Numbers' by Peter Meyer
76 @author Yaacov Zamir ( Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968)
79 @param d Return Day of month 1..31
80 @param m Return Month 1..12
81 @param y Return Year in 4 digits e.g. 2001
84 hdate_jd_to_gdate (int jd
, int *d
, int *m
, int *y
);
87 @brief Converting from the Julian day to the Hebrew day
88 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
91 @param d Return Day of month 1..31
92 @param m Return Month 1..14
93 @param y Return Year in 4 digits e.g. 2001
96 hdate_jd_to_hdate (int jd
, int *d
, int *m
, int *y
);
99 @brief Compute Julian day (jd from Hebrew day, month and year (d, m, y)
100 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
102 @param d Day of month 1..31
104 @param y Year in 4 digits e.g. 5753
107 hdate_hdate_to_jd (int d
, int m
, int y
);
109 /* string functions */
112 @brief convert an integer to hebrew string UTF-8 (logical)
114 @param n The int to convert
115 @attention ( 0 < n < 10000)
116 @warning uses a static string, so output should be copied away.
118 void hdate_int_to_hebrew (GString
*res
, int n
);
121 @brief Return a static string, with name of hebrew month.
123 @param month The number of the month 0..13 (0 - tishre, 12 - adar 1, 13 - adar 2).
124 @warning uses a static string, so output should be copied away.
126 const char *hdate_get_hebrew_month_name (int month
);
129 @brief Return a static string, with name of hebrew month in hebrew.
131 @param month The number of the month 0..13 (0 - tishre, 12 - adar 1, 13 - adar 2).
132 @warning uses a static string, so output should be copied away.
134 const char *hdate_get_hebrew_month_name_heb (int month
);