table of contents
src/hdate.h(3) | libhdate C language | src/hdate.h(3) |
NAME¶
src/hdate.h -
libhdate C language header.
SYNOPSIS¶
Data Structures¶
struct hdate_struct
libhdate Hebrew date struct
Defines¶
#define HDATE_DIASPORA_FLAG -1
use diaspora dates and holydays flag #define HDATE_ISRAEL_FLAG
0
use israel dates and holydays flag #define HDATE_SHORT_FLAG -1
use short strings flag #define HDATE_LONG_FLAG 0
use long strings flag #define HEBREW_NUMBER_BUFFER_SIZE 17
for hdate_get_int_string_ and hdate_get_int_wstring #define
HEBREW_WNUMBER_BUFFER_SIZE 9
#define HDATE_STRING_INT 0
for function hdate_string: identifies string type: integer #define
HDATE_STRING_DOW 1
for function hdate_string: identifies string type: day of week #define
HDATE_STRING_PARASHA 2
for function hdate_string: identifies string type: parasha #define
HDATE_STRING_HMONTH 3
for function hdate_string: identifies string type: hebrew_month
#define HDATE_STRING_GMONTH 4
for function hdate_string: identifies string type: gregorian_month
#define HDATE_STRING_HOLIDAY 5
for function hdate_string: identifies string type: holiday #define
HDATE_STRING_OMER 6
#define HDATE_STRING_SHORT 1
for function hdate_string: use short form, if one exists #define
HDATE_STRING_LONG 0
for function hdate_string: use long form #define
HDATE_STRING_HEBREW 1
for function hdate_string: use embedded hebrew string #define
HDATE_STRING_LOCAL 0
for function hdate_string: use local locale string
Functions¶
hdate_struct * hdate_set_gdate (hdate_struct
*h, int d, int m, int y)
compute date structure from the Gregorian date hdate_struct *
hdate_set_hdate (hdate_struct *h, int d, int m, int y)
compute date structure from the Hebrew date hdate_struct *
hdate_set_jd (hdate_struct *h, int jd)
compute date structure from the Julian day char *
hdate_get_format_date (hdate_struct const *h, int diaspora,
int s)
Return a string, with the hebrew date. int hdate_get_parasha
(hdate_struct const *h, int diaspora)
get the number of hebrew parasha. int hdate_get_holyday
(hdate_struct const *h, int diaspora)
get the number of hebrew holiday. char * hdate_get_int_string
(int n)
convert an integer to hebrew string. char *
hdate_get_day_string (int day, int s)
Return a static string, with name of week day. char *
hdate_get_month_string (int month, int s)
Return a static string, with name of month. char *
hdate_get_hebrew_month_string (int month, int s)
Return a static string, with name of hebrew month. char *
hdate_get_holyday_string (int holyday, int s)
Name of hebrew holiday. char * hdate_get_parasha_string (int
parasha, int s)
Name of Parasha. char * hdate_get_omer_string (int omer_day)
Return a static string, with the day in the omer. int
hdate_get_omer_day (hdate_struct const *h)
Return the day in the omer of the given date. int
hdate_get_holyday_type (int holyday)
Return number of hebrew holyday type. int
hdate_get_size_of_hebrew_year (int hebrew_year)
size of hebrew year in days. int hdate_days_from_3744 (int
hebrew_year)
Days since Tishrey 3744. int hdate_get_year_type (int
size_of_year, int new_year_dw)
Return Hebrew year type based on size and first week day of year. int
hdate_gdate_to_jd (int day, int month, int year)
Compute Julian day from Gregorian date. int hdate_hdate_to_jd
(int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year)
Compute Julian day from Hebrew day, month and year. void
hdate_jd_to_gdate (int jd, int *day, int *month, int *year)
Converting from the Julian day to the Gregorian date. void
hdate_jd_to_hdate (int jd, int *day, int *month, int *year, int
*jd_tishrey1, int *jd_tishrey1_next_year)
Converting from the Julian day to the Hebrew day. int
hdate_get_day_of_year (int day, int month, int year)
days from 1 january void hdate_get_utc_sun_time_deg (int day,
int month, int year, double latitude, double longitude, double deg, int
*sunrise, int *sunset)
utc sun times for altitude at a gregorian date void
hdate_get_utc_sun_time (int day, int month, int year, double
latitude, double longitude, int *sunrise, int *sunset)
utc sunrise/set time for a gregorian date void
hdate_get_utc_sun_time_full (int day, int month, int year, double
latitude, double longitude, int *sun_hour, int *first_light, int *talit, int
*sunrise, int *midday, int *sunset, int *first_stars, int *three_stars)
utc sunrise/set time for a gregorian date int hdate_get_gday
(hdate_struct const *h)
get the Gregorian day of the month int hdate_get_gmonth
(hdate_struct const *h)
get the Gregorian month int hdate_get_gyear
(hdate_struct const *h)
get the Gregorian year int hdate_get_hday (hdate_struct
const *h)
get the Hebrew day of the month int hdate_get_hmonth
(hdate_struct const *h)
get the Hebrew month int hdate_get_hyear (hdate_struct
const *h)
get the Hebrew year int hdate_get_day_of_the_week
(hdate_struct const *h)
get the day of the week int hdate_get_size_of_year
(hdate_struct const *h)
get the size of the hebrew year int
hdate_get_new_year_day_of_the_week (hdate_struct const *h)
get the new year day of the week int hdate_get_julian
(hdate_struct const *h)
get the Julian day number int hdate_get_days
(hdate_struct const *h)
get the number of days passed since 1 tishrey int
hdate_get_weeks (hdate_struct const *h)
get the number of weeks passed since 1 tishrey hdate_struct *
new_hdate ()
creat a new hdate struct object, must be deleted using delete_hdate.
hdate_struct * delete_hdate (hdate_struct *h)
delete an hdate struct object. char * hdate_get_version_string
()
Return a static string, with the package name and version. char *
hdate_get_translator_string ()
name of translator int hdate_is_hebrew_locale ()
helper function to find hebrew locale char * hdate_string (int
type_of_string, int index, int short_form, int hebrew_form)
Return string values for hdate information.
Detailed Description¶
libhdate C language header.
libhdate - Hebrew calendar library, the C language header file.
Define Documentation¶
#define HDATE_DIASPORA_FLAG -1¶
use diaspora dates and holydays flag
#define HDATE_ISRAEL_FLAG 0¶
use israel dates and holydays flag
#define HDATE_SHORT_FLAG -1¶
use short strings flag
#define HDATE_LONG_FLAG 0¶
use long strings flag
#define HEBREW_NUMBER_BUFFER_SIZE 17¶
for hdate_get_int_string_ and hdate_get_int_wstring Note:
#define HEBREW_WNUMBER_BUFFER_SIZE 9¶
#define HDATE_STRING_INT 0¶
for function hdate_string: identifies string type: integer
#define HDATE_STRING_DOW 1¶
for function hdate_string: identifies string type: day of week
#define HDATE_STRING_PARASHA 2¶
for function hdate_string: identifies string type: parasha
#define HDATE_STRING_HMONTH 3¶
for function hdate_string: identifies string type: hebrew_month
#define HDATE_STRING_GMONTH 4¶
for function hdate_string: identifies string type: gregorian_month
#define HDATE_STRING_HOLIDAY 5¶
for function hdate_string: identifies string type: holiday
#define HDATE_STRING_OMER 6¶
#define HDATE_STRING_SHORT 1¶
for function hdate_string: use short form, if one exists
#define HDATE_STRING_LONG 0¶
for function hdate_string: use long form
#define HDATE_STRING_HEBREW 1¶
for function hdate_string: use embedded hebrew string
#define HDATE_STRING_LOCAL 0¶
for function hdate_string: use local locale string
Function Documentation¶
hdate_struct* hdate_set_gdate (hdate_struct *h, intd, intm, inty)¶
compute date structure from the Gregorian date Parameters:
d Day of month 1..31
m Month 1..12 if m or d is 0 return current date.
y Year in 4 digits e.g. 2001
Returns:
hdate_struct* hdate_set_hdate (hdate_struct *h, intd, intm, inty)¶
compute date structure from the Hebrew date Parameters:
d Day of month 1..31
m Month 1..14 ,(13 - Adar 1, 14 - Adar 2) if m or d is 0 return current date.
y Year in 4 digits e.g. 5731
Returns:
hdate_struct* hdate_set_jd (hdate_struct *h, intjd)¶
compute date structure from the Julian day Parameters:
jd the julian day number.
Returns:
char* hdate_get_format_date (hdate_struct const *h, intdiaspora, ints)¶
Return a string, with the hebrew date. Returns:
18 Tishrey 5763 Hol hamoed Sukot' ) formatted date. You must free() the pointer after use.
Parameters:
diaspora if true give diaspora holydays
short_format A short flag (true - returns a short string, false returns a long string).
Warning:
int hdate_get_parasha (hdate_struct const *h, intdiaspora)¶
get the number of hebrew parasha. Parameters:
diaspora if true give diaspora readings
Returns:
int hdate_get_holyday (hdate_struct const *h, intdiaspora)¶
get the number of hebrew holiday. Parameters:
diaspora if true give diaspora holidays
Returns:
char* hdate_get_int_string (intn)¶
convert an integer to hebrew string. Parameters:
Returns:
Warning:
char* hdate_get_day_string (intday, ints)¶
Return a static string, with name of week day. Parameters:
short_form A short flag (true - sun; false - sunday).
Warning:
char* hdate_get_month_string (intmonth, ints)¶
Return a static string, with name of month. Parameters:
short_form A short flag.
Warning:
char* hdate_get_hebrew_month_string (intmonth, ints)¶
Return a static string, with name of hebrew month. Parameters:
short_form A short flag.
Warning:
char* hdate_get_holyday_string (intholyday, ints)¶
Name of hebrew holiday. Parameters:
short_text A short flag. 0=true, !0=false
Warning:
char* hdate_get_parasha_string (intparasha, ints)¶
Name of Parasha. Parameters:
short_form A short flag. 0=true, !0 = false
Warning:
char* hdate_get_omer_string (intomer_day)¶
Return a static string, with the day in the omer. Parameters:
Returns:
Warning:
Attention:
int hdate_get_omer_day (hdate_struct const *h)¶
Return the day in the omer of the given date. Parameters:
Returns:
int hdate_get_holyday_type (intholyday)¶
Return number of hebrew holyday type. Holiday types: 0 - Regular day 1 - Yom tov (plus yom kippor) 2 - Erev yom kippur 3 - Hol hamoed 4 - Hanuka and purim 5 - Tzomot 6 - Independance day and Yom yerushalaim 7 - Lag baomer ,Tu beav, Tu beshvat 8 - Tzahal and Holocaust memorial days 9 - National days
Parameters:
Returns:
int hdate_get_size_of_hebrew_year (inthebrew_year)¶
size of hebrew year in days. Parameters:
Returns:
int hdate_days_from_3744 (inthebrew_year)¶
Days since Tishrey 3744. Author:
Parameters:
Returns:
int hdate_get_year_type (intsize_of_year, intnew_year_dw)¶
Return Hebrew year type based on size and first week day of year. Parameters:
new_year_dw First week day of year
Returns:
int hdate_gdate_to_jd (intday, intmonth, intyear)¶
Compute Julian day from Gregorian date. Author:
Parameters:
month Month 1..12
year Year in 4 digits e.g. 2001
Returns:
int hdate_hdate_to_jd (intday, intmonth, intyear, int *jd_tishrey1, int *jd_tishrey1_next_year)¶
Compute Julian day from Hebrew day, month and year. Author:
Parameters:
month Month 1..14 (13 - Adar 1, 14 - Adar 2)
year Hebrew year in 4 digits e.g. 5753
jd_tishrey1 return the julian number of 1 Tishrey this year
jd_tishrey1_next_year return the julian number of 1 Tishrey next year
Returns:
void hdate_jd_to_gdate (intjd, int *day, int *month, int *year)¶
Converting from the Julian day to the Gregorian date. Author:
Parameters:
day return Day of month 1..31
month return Month 1..12
year return Year in 4 digits e.g. 2001
void hdate_jd_to_hdate (intjd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)¶
Converting from the Julian day to the Hebrew day. Author:
Parameters:
day return Day of month 1..31
month return Month 1..14 (13 - Adar 1, 14 - Adar 2)
year return Year in 4 digits e.g. 2001
jd_tishrey1 return the julian number of 1 Tishrey this year
jd_tishrey1_next_year return the julian number of 1 Tishrey next year
int hdate_get_day_of_year (intday, intmonth, intyear)¶
days from 1 january Parameters:
month this month
year this year
Returns:
void hdate_get_utc_sun_time_deg (intday, intmonth, intyear, doublelatitude, doublelongitude, doubledeg, int *sunrise, int *sunset)¶
utc sun times for altitude at a gregorian date Returns the sunset and sunrise times in minutes from 00:00 (utc time) if sun altitude in sunrise is deg degries. This function only works for altitudes sun realy is. If the sun never get to this altitude, the returned sunset and sunrise values will be negative. This can happen in low altitude when latitude is nearing the pols in winter times, the sun never goes very high in the sky there.
Parameters:
month this month
year this year
longitude longitude to use in calculations
latitude latitude to use in calculations
deg degrees of sun's altitude (0 - Zenith .. 90 - Horizon)
sunrise return the utc sunrise in minutes
sunset return the utc sunset in minutes
void hdate_get_utc_sun_time (intday, intmonth, intyear, doublelatitude, doublelongitude, int *sunrise, int *sunset)¶
utc sunrise/set time for a gregorian date Parameters:
month this month
year this year
longitude longitude to use in calculations degrees, negative values are east
latitude latitude to use in calculations degrees, negative values are south
sunrise return the utc sunrise in minutes after midnight (00:00)
sunset return the utc sunset in minutes after midnight (00:00)
void hdate_get_utc_sun_time_full (intday, intmonth, intyear, doublelatitude, doublelongitude, int *sun_hour, int *first_light, int *talit, int *sunrise, int *midday, int *sunset, int *first_stars, int *three_stars)¶
utc sunrise/set time for a gregorian date Parameters:
month this month
year this year
longitude longitude to use in calculations
latitude latitude to use in calculations
sun_hour return the length of shaa zaminit in minutes
first_light return the utc alut ha-shachar in minutes
talit return the utc tphilin and talit in minutes
sunrise return the utc sunrise in minutes
midday return the utc midday in minutes
sunset return the utc sunset in minutes
first_stars return the utc tzeit hacochavim in minutes
three_stars return the utc shlosha cochavim in minutes
int hdate_get_gday (hdate_struct const *h)¶
get the Gregorian day of the month Parameters:
Returns:
int hdate_get_gmonth (hdate_struct const *h)¶
get the Gregorian month Parameters:
Returns:
int hdate_get_gyear (hdate_struct const *h)¶
get the Gregorian year Parameters:
Returns:
int hdate_get_hday (hdate_struct const *h)¶
get the Hebrew day of the month Parameters:
Returns:
int hdate_get_hmonth (hdate_struct const *h)¶
get the Hebrew month Parameters:
Returns:
int hdate_get_hyear (hdate_struct const *h)¶
get the Hebrew year Parameters:
Returns:
int hdate_get_day_of_the_week (hdate_struct const *h)¶
get the day of the week Parameters:
Returns:
int hdate_get_size_of_year (hdate_struct const *h)¶
get the size of the hebrew year Parameters:
Returns:
int hdate_get_new_year_day_of_the_week (hdate_struct const *h)¶
get the new year day of the week Parameters:
Returns:
int hdate_get_julian (hdate_struct const *h)¶
get the Julian day number Parameters:
Returns:
int hdate_get_days (hdate_struct const *h)¶
get the number of days passed since 1 tishrey Parameters:
Returns:
int hdate_get_weeks (hdate_struct const *h)¶
get the number of weeks passed since 1 tishrey Parameters:
Returns:
hdate_struct* new_hdate ()¶
creat a new hdate struct object, must be deleted using delete_hdate. Returns:
hdate_struct* delete_hdate (hdate_struct *h)¶
delete an hdate struct object. Parameters:
char* hdate_get_version_string ()¶
Return a static string, with the package name and version. Returns:
char* hdate_get_translator_string ()¶
name of translator Returns:
int hdate_is_hebrew_locale ()¶
helper function to find hebrew locale Returns:
char* hdate_string (inttype_of_string, intindex, intshort_form, inthebrew_form)¶
Return string values for hdate information. Returns:
Parameters:
index integer ( 0 < n < 11000) day of week ( 0 < n < 8 ) parshaot ( 0 , n < 62 ) hmonth ( 0 < n < 15 ) gmonth ( 0 < n < 13 ) holiday ( 0 < n < 37 ) omer ( 0 < n < 50 )
short_form 0 = short format
hebrew_form 0 = not hebrew (native/embedded)
Author¶
Generated automatically by Doxygen for libhdate C language from the source code.
Sun Jan 8 2012 | Version 1.4 |