JewcalGetReading

The JewcalGetReading function retrieves the name of the torah and haphtarah reading which falls on the shabbat specified by the passed Gregorian date. To retrieve if the Parashot are "connected", use the JewcalGetReadingEx function.

DWORD JewcalGetReading(LPJEWCALDATE lpGregorianDate,
                       BOOL fDiaspora,
                       LPTSTR lpParasha, UINT cbParashaMax,
                       LPTSTR lpHaphtarah, UINT cbHaphtarahMax,
                       LPTSTR lpLanguage, LPTSTR lpNameFile);

Parameters

lpGregorianDate
If it is not NULL, it must point to a JEWCALDATE structure which specifies the Gregorian date which must fall on a shabbat and for which the torah and haphtarah readings is returned.
If it is NULL, the current date is used.

fDiaspora
If it is TRUE, calculation for Diaspora is used.
If it is FALSE, calculation for Israel is used.

lpParasha
Must point to a string buffer which will contain the name of the torah reading after execution of this function. If the given date does not fall on a Shabbat, an empty string is returned.
If it is NULL, no information about torah reading is returned.

Hint (when using the default NAMES.TXT file with default torah readings): To get only the name of the torah section, you can cut the returned string at the first comma (,).

Example:

   Bereshith, Genesis 1, 1-6, 8

becomes

   Bereshith

cbParashaMax
Must contain the size of the buffer lpParasha in characters.

lpHaphtarah
Must point to a string buffer which will contain the name of the haphtarah reading after execution of this function. If the given date does not fall on a Shabbat, an empty string is returned.
If it is NULL, no information about haptarah reading is returned.

cbHaphtarahMax
Must contain the size of the buffer lpHaphtarah in characters.

lpLanguage
If it is not NULL, it must point to a language defined in NAMES.TXT.
If it is NULL, the entry with no language, that means without a dot, is retrieved if present (by default, not).

lpNameFile
If it is not NULL, it must point to the filename with full path of the NAMES.TXT file.
If it is NULL, the NAMES.TXT file is assumed to have its original name and present in the same directory where JEWCAL.DLL is located.
File format of NAMES.TXT

Return values

If the function succeeds, the return value is JEWCAL_ERROR_OK.

If the function fails, the return value is other than JEWCAL_ERROR_OK. The function fails if the passed Gregorian date is invalid or if the buffer(s) are too small.

See Also

JewcalGetReadingEx, JEWCALDATE