hdate.h

Langue: en

Version: 299931 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

Sommaire

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

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)
get formated 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 holyday.
char * hdate_get_int_string (int n)
convert an integer to hebrew string.
char * hdate_get_day_string (int day, int s)
get name of week day.
char * hdate_get_month_string (int month, int s)
name of month.
char * hdate_get_hebrew_month_string (int month, int s)
name of hebrew month.
char * hdate_get_holyday_string (int holyday, int s)
name of hebrew holyday.
char * hdate_get_parasha_string (int parasha, int s)
name of parasha
int hdate_get_holyday_type (int holyday)
get the 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

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

Function Documentation

hdate_struct* hdate_set_gdate (hdate_struct * h, int d, int m, int y)

compute date structure from the Gregorian date

Parameters:

h pointer this hdate struct.
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:

pointer to this hdate struct

hdate_struct* hdate_set_hdate (hdate_struct * h, int d, int m, int y)

compute date structure from the Hebrew date

Parameters:

h pointer this hdate struct.
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:

pointer to this hdate struct

hdate_struct* hdate_set_jd (hdate_struct * h, int jd)

compute date structure from the Julian day

Parameters:

h pointer this hdate struct.
jd the julian day number.

Returns:

pointer to this hdate struct

char* hdate_get_format_date (hdate_struct const * h, int diaspora, int s)

get formated hebrew date.

return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formated date.

Parameters:

h pointer this hdate struct.
diaspora if true give diaspora holydays.
s short flag.

Returns:

a static string of foramted date

int hdate_get_parasha (hdate_struct const * h, int diaspora)

get the number of hebrew parasha.

Parameters:

h pointer this hdate struct.
diaspora if true give diaspora readings

Returns:

the number of parasha 1. Bereshit etc.. (55 trow 61 are joined strings e.g. Vayakhel Pekudei)

int hdate_get_holyday (hdate_struct const * h, int diaspora)

get the number of hebrew holyday.

Parameters:

h pointer this hdate struct.
diaspora if true give diaspora holydays

Returns:

the number of holyday.

char* hdate_get_int_string (int n)

convert an integer to hebrew string.

Parameters:

n The int to convert

Returns:

a static string of the hebrew number UTF-8 (logical)

Attention:

( 0 < n < 10000)

char* hdate_get_day_string (int day, int s)

get name of week day.

Parameters:

day The number of the day 1..7 (1 - sun).
s short flag true - returns a short string: sun, false returns: sunday.

Returns:

a static string of the day of the week

char* hdate_get_month_string (int month, int s)

name of month.

Parameters:

month the number of the month 1..12 (1 - jan).
s short flag.

Returns:

a static string of month name

char* hdate_get_hebrew_month_string (int month, int s)

name of hebrew month.

Parameters:

month the number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2).
s short flag.

Returns:

a static string of month name

char* hdate_get_holyday_string (int holyday, int s)

name of hebrew holyday.

Parameters:

holyday the holyday number.
s short flag.

Returns:

a static string of holyday name

char* hdate_get_parasha_string (int parasha, int s)

name of parasha

Parameters:

parasha the number of parasha 1-Bereshit (55 trow 61 are joined strings e.g. Vayakhel Pekudei)
s short flag.

Returns:

a static string of parasha name

int hdate_get_holyday_type (int holyday)

get the hebrew holyday type.

Parameters:

holyday the holyday number.

Returns:

the number of holyday type.

int hdate_get_size_of_hebrew_year (int hebrew_year)

size of hebrew year in days.

Parameters:

hebrew_year the hebrew year.

Returns:

size of Hebrew year

int hdate_days_from_3744 (int hebrew_year)

Days since Tishrey 3744.

Author:

Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005

Parameters:

hebrew_year The Hebrew year

Returns:

Number of days since 3,1,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.

Parameters:

size_of_year Length of year in days
new_year_dw First week day of year

Returns:

the number for year type (1..14)

int hdate_gdate_to_jd (int day, int month, int year)

Compute Julian day from Gregorian date.

Author:

Yaacov Zamir (algorithm from Henry F. Fliegel and Thomas C. Van Flandern ,1968)

Parameters:

day Day of month 1..31
month Month 1..12
year Year in 4 digits e.g. 2001

Returns:

the julian day number

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.

Author:

Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005

Parameters:

day Day of month 1..31
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:

the julian day number

void hdate_jd_to_gdate (int jd, int * day, int * month, int * year)

Converting from the Julian day to the Gregorian date.

Author:

Yaacov Zamir (Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968)

Parameters:

jd Julian day
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 (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.

Author:

Yaacov Zamir 2005

Parameters:

jd Julian day
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 (int day, int month, int year)

days from 1 january

Parameters:

day this day of month
month this month
year this year

Returns:

the days from 1 jan

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

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:

day this day of month
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 (int day, int month, int year, double latitude, double longitude, int * sunrise, int * sunset)

utc sunrise/set time for a gregorian date

Parameters:

day this day of month
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 (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

Parameters:

day this day of month
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:

h pointer this hdate struct.

Returns:

the Gregorian day of the month, 1..31.

int hdate_get_gmonth (hdate_struct const * h)

get the Gregorian month

Parameters:

h pointer this hdate struct.

Returns:

the Gregorian month, jan = 1.

int hdate_get_gyear (hdate_struct const * h)

get the Gregorian year

Parameters:

h pointer this hdate struct.

Returns:

the Gregorian year.

int hdate_get_hday (hdate_struct const * h)

get the Hebrew day of the month

Parameters:

h pointer this hdate struct.

Returns:

the Hebrew day of the month, 1..30.

int hdate_get_hmonth (hdate_struct const * h)

get the Hebrew month

Parameters:

h pointer this hdate struct.

Returns:

the Hebrew month, Tishery = 1 .. Adar I =13, Adar II = 14.

int hdate_get_hyear (hdate_struct const * h)

get the Hebrew year

Parameters:

h pointer this hdate struct.

Returns:

the Hebrew year.

int hdate_get_day_of_the_week (hdate_struct const * h)

get the day of the week

Parameters:

h pointer this hdate struct.

Returns:

the the day of the week.

int hdate_get_size_of_year (hdate_struct const * h)

get the size of the hebrew year

Parameters:

h pointer this hdate struct.

Returns:

the 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

Parameters:

h pointer this hdate struct.

Returns:

the the new year day of the week.

int hdate_get_julian (hdate_struct const * h)

get the Julian day number

Parameters:

h pointer this hdate struct.

Returns:

the Julian day number.

int hdate_get_days (hdate_struct const * h)

get the number of days passed since 1 tishrey

Parameters:

h pointer this hdate struct.

Returns:

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

Parameters:

h pointer this hdate struct.

Returns:

the number of weeks passed since 1 tishrey.

hdate_struct* new_hdate ()

creat a new hdate struct object, must be deleted using delete_hdate.

Returns:

a new hdate object

hdate_struct* delete_hdate (hdate_struct * h)

delete an hdate struct object.

Parameters:

h pointer this hdate struct.

char* hdate_get_version_string ()

Return a static string, with the package name and version.

Returns:

a static string, with the package name and version

char* hdate_get_translator_string ()

name of translator

Returns:

a static string with name of translator, or NULL if none.

Author

Generated automatically by Doxygen for libhdate C language from the source code.