logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Author

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

Version 1.4                                      Sun Jan 8 2012                                   src/hdate.h(3)

Define Documentation

#defineHDATE_DIASPORA_FLAG-1
       use diaspora dates and holydays flag

   #defineHDATE_ISRAEL_FLAG0
       use israel dates and holydays flag

   #defineHDATE_SHORT_FLAG-1
       use short strings flag

   #defineHDATE_LONG_FLAG0
       use long strings flag

   #defineHEBREW_NUMBER_BUFFER_SIZE17
       for hdate_get_int_string_ and hdate_get_int_wstring Note:
           How large should the buffer be? Hebrew year 10,999 would be י'תתקצ"ט, eight characters, each two
           bytes, plus an end-of-string delimiter, equals 17. This could effectively yield a range extending to
           Hebrew year 11,899, י'א תתצ'ט, due to the extra ק needed for the '900' century. However, for
           readability, I would want a an extra space at that point between the millennium and the century...

   #defineHEBREW_WNUMBER_BUFFER_SIZE9#defineHDATE_STRING_INT0
       for function hdate_string: identifies string type: integer

   #defineHDATE_STRING_DOW1
       for function hdate_string: identifies string type: day of week

   #defineHDATE_STRING_PARASHA2
       for function hdate_string: identifies string type: parasha

   #defineHDATE_STRING_HMONTH3
       for function hdate_string: identifies string type: hebrew_month

   #defineHDATE_STRING_GMONTH4
       for function hdate_string: identifies string type: gregorian_month

   #defineHDATE_STRING_HOLIDAY5
       for function hdate_string: identifies string type: holiday

   #defineHDATE_STRING_OMER6#defineHDATE_STRING_SHORT1
       for function hdate_string: use short form, if one exists

   #defineHDATE_STRING_LONG0
       for function hdate_string: use long form

   #defineHDATE_STRING_HEBREW1
       for function hdate_string: use embedded hebrew string

   #defineHDATE_STRING_LOCAL0
       for function hdate_string: use local locale string

Detailed Description

       libhdate C language header.

       libhdate - Hebrew calendar library, the C language header file.

Function Documentation

hdate_struct*hdate_set_gdate(hdate_struct*h,intd,intm,inty)
       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,intd,intm,inty)
       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,intjd)
       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_structconst*h,intdiaspora,ints)
       Return a string, with the hebrew date. Returns:
           NULL pointer upon failure or, upon success, a pointer to a string containing the short ( e.g. '1
           Tishrey' ) or long (e.g. 'Tuesday
            18 Tishrey 5763 Hol hamoed Sukot' ) formatted date. You must free() the pointer after use.

       Parameters:h The hdate_struct of the date to print.
           diaspora if true give diaspora holydays
           short_format A short flag (true - returns a short string, false returns a long string).

       Warning:
           This was originally written using a local static string, calling for output to be copied away.

   inthdate_get_parasha(hdate_structconst*h,intdiaspora)
       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 through 61 are joined strings e.g. Vayakhel Pekudei)

   inthdate_get_holyday(hdate_structconst*h,intdiaspora)
       get the number of hebrew holiday. Parameters:h pointer this hdate struct.
           diaspora if true give diaspora holidays

       Returns:
           the number of holiday.

   char*hdate_get_int_string(intn)
       convert an integer to hebrew string. Parameters:n The int to convert ( 0 < n < 11000)

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

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           Callers to this function must free() after using the memory pointed to by the return value. The
           original function outputted to a local static string, and suggested that the caller copied it away.
           [deprecation date 2011-12-28]

   char*hdate_get_day_string(intday,ints)
       Return a static string, with name of week day. Parameters:day_of_week The number of the day 1..7 (1 - sun).
           short_form A short flag (true - sun; false - sunday).

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           [deprecation date 2011-12-28]

   char*hdate_get_month_string(intmonth,ints)
       Return a static string, with name of month. Parameters:month The number of the month 1..12 (1 - jan).
           short_form A short flag.

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           [deprecation date 2011-12-28]

   char*hdate_get_hebrew_month_string(intmonth,ints)
       Return a static string, with name of hebrew month. Parameters:month The number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2).
           short_form A short flag.

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           [deprecation date 2011-12-28]

   char*hdate_get_holyday_string(intholyday,ints)
       Name of hebrew holiday. Parameters:holiday The holiday number.
           short_text A short flag. 0=true, !0=false

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           [deprecation date 2011-12-28]

   char*hdate_get_parasha_string(intparasha,ints)
       Name of Parasha. Parameters:parasha The Number of Parasha 1-Bereshit (55 through 61 are joined strings e.g. Vayakhel Pekudei)
           short_form A short flag. 0=true, !0 = false

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.
           [deprecation date 2011-12-28]

   char*hdate_get_omer_string(intomer_day)
       Return a static string, with the day in the omer. Parameters:omer day The day in the omer.

       Returns:
           a pointer to a string with the day in the omer. The caller must free() the pointer after use.

       Warning:
           DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation.

       Attention:
           The prior version of this function returned a pointer to a static string buffer. The current version
           returns a pointer to a malloc()ed buffer and needs to be free()d after use. [deprecation date
           2011-12-28]

   inthdate_get_omer_day(hdate_structconst*h)
       Return the day in the omer of the given date. Parameters:h The hdate_struct of the date to use.

       Returns:
           The day in the omer, starting from 1 (or 0 if not in sfirat ha omer)

   inthdate_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:holyday the holyday number

       Returns:
           the number of holyday type.

   inthdate_get_size_of_hebrew_year(inthebrew_year)
       size of hebrew year in days. Parameters:hebrew_year the hebrew year.

       Returns:
           size of Hebrew year

   inthdate_days_from_3744(inthebrew_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

   inthdate_get_year_type(intsize_of_year,intnew_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)

   inthdate_gdate_to_jd(intday,intmonth,intyear)
       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

   inthdate_hdate_to_jd(intday,intmonth,intyear,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

   voidhdate_jd_to_gdate(intjd,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

   voidhdate_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:
           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

   inthdate_get_day_of_year(intday,intmonth,intyear)
       days from 1 january Parameters:day this day of month
           month this month
           year this year

       Returns:
           the days from 1 jan

   voidhdate_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: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

   voidhdate_get_utc_sun_time(intday,intmonth,intyear,doublelatitude,doublelongitude,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)

   voidhdate_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: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

   inthdate_get_gday(hdate_structconst*h)
       get the Gregorian day of the month Parameters:h pointer this hdate struct.

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

   inthdate_get_gmonth(hdate_structconst*h)
       get the Gregorian month Parameters:h pointer this hdate struct.

       Returns:
           the Gregorian month, jan = 1.

   inthdate_get_gyear(hdate_structconst*h)
       get the Gregorian year Parameters:h pointer this hdate struct.

       Returns:
           the Gregorian year.

   inthdate_get_hday(hdate_structconst*h)
       get the Hebrew day of the month Parameters:h pointer this hdate struct.

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

   inthdate_get_hmonth(hdate_structconst*h)
       get the Hebrew month Parameters:h pointer this hdate struct.

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

   inthdate_get_hyear(hdate_structconst*h)
       get the Hebrew year Parameters:h pointer this hdate struct.

       Returns:
           the Hebrew year.

   inthdate_get_day_of_the_week(hdate_structconst*h)
       get the day of the week Parameters:h pointer this hdate struct.

       Returns:
           the the day of the week.

   inthdate_get_size_of_year(hdate_structconst*h)
       get the size of the hebrew year Parameters:h pointer this hdate struct.

       Returns:
           the the size of the hebrew year.

   inthdate_get_new_year_day_of_the_week(hdate_structconst*h)
       get the new year day of the week Parameters:h pointer this hdate struct.

       Returns:
           the the new year day of the week.

   inthdate_get_julian(hdate_structconst*h)
       get the Julian day number Parameters:h pointer this hdate struct.

       Returns:
           the Julian day number.

   inthdate_get_days(hdate_structconst*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.

   inthdate_get_weeks(hdate_structconst*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.

   inthdate_is_hebrew_locale()
       helper function to find hebrew locale Returns:
           0 - latin locale, -1 - hebrew locale

   char*hdate_string(inttype_of_string,intindex,intshort_form,inthebrew_form)
       Return string values for hdate information. Returns:
           a pointer to a string containing the information. In the cases integers and omer, the strings will
           NOT be static, and the caller must free() them after use. Returns a null pointer upon failure.

       Parameters:type_of_string 0 = integer, 1 = day of week, 2 = parshaot, 3 = hmonth, 4 = gmonth, 5 = holiday, 6 =
           omer
           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)

Name

       src/hdate.h -

       libhdate C language header.

Synopsis

DataStructures
       struct hdate_structlibhdateHebrewdatestructDefines
       #define HDATE_DIASPORA_FLAG   -1
           usediasporadatesandholydaysflag
       #define HDATE_ISRAEL_FLAG   0
           useisraeldatesandholydaysflag
       #define HDATE_SHORT_FLAG   -1
           useshortstringsflag
       #define HDATE_LONG_FLAG   0
           uselongstringsflag
       #define HEBREW_NUMBER_BUFFER_SIZE   17
           forhdate_get_int_string_andhdate_get_int_wstring
       #define HEBREW_WNUMBER_BUFFER_SIZE   9
       #define HDATE_STRING_INT   0
           forfunctionhdate_string:identifiesstringtype:integer
       #define HDATE_STRING_DOW   1
           forfunctionhdate_string:identifiesstringtype:dayofweek
       #define HDATE_STRING_PARASHA   2
           forfunctionhdate_string:identifiesstringtype:parasha
       #define HDATE_STRING_HMONTH   3
           forfunctionhdate_string:identifiesstringtype:hebrew_month
       #define HDATE_STRING_GMONTH   4
           forfunctionhdate_string:identifiesstringtype:gregorian_month
       #define HDATE_STRING_HOLIDAY   5
           forfunctionhdate_string:identifiesstringtype:holiday
       #define HDATE_STRING_OMER   6
       #define HDATE_STRING_SHORT   1
           forfunctionhdate_string:useshortform,ifoneexists
       #define HDATE_STRING_LONG   0
           forfunctionhdate_string:uselongform
       #define HDATE_STRING_HEBREW   1
           forfunctionhdate_string:useembeddedhebrewstring
       #define HDATE_STRING_LOCAL   0
           forfunctionhdate_string:uselocallocalestringFunctionshdate_struct * hdate_set_gdate (hdate_struct *h, int d, int m, int y)
           computedatestructurefromtheGregoriandatehdate_struct * hdate_set_hdate (hdate_struct *h, int d, int m, int y)
           computedatestructurefromtheHebrewdatehdate_struct * hdate_set_jd (hdate_struct *h, int jd)
           computedatestructurefromtheJulianday
       char * hdate_get_format_date (hdate_struct const *h, int diaspora, int s)
           Returnastring,withthehebrewdate.
       int hdate_get_parasha (hdate_struct const *h, int diaspora)
           getthenumberofhebrewparasha.
       int hdate_get_holyday (hdate_struct const *h, int diaspora)
           getthenumberofhebrewholiday.
       char * hdate_get_int_string (int n)
           convertanintegertohebrewstring.
       char * hdate_get_day_string (int day, int s)
           Returnastaticstring,withnameofweekday.
       char * hdate_get_month_string (int month, int s)
           Returnastaticstring,withnameofmonth.
       char * hdate_get_hebrew_month_string (int month, int s)
           Returnastaticstring,withnameofhebrewmonth.
       char * hdate_get_holyday_string (int holyday, int s)
           Nameofhebrewholiday.
       char * hdate_get_parasha_string (int parasha, int s)
           NameofParasha.
       char * hdate_get_omer_string (int omer_day)
           Returnastaticstring,withthedayintheomer.
       int hdate_get_omer_day (hdate_struct const *h)
           Returnthedayintheomerofthegivendate.
       int hdate_get_holyday_type (int holyday)
           Returnnumberofhebrewholydaytype.
       int hdate_get_size_of_hebrew_year (int hebrew_year)
           sizeofhebrewyearindays.
       int hdate_days_from_3744 (int hebrew_year)
           DayssinceTishrey3744.
       int hdate_get_year_type (int size_of_year, int new_year_dw)
           ReturnHebrewyeartypebasedonsizeandfirstweekdayofyear.
       int hdate_gdate_to_jd (int day, int month, int year)
           ComputeJuliandayfromGregoriandate.
       int hdate_hdate_to_jd (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year)
           ComputeJuliandayfromHebrewday,monthandyear.
       void hdate_jd_to_gdate (int jd, int *day, int *month, int *year)
           ConvertingfromtheJuliandaytotheGregoriandate.
       void hdate_jd_to_hdate (int jd, int *day, int *month, int *year, int *jd_tishrey1, int
           *jd_tishrey1_next_year)
           ConvertingfromtheJuliandaytotheHebrewday.
       int hdate_get_day_of_year (int day, int month, int year)
           daysfrom1january
       void hdate_get_utc_sun_time_deg (int day, int month, int year, double latitude, double longitude, double
           deg, int *sunrise, int *sunset)
           utcsuntimesforaltitudeatagregoriandate
       void hdate_get_utc_sun_time (int day, int month, int year, double latitude, double longitude, int
           *sunrise, int *sunset)
           utcsunrise/settimeforagregoriandate
       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)
           utcsunrise/settimeforagregoriandate
       int hdate_get_gday (hdate_struct const *h)
           gettheGregoriandayofthemonth
       int hdate_get_gmonth (hdate_struct const *h)
           gettheGregorianmonth
       int hdate_get_gyear (hdate_struct const *h)
           gettheGregorianyear
       int hdate_get_hday (hdate_struct const *h)
           gettheHebrewdayofthemonth
       int hdate_get_hmonth (hdate_struct const *h)
           gettheHebrewmonth
       int hdate_get_hyear (hdate_struct const *h)
           gettheHebrewyear
       int hdate_get_day_of_the_week (hdate_struct const *h)
           getthedayoftheweek
       int hdate_get_size_of_year (hdate_struct const *h)
           getthesizeofthehebrewyear
       int hdate_get_new_year_day_of_the_week (hdate_struct const *h)
           getthenewyeardayoftheweek
       int hdate_get_julian (hdate_struct const *h)
           gettheJuliandaynumber
       int hdate_get_days (hdate_struct const *h)
           getthenumberofdayspassedsince1tishrey
       int hdate_get_weeks (hdate_struct const *h)
           getthenumberofweekspassedsince1tishreyhdate_struct * new_hdate ()
           creatanewhdatestructobject,mustbedeletedusingdelete_hdate.hdate_struct * delete_hdate (hdate_struct *h)
           deleteanhdatestructobject.
       char * hdate_get_version_string ()
           Returnastaticstring,withthepackagenameandversion.
       char * hdate_get_translator_string ()
           nameoftranslator
       int hdate_is_hebrew_locale ()
           helperfunctiontofindhebrewlocale
       char * hdate_string (int type_of_string, int index, int short_form, int hebrew_form)
           Returnstringvaluesforhdateinformation.

See Also