diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches new file mode 100644 index 0000000..6857a8d --- /dev/null +++ b/.pc/.quilt_patches @@ -0,0 +1 @@ +debian/patches diff --git a/.pc/.quilt_series b/.pc/.quilt_series new file mode 100644 index 0000000..c206706 --- /dev/null +++ b/.pc/.quilt_series @@ -0,0 +1 @@ +series diff --git a/.pc/.version b/.pc/.version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/.pc/.version @@ -0,0 +1 @@ +2 diff --git a/.pc/applied-patches b/.pc/applied-patches new file mode 100644 index 0000000..a95c579 --- /dev/null +++ b/.pc/applied-patches @@ -0,0 +1,8 @@ +docdir.patch +ld-as-needed.patch +time_t.patch +typos.patch +cflags.patch +duplicate_gnu_source.patch +size_t.patch +clang.patch diff --git a/.pc/cflags.patch/bindings/perl/Makefile.am b/.pc/cflags.patch/bindings/perl/Makefile.am new file mode 100644 index 0000000..254e929 --- /dev/null +++ b/.pc/cflags.patch/bindings/perl/Makefile.am @@ -0,0 +1,25 @@ + +EXTRA_DIST = hdate.i + +if WITH_PERL + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cxx *.so *wrap* *.pm + +all-am: hdate.so + + +hdate.so: hdate_wrap.cxx + g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src + g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so + +hdate_wrap.cxx: hdate.i + swig -perl -c++ hdate.i + +install-data-local: hdate.so + $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/ + $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so + $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm + +endif diff --git a/.pc/cflags.patch/bindings/perl/Makefile.in b/.pc/cflags.patch/bindings/perl/Makefile.in new file mode 100644 index 0000000..8783e24 --- /dev/null +++ b/.pc/cflags.patch/bindings/perl/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/perl +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i +@WITH_PERL_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_PERL_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.pm +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/perl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_PERL_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_PERL_TRUE@all-am: hdate.so + +@WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx +@WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src +@WITH_PERL_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so + +@WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i +@WITH_PERL_TRUE@ swig -perl -c++ hdate.i + +@WITH_PERL_TRUE@install-data-local: hdate.so +@WITH_PERL_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/ +@WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so +@WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/cflags.patch/bindings/python/Makefile.am b/.pc/cflags.patch/bindings/python/Makefile.am new file mode 100644 index 0000000..c6ae479 --- /dev/null +++ b/.pc/cflags.patch/bindings/python/Makefile.am @@ -0,0 +1,25 @@ + +EXTRA_DIST = hdate.i + +if WITH_PYTHON + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cxx *.so *wrap* *.py + +all-am: _hdate.so + + +_hdate.so: hdate_wrap.cxx + g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src + g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so + +hdate_wrap.cxx: hdate.i + swig -python -c++ hdate.i + +install-data-local: _hdate.so + $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH) + $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so + $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py + +endif diff --git a/.pc/cflags.patch/bindings/python/Makefile.in b/.pc/cflags.patch/bindings/python/Makefile.in new file mode 100644 index 0000000..f2a1aa1 --- /dev/null +++ b/.pc/cflags.patch/bindings/python/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/python +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i +@WITH_PYTHON_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_PYTHON_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.py +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/python/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_PYTHON_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_PYTHON_TRUE@all-am: _hdate.so + +@WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx +@WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src +@WITH_PYTHON_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so + +@WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i +@WITH_PYTHON_TRUE@ swig -python -c++ hdate.i + +@WITH_PYTHON_TRUE@install-data-local: _hdate.so +@WITH_PYTHON_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH) +@WITH_PYTHON_TRUE@ $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so +@WITH_PYTHON_TRUE@ $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/cflags.patch/configure.in b/.pc/cflags.patch/configure.in new file mode 100644 index 0000000..69b54a0 --- /dev/null +++ b/.pc/cflags.patch/configure.in @@ -0,0 +1,345 @@ +AC_INIT(src/hdate.h) + +dnl Set release number +PACKAGE=libhdate +LIBHDATE_MAJOR_VERSION=1 +LIBHDATE_MINOR_VERSION=6 +LIBHDATE_MICRO_VERSION=02 + +VERSION=$LIBHDATE_MAJOR_VERSION.$LIBHDATE_MINOR_VERSION.$LIBHDATE_MICRO_VERSION + +dnl libtool library numbering +VERSION_INFO=$LIBHDATE_MAJOR_VERSION:$LIBHDATE_MINOR_VERSION:0 + +AC_SUBST(VERSION_INFO) + +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AM_MAINTAINER_MODE + +dnl Checks for programs. +AC_ISC_POSIX +AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_STDC_HEADERS +AM_PROG_LIBTOOL + +AM_MAINTAINER_MODE + +AC_C_CONST +AC_CONFIG_MACRO_DIR([m4]) +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + +CFLAGS=" -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie" +LIBS=-lm + +dnl ======================================================================================= + +AC_CHECK_PROG(have_swig, "swig", yes, no) + +dnl ======================================================================================= + +AC_CHECK_PROG(have_fpc, "fpc", yes, no) + +build_fpc=$have_fpc + +AC_ARG_ENABLE([fpc], + [AS_HELP_STRING([--disable-fpc], + [do not build free pascal binding])], + [build_fpc=no], [build_fpc=$have_fpc]) + +if test "$have_fpc" = "yes"; then + PA_VERSION=`fpc -iV` + PA_TPR=`fpc -iTP` + PA_TOS=`fpc -iTO` + PA_MODULES_PATH="/usr/lib/fpc/$PA_VERSION/units/$PA_TPR-$PA_TOS" + AC_SUBST([PA_VERSION]) + AC_SUBST([PA_MODULES_PATH]) +fi + +dnl ======================================================================================= + +AC_CHECK_PROG(have_gpc, "gpc", yes, no) + +build_gpc=$have_gpc + +AC_ARG_ENABLE([gpc], + [AS_HELP_STRING([--disable-gpc], + [do not build gnu pascal binding])], + [build_gpc=no], [build_gpc=$have_gpc]) + +if test "$have_gpc" = "yes"; then + GP_MODULES_PATH=`gpc -print-search-dirs | grep install | cut -d' ' -f 2` + AC_SUBST([GP_MODULES_PATH]) +fi + +dnl ======================================================================================= + +AM_CONDITIONAL(WITH_GPC_FPC, [test "$build_fpc" = "yes" -a "$build_gpc" = "yes" ]) +AM_CONDITIONAL(WITH_GPC, [test "$build_gpc" = "yes" -a "$build_fpc" != "yes" ]) +AM_CONDITIONAL(WITH_FPC, [test "$build_gpc" != "yes" -a "$build_fpc" = "yes" ]) + +dnl ======================================================================================= + +AC_CHECK_PROG(have_python, "python", yes, no) + +build_python=$have_python + +AC_ARG_ENABLE([python], + [AS_HELP_STRING([--disable-python], + [do not build python binding])], + [build_python=no], [build_python=$have_python]) + +AC_ARG_WITH(python-sitelib-dir, + [AS_HELP_STRING([--with-python-sitelib-dir=PATH], + [path to python site lib])]) + +if test "$have_python" = "yes"; then + PY_PREFIX=`python -c 'import sys ; print sys.prefix'` + PY_VERSION=`python -c 'import sys ; print sys.version[[0:3]]'` + AC_MSG_CHECKING(for $PY_PREFIX/include/python$PY_VERSION/Python.h) + if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then + AC_MSG_RESULT(yes) + PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" + + if test "$with_python_sitelib_dir" = "" ; then + PY_MODULES_PATH="$PY_PREFIX/lib/python$PY_VERSION/dist-packages" + else + PY_MODULES_PATH=$with_python_sitelib_dir + fi + + AC_SUBST([PY_VERSION]) + AC_SUBST([PY_CFLAGS]) + AC_SUBST([PY_MODULES_PATH]) + if test "$have_swig" = "no"; then + build_python=no + fi + else + AC_MSG_RESULT(no) + build_python=no + fi +fi + +AM_CONDITIONAL(WITH_PYTHON, test "$build_python" = "yes") + +dnl ======================================================================================= + +AC_CHECK_PROG(have_ruby, "ruby", yes, no) + +build_ruby=$have_ruby + +AC_ARG_ENABLE([ruby], + [AS_HELP_STRING([--disable-ruby], + [do not build ruby binding])], + [build_ruby=no], [build_ruby=$have_ruby]) + +AC_ARG_WITH(ruby-sitelib-dir, + [AS_HELP_STRING([--with-ruby-sitelib-dir=PATH], + [path to ruby site lib])]) + +if test "$have_ruby" = "yes"; then + RU_PREFIX=`ruby -e 'require "mkmf"; puts $topdir'` + RU_VERSION=`ruby -e "require 'mkmf'; puts config_string('MAJOR')"` + RU_VERSION+=.`ruby -e "require 'mkmf'; puts config_string('MINOR')"` + AC_MSG_CHECKING(for $RU_PREFIX/ruby.h) + if test -f $RU_PREFIX/ruby.h; then + AC_MSG_RESULT(yes) + RU_CFLAGS="-I$RU_PREFIX" + + if test "$with_ruby_sitelib_dir" = "" ; then + RU_MODULES_PATH="$RU_PREFIX" + else + RU_MODULES_PATH=$with_ruby_sitelib_dir + fi + + AC_SUBST([RU_VERSION]) + AC_SUBST([RU_CFLAGS]) + AC_SUBST([RU_MODULES_PATH]) + if test "$have_swig" = "no"; then + build_ruby=no + fi + else + AC_MSG_RESULT(no) + build_ruby=no + fi +fi + +AM_CONDITIONAL(WITH_RUBY, test "$build_ruby" = "yes") + +dnl ======================================================================================= + +AC_CHECK_PROG(have_php, "php", yes, no) + +build_php=$have_php + +AC_ARG_ENABLE([php], + [AS_HELP_STRING([--disable-php], + [do not build php binding])], + [build_php=no], [build_php=$have_php]) + +AC_ARG_WITH(php-sitelib-dir, + [AS_HELP_STRING([--with-php-sitelib-dir=PATH], + [path to php site lib])]) + +if test "$have_php" = "yes"; then + AC_CHECK_PROG(have_php_config, "php-config5", yes, no) + if test "$have_php_config" = "yes"; then + + PH_CONFIG_PATH=`php --ini | grep "Scan" | cut -d: -f2 | sed 's/\s//g'` + PH_INCLUDE_PATH=`php -r "echo get_include_path();" | cut -f2 -d:` + if test "$with_php_sitelib_dir" = "" ; then + PH_MODULES_PATH=`php-config5 --extension-dir` + else + PH_MODULES_PATH=$with_php_sitelib_dir + fi + + AC_SUBST([PH_CONFIG_PATH]) + AC_SUBST([PH_INCLUDE_PATH]) + AC_SUBST([PH_MODULES_PATH]) + if test "$have_swig" = "no"; then + build_php=no + fi + else + AC_MSG_RESULT(no) + build_php=no + fi +fi + +AM_CONDITIONAL(WITH_PHP, test "$build_php" = "yes") + +dnl ======================================================================================= + +AC_CHECK_PROG(have_perl, "perl", yes, no) + +build_perl=$have_perl + +AC_ARG_ENABLE([perl], + [AS_HELP_STRING([--disable-perl], + [do not build perl binding])], + [build_perl=no], [build_perl=$have_perl]) + +AC_ARG_WITH(perl-sitelib-dir, + [AS_HELP_STRING([--with-perl-sitelib-dir=PATH], + [path to perl site lib])]) + +if test "$have_perl" = "yes"; then + PE_PREFIX=`(perl -e 'use Config; print $Config{archlib};')` + AC_MSG_CHECKING(for $PE_PREFIX/CORE/perl.h) + if test -f $PE_PREFIX/CORE/perl.h; then + AC_MSG_RESULT(yes) + PE_CFLAGS="-I$PE_PREFIX/CORE " + PE_CFLAGS=$PE_CFLAGS`(perl -e 'use Config; print $Config{cppflags};')` + + if test "$with_perl_sitelib_dir" = "" ; then + PE_MODULES_PATH=`(perl -e 'use Config; print $Config{sitelib};')` + else + PE_MODULES_PATH=$with_perl_sitelib_dir + fi + + AC_SUBST([PE_CFLAGS]) + AC_SUBST([PE_MODULES_PATH]) + if test "x$have_swig" = "xno"; then + build_perl=no + fi + else + AC_MSG_RESULT(no) + build_perl=no + fi +fi + +AM_CONDITIONAL(WITH_PERL, test "$build_perl" = "yes") + +dnl ======================================================================================= + +dnl gettext + +dnl Languages which your application supports +ALL_LINGUAS="he es_MX ru fr sv" +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.18.1]) + +if test "$DATADIRNAME" = ""; then + DATADIRNAME="share" + AC_SUBST(DATADIRNAME) +fi + +localepath=`eval eval echo ${localedir}` + +AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${localepath}") + +dnl ======================================================================================= + +build_hcal=yes + +AC_ARG_ENABLE([hcal], + [AS_HELP_STRING([--disable-hcal], + [do not build hcal/hdate utility programs])], + [build_hcal=no], [build_hcal=yes]) + +AM_CONDITIONAL(WITH_HCAL, test "$build_hcal" = "yes") + +dnl ======================================================================================= + +AC_SUBST(CFLAGS) +AC_SUBST(LIBS) + +dnl ======================================================================================= + +AC_OUTPUT([ +Makefile +libhdate.pc +po/Makefile.in +docs/Makefile +docs/man/Makefile +docs/man/man1/Makefile +docs/man/man3/Makefile +src/Makefile +examples/Makefile +examples/hcal/Makefile +examples/bindings/Makefile +examples/bindings/pascal/Makefile +bindings/Makefile +bindings/python/Makefile +bindings/perl/Makefile +bindings/pascal/Makefile +bindings/ruby/Makefile +bindings/php/Makefile +]) + +dnl =========================================================================================== + +echo " +$PACKAGE-$VERSION + + prefix: ${prefix} + compiler: ${CC} + locale-dir: $localepath + + have swig ${have_swig} + have free pascal ${have_fpc} + have gnu pascal ${have_gpc} + have python ${have_python} + have perl ${have_perl} + have ruby ${have_ruby} + have php ${have_php} php-dev,php-cli ${have_php_config} + + build hcal ${build_hcal} + + build python binding ${build_python} + build perl binding ${build_perl} + puild free pascal binding ${build_fpc} + puild ruby binding ${build_ruby} + puild php binding ${build_php} + + perl site lib path: $PE_MODULES_PATH + python site lib path: $PY_MODULES_PATH + free pascal site lib path: $PA_MODULES_PATH + gnu pascal site lib path: $GP_MODULES_PATH + ruby site lib path: $RU_MODULES_PATH + php site lib path: $PH_MODULES_PATH + php config path: $PH_CONFIG_PATH + php include path: $PH_INCLUDE_PATH +" diff --git a/.pc/clang.patch/examples/hcal/hcal.c b/.pc/clang.patch/examples/hcal/hcal.c new file mode 100644 index 0000000..ba28542 --- /dev/null +++ b/.pc/clang.patch/examples/hcal/hcal.c @@ -0,0 +1,2020 @@ +/* hcal.c http://libhdate.sourceforge.net + * Hebrew calendar (part of package libhdate) + * + * compile: + * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal + * + * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include // For printf +#include // For hebrew date +//#include "../../src/hdate.h" +#include // For atoi, malloc +#include // For setlocale +#include // For getopt_long +#include // For strlen, mempcpy +#include // For time, tzset +//#include // for unicode character operations + +#define FALSE 0 +#define TRUE -1 +#define SHABBAT 7 + +#define HDATE_STRING_SHORT 1 + +// for opt.menu[MAX_MENU_ITEMS] +#define MAX_MENU_ITEMS 10 + + + +// for colorization +#define CODE_REVERSE_VIDEO "%c[7m", 27 +#define CODE_RESTORE_VIDEO "%c[m", 27 +#define CODE_BLACK "%c[30m", 27 +#define CODE_LIGHT_RED "%c[31m", 27 +#define CODE_LIGHT_GREEN "%c[32m", 27 +#define CODE_LIGHT_BROWN "%c[33m", 27 +#define CODE_DARK_BLUE "%c[34m", 27 +#define CODE_LIGHT_PURPLE "%c[35m", 27 +#define CODE_LIGHT_AQUA "%c[36m", 27 +#define CODE_LIGHT_GREY "%c[37m", 27 +#define CODE_BOLD_GREY "%c[1;30m", 27 +#define CODE_BOLD_RED "%c[1;31m", 27 +#define CODE_BOLD_GREEN "%c[1;32m", 27 +#define CODE_BOLD_YELLOW "%c[1;33m", 27 +#define CODE_BOLD_BLUE "%c[1;34m", 27 +#define CODE_BOLD_PURPLE "%c[1;35m", 27 +#define CODE_BOLD_AQUA "%c[1;36m", 27 +#define CODE_BOLD_WHITE "%c[1;37m", 27 +#define ELEMENT_WEEKDAY_G 1 +#define ELEMENT_WEEKDAY_H 2 +#define ELEMENT_SHABBAT_DAY 3 +#define ELEMENT_HOLIDAY_DAY 4 +#define ELEMENT_HOLIDAY_FLAG 5 +#define ELEMENT_SHABBAT_NAME 6 +#define ELEMENT_WEEKDAY_NAMES 7 +#define ELEMENT_MONTH_G 8 +#define ELEMENT_MONTH_H 9 +#define ELEMENT_SHABBAT_TIMES 10 +#define ELEMENT_PARASHA 11 +#define ELEMENT_THIS_SHABBAT_TIMES 12 +#define ELEMENT_THIS_PARASHA 13 +#define ELEMENT_HOLIDAY_NAME 14 +#define ELEMENT_TODAY_HOLIDAY_DAY 15 +#define ELEMENT_TODAY_HOLIDAY_NAME 16 + +/************************************************** +* functions to support hcal and hdate +**************************************************/ +#include "./local_functions.c" + + + +static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' }; +/* Holiday types: (reference hdate_holyday.c) + / - 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 +*/ + + + +typedef struct { + int html; + int external_css; + int diaspora; + int parasha; + int shabbat; + int candles; + int havdalah; + int no_reverse; + int three_month; + int colorize; + int footnote; + int jd_today_g; + int jd_today_h; + int force_hebrew; + int force_israel; + int not_sunset_aware; + int quiet_alerts; + int bidi; + double lat; + double lon; + int tz; + int menu; + char* menu_item[MAX_MENU_ITEMS]; + } option_list; + +typedef struct { + int g_month_1; + int g_year_1; + int g_month_2; + int g_year_2; + int h_month_1; + int h_year_1; + int h_month_2; + int h_year_2; + } header_info; + + +const char* hcal_config_file_text = N_("\ +# configuration file for hcal - Hebrew calendar program\n\ +# part of package libhdate\n\ +#\n# Should you mangle this file and wish to restore its default content,\n\ +# rename or delete this file and run hcal; hcal will automatically\n\ +# regenerate the default content.\n#\n\ +# Your system administrator can set system-wide defaults for hcal by\n\ +# modifying file .\n\ +# You may override all defaults by changing the contents of this file.\n\ +#\n\ +# Version information\n\ +# This may be used by updates to hcal to determine how to parse the file\n\ +# and whether additional information and options should be appended to\n\ +# the end of this file.\n\ +VERSION=2.00\n\ +# Location awareness\n\ +# hcal wants to accurately highlight the current Hebrew day, including\n\ +# during the hours between sunset and secular midnight. If you don't\n\ +# provide it with latitude, longitude, and time zone information, hcal\n\ +# will try to guess the information, based upon your system timezone,\n\ +# and its (limited, and maybe biased) of the dominant Jewish community\n\ +# in that timezone. When hcal is forced to guess, it alerts the user\n\ +# with a message that includes the guessed location.\n\ +# hcal's guesses will also affect its default behaviour for output of\n\ +# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\ +#SUNSET_AWARE=TRUE\n\ +# LATITUDE and LONGITUDE may be in decimal format or in the form\n\ +# degrees[:minutes[:seconds]] with the characters :'\" as possible\n\ +# delimiters. Use negative values to indicate South and West, or\n\ +# use the abbreviated compass directions N, S, E, W.\n\ +#LATITUDE=\n\ +#LONGITUDE=\n\ +# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\ +# with the characters :'\" as possible delimiters.\n\ +#TIMEZONE=\n\n\ +# Israel and the diaspora\n\ +# If hcal guesses that you're not in Israel, the DIASPORA option will be\n\ +# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\ +# forces hcal to display calendar information for Israel, using hcal's\n\ +# default coordinates foe Israel, or coordinates that you provide that\n\ +# seem legitmately within Israel.\n\ +# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\ +# Sukkot, set BOTH flags true in order to see holiday information for\n\ +# a non-resident vistor to Israel. The command line options for these\n\ +# features are --israel, -I, --diaspora, -d.\n\ +#FORCE_DIASPORA=FALSE;\n\ +#FORCE_ISRAEL=FALSE;\n\n\ +# Shabbat related\n\ +# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\ +# The command line options for these features are -p (--parasha), and\n\ +# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\ +# before sunset). The HAVDALAH field can accept a value of 20 - 90\n\ +# (minutes after sunset).\n\ +#PARASHA_NAMES=FALSE\n\ +#SHABBAT_INFO=FALSE\n\ +#CANDLE_LIGHTING=FALSE\n\ +#HAVDALAH=FALSE\n\n\ +# Holiday identification\n\ +# hcal flags holidays by replacing the gregorian/Hebrew date separator\n\ +# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\ +# will have hcal output after the month's calendar, a list of the month's\n\ +# holidays along with the days on which they occur.\n\ +#FOOTNOTE=FALSE\n\n\ +# Output in hebrew characters\n\ +# hcal defaults to output all information in your default language, so\n\ +# if your default language is Hebrew, you're all set. Otherwise, you can\n\ +# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\ +# still outputting gregorian information in your default language. To\n\ +# output ALL information in Hebrew, run something like this:\n\ +# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\ +# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\ +# output, you need to install a terminal font that includes the Hebrew\n\ +# character set (hint: unicode).\n\ +# The command line option for FORCE_HEBREW is either --hebrew or -H\n\ +#FORCE_HEBREW=FALSE\n\n\ +# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\ +# Unfortunately, the world can not be depended upon to be either. Most\n\ +# Xwindow applications will display the data fine with FORCE_HEBREW; most\n\ +# xterm implementations will not. (in fact, the only xterm clone I know\n\ +# of that comes close is mlterm). If using FORCE_HEBREW results in\n\ +# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\ +# This will reverse the order of the Hebrew characters, so they will\n\ +# display 'visual'ly correct; however, such output will not be suitable\n\ +# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\ +# automatically forces hebrew.\n\ +# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\ +#OUTPUT_BIDI=FALSE\n\n\ +# Display enhancements\n\ +# hcal defaults to display the current day in reverse video\n\ +# The command line option for this feature is --no-reverse\n\ +#SUPPRESS_REVERSE_VIDEO=FALSE;\n\ +# hcal can display its output \"calming, muted tones\". Note that piping\n\ +# colorized output may yield unexpected results.\n\ +#COLORIZE=FALSE\n\n\ +# HTML OUTPUT\n\ +#OUTPUT_HTML=FALSE\n\ +#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\ +# Suppress alerts and warnings\n\ +# hcal alerts the user via STDERR when it guesses the user's location.\n\ +#QUIET_ALERTS=FALSE\n\n\ +# Three month display\n\ +# hcal can display a previous, current and next month side-by-side. hcal\n\ +# can also display a calendar for an entire year in four rows of three\n\ +# months each. Note that this will display properly only if your console\n\ +# is set for at least 127 columns. Note also that setting this option to\n\ +# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\ +#THREE_MONTH=FALSE\n\n\ +# User-defined menus\n\ +# You may specify here command-line strings to optionally be parsed\n\ +# by hcal at execution time. To do so, use the command line option -m\n\ +# (--menu). hcal will process first the settings of this config file,\n\ +# then the other settings of your command line, and then will prompt\n\ +# you for which menu item you would like to select. hcal will process\n\ +# your menu selection as if it were a new command line, further modifying\n\ +# all the prior settings.\n\ +# Only the first ten \"MENU=\" entries will be read. Each line will be\n\ +# truncated at one hundred characters\n\ +#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\ +#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\ +#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\ +#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\ +"); + + +/************************************************** +* print version +*************************************************/ +int print_version () +{ + printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6")); + return 0; +} + +/************************************************** +* print usage +*************************************************/ +void print_usage_hcal () +{ + printf ("%s\n", +N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\ + coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\ + -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\ + timezone: -z nn[( .nn | :mm )]\n\ +Try \'hcal --help\' for more information")); +} + +/************************************************** +* print help +*************************************************/ +void print_help () +{ + print_usage_hcal(); + printf ("%s\n", +N_("Hebrew calendar\nOPTIONS:\n\ + -1 --one-month over-ride config file setting if you had set\n\ + option --three-month as a default there\n\ + -3 --three-month displays previous/next months\n\ + side by side. requires 127 columns\n\ + -b --bidi prints hebrew in reverse (visual)\n\ + --visual\n\ + --no-bidi over-ride config file setting if you had set\n\ + --no-visual option -bidi as a default there\n\ + -c --colorize displays in calming, muted tones\n\ + --no-color over-ride a --colorize setting in your config file\n\ + -d --diaspora use diaspora reading and holidays.\n\ + -f --footnote print descriptive notes of holidays\n\ + --no-footnote over-ride a footnote setting in your config file\n\ + -h --html output in html format to stdout\n\ + -H --hebrew print hebrew information in Hebrew\n\ + -i use external css file \"./hcal.css\".\n\ + -I --israel override a diaspora default\n\ + --no-reverse do not highlight today's date\n\ + -m --menu prompt user-defined menu from config file\n\ + -p --parasha print week's parasha on each calendar row\n\ + -q --quiet-alerts suppress warning messages\n\ + -s --shabbat print Shabbat times and parshiot\n\ + --candles modify default minhag of 20 minutes. (17\n\ +\n\ +\n\ +\n\ +\n\ +\n"); + + /* some alternative css styles */ + printf ("\n\ +\n\ +\n\ +\n"); + + if ( (force_hebrew) || (hdate_is_hebrew_locale()) ) + printf ("Hebrew Calendar\n\n
\n"); + else + printf ("Hebrew Calendar\n\n
\n"); + + return 0; +} + + + +/************************************************** + * HTML - print footer + *************************************************/ +int print_html_footer () +{ + printf ("\n"); + + printf ("\n"); + + return 0; +} + + +/************************************************** +* Print HTML header - month line +*************************************************/ +void print_header_month_line_html( const header_info header) +{ + + // TODO - fix bug ellul xxxx - tishrei xxxx+1 +// char *h_year_1; +// h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *h_year_1 = NULL; + + /************************************************** + * Print Gregorian month and year + **************************************************/ + printf ("\n", + hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL), + header.g_year_1); + + h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW); + /************************************************** + * Print Hebrew month and year + **************************************************/ + printf ("
%s %d"); + if (header.h_month_1 != header.h_month_2) + { + printf ("%s-", + hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + } + printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + printf ("\n"); + printf ("%s
\n", h_year_1); + + printf ("\n\n"); + + + if (h_year_1 != NULL) free(h_year_1); +} + + +/************************************************** +* HTML - print column headings for days of weeks +**************************************************/ +void print_header_dow_line_html() +{ + int j; + + for (j = 1; j < 8; j++) + printf ("", + hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE)); +} + + + +/************************************************** + * end HTML functions + *************************************************/ + + +/************************************************* +* Display data in a more pleasing visual manner +*************************************************/ +void colorize_element ( const int element ) +{ + switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; + } +/* switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; +*/ +} + + + +/************************************************** + * print header - month line to stdout + *************************************************/ +void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi ) +{ + char *g_month, *h1_month, *h2_month; + char *h1_year = NULL; + char *h2_year = NULL; + size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len; + + + char *hebrew_buffer, *hebrew_buffer_next; + size_t hebrew_buffer_len, literals_len; + + int j; + size_t padding = 0; + + + /************************************************** + * Print Gregorian month and year + *************************************************/ + g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL); + if (colorize) colorize_element(ELEMENT_MONTH_G); + printf ("%s %d", g_month, header.g_year_1); + if (colorize) printf(CODE_RESTORE_VIDEO); + + /************************************************** + * Print Hebrew month and year + * + * because we want this printed right-justified on + * the same line, we need to calculate how many + * spaces to pad. + * + * because of the possible user option --bidi, we + * need to buffer the entire Hebrew text in order + * reverse its sequence for 'visual' display. + * + * This all requires collecting the data first + * and determining each's length. + *************************************************/ + + #define CALENDAR_WIDTH 41 + #define DASH_WIDTH 3 // includes surrounding spaces + #define SPACE_WIDTH 1 + + + /************************************************* + * padding info for gregorian date + *************************************************/ + g_month_len = strlen(g_month); + g_year_len = 4; + switch (header.g_year_1) + { + case 1-9: g_year_len = 1; break; + case 10-99: g_year_len = 2; break; + case 100-999: g_year_len = 3; break; + } + + + /************************************************** + * collect padding info for Hebrew date + *************************************************/ + h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew); + h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew); +//printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0); + + h1_month_len = strlen(h1_month); + h1_year_len = strlen(h1_year); +// DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len); +// DEBUG - int ii; for (ii=0; ii\n"); + else printf ("\n"); + + + /************************************************** + * print column headings for days of weeks + **************************************************/ + if (opt.html) print_header_dow_line_html(); + else + { + if (opt.three_month) + { + print_header_dow_line_stdout(opt.colorize); + printf(" "); + } + print_header_dow_line_stdout(opt.colorize); + if (opt.three_month) + { + printf(" "); + print_header_dow_line_stdout(opt.colorize); + } + } + + /************************************************** + * terminate line + **************************************************/ + if (opt.html) printf ("\n"); + else printf ("\n"); + + return 0; +} + + +/************************************************** +* print HTML calendar entry (ie. a single day) +*************************************************/ +void print_day_html ( const hdate_struct h, const int month, const option_list opt) +{ + + int holiday_type; +// char *hd_day; +// hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *hd_day_str = NULL; + + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + + if (h.gd_mon != month) printf ("\n"); + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print stdout calendar entry (ie. a single day) +*************************************************/ +void print_day ( const hdate_struct h, const int month, const option_list opt) +{ + + // for forcing Hebrew printing of Hebrew data + //char *language; + + // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1); + char *hd_day_str = NULL; + + size_t hd_day_buffer_str_len; + + int holiday_type; + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + /************************************************** + * out of month - needs padding + *************************************************/ + if (h.gd_mon != month) printf(" "); + + + /************************************************** + * in month - print the data + *************************************************/ + else + { + /************************************************* + * Gregorian date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_g) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_G); + } + + /************************************************* + * Gregorian date entry - the day of the month + *************************************************/ + // this next line is necessary to align numbers + // correctly with bidi (tested using mlterm) + if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) ) + printf ("%d ", h.gd_day); + else printf ("%2d", h.gd_day); + + /************************************************* + * Gregorian date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_g) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + + /************************************************* + * holiday flag + *************************************************/ + printf ("%c", holiday_flag[holiday_type]); + + + /************************************************* + * Hebrew date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_h) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_H); + } + + + /************************************************* + * Hebrew date entry - day of the month + *************************************************/ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew); + if (opt.bidi) + { + hd_day_buffer_str_len = (size_t) strlen(hd_day_str); + if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE) + hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1; + revstr(hd_day_str, hd_day_buffer_str_len); + } + if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) && + ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) ) + { // need to pad Hebrew dates 1-10, 20, 30 + printf ("%s%s"," ",hd_day_str); + } + else printf ("%2s", hd_day_str); + + /************************************************* + * Hebrew date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_h) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + } + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print a calendar week's entry (ie. seven columns) +*************************************************/ +void print_week( int jd, const int month, const option_list opt) +{ +#define long_parasha_name 0 + + hdate_struct h; + + int calendar_column; + + // for opt.shabbat + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + int this_week; + hdate_struct yom_shishi; + + // for opt.parasha + int shabbat_name; + char *shabbat_name_str, *shabbat_name_buffer; + size_t shabbat_name_str_len; + + + // for forcing Hebrew printing of Hebrew data + //char *language; + + + /************************************************** + * for each column of calendar + *************************************************/ + for (calendar_column = 0; calendar_column < 7; calendar_column++) + { + + /************************************************** + * Get this day's information + *************************************************/ + hdate_set_jd (&h, jd); + if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) ) + yom_shishi = h; + + + /************************************************** + * HTML calendar option + *************************************************/ + if (opt.html) print_day_html ( h, month, opt ); + + + + /************************************************** + * non-HTML calendar option + *************************************************/ + else print_day ( h, month, opt); + + + /************************************************** + * space between days of week + *************************************************/ + if (calendar_column != 6) printf (" "); + + /************************************************** + * advance to next day of week + *************************************************/ + jd++; + } + + /************************************************** + * print end of calendar line + *************************************************/ + if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) ) + { + + /******************************************************** + * determine whether this line gets special highlighting + ********************************************************/ + if ((opt.colorize) + && ((opt.shabbat) || (opt.parasha)) + && ((jd - 1) > opt.jd_today_h) + && (((jd - 1) - opt.jd_today_h) < 7) ) + this_week = TRUE; + else this_week = FALSE; + + /************************************************* + * print shabbat times + *************************************************/ + if (opt.shabbat) + { + // candlelighting times + /// note: compiler incorrectly issued warnings: + /// "may be used uninitialized in this function [-Wmaybe-uninitialized]" + /// The initialization occurs above (~line 1005) "yom_shishi = h" + hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year, + opt.lat, opt.lon, &sunrise, &sunset); + + // FIXME - allow for further minhag variation + if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz; + else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf (" %02d:%02d", sunset / 60, sunset % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + + printf(" - "); + + // motzay shabat time + hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat, + opt.lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + + // FIXME - allow for further minhag variation + if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz; + else three_stars = three_stars + opt.tz; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf ("%02d:%02d", three_stars / 60, three_stars % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + + + /************************************************* + * print shabbat name + *************************************************/ + if (opt.parasha) + { + + /************************************************* + * print shabbat name - force-hebrew setup + *************************************************/ + // BUG - this isn't thread-safe + /*if (opt.force_hebrew) + { + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + + + shabbat_name = hdate_get_parasha (&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_PARASHA, shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + else + { + shabbat_name = hdate_get_holyday(&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_HOLIDAY, + shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + } + if (shabbat_name) + { + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_PARASHA); + else colorize_element(ELEMENT_PARASHA); + } + if (opt.bidi) + { + shabbat_name_str_len = strlen(shabbat_name_str); + shabbat_name_buffer = malloc(shabbat_name_str_len+1); + memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len); + shabbat_name_buffer[shabbat_name_str_len] = '\0'; + revstr(shabbat_name_buffer, shabbat_name_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 15; + printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer); + + free(shabbat_name_buffer); + } + else printf(" %s", shabbat_name_str); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + } + } +} + + + + +/************************************************** +* print month table +*************************************************/ +int print_calendar ( const int current_month, const int current_year, const option_list opt) +{ + hdate_struct h; + int calendar_line; + int max_calendar_lines = 4; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int previous_month = 1, next_month = 1; + int previous_year, next_year; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int jd_current_month, jd_previous_month = 1, jd_next_month = 1; + + void how_many_calendar_lines( int month, int start_dow ) + { + switch (month) + { + case 4: + case 6: + case 9: + case 11: if (start_dow == 7) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: if (start_dow > 5) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5; + break; + } + } + + /********************************************************* + * Preliminaries: + * - Find the first sunday(s) of each calendar + * - Find number of calendar lines + *********************************************************/ + hdate_set_gdate (&h, 1, current_month, current_year); + jd_current_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * three months, side-by-side + *********************************************************/ + if (opt.three_month) + { + /********************************************************* + * previous month + *********************************************************/ + if (current_month == 1) + { + previous_month = 12; + previous_year = current_year - 1; + } + else + { + previous_month = current_month - 1; + previous_year = current_year; + } + hdate_set_gdate (&h, 1, previous_month, previous_year); + jd_previous_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * next month + *********************************************************/ + if (current_month == 12) + { + next_month = 1; + next_year = current_year + 1; + } + else + { + next_month = current_month + 1; + next_year = current_year; + } + hdate_set_gdate (&h, 1, next_month, next_year); + jd_next_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + } + + + + /************************************************** + * maximum six lines of calendar + **************************************************/ + for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++) + { + if (opt.html) printf ("\n"); + + if (opt.three_month) + { + print_week(jd_previous_month, previous_month, opt); + jd_previous_month = jd_previous_month + 7; + printf(" "); + } + + print_week(jd_current_month, current_month, opt); + jd_current_month = jd_current_month + 7; + + + if (opt.three_month) + { + printf(" "); + print_week(jd_next_month, next_month, opt); + jd_next_month = jd_next_month + 7; + } + + if (opt.html) printf ("\n"); + else printf ("\n"); + } + + + /************************************************** + * print end of calendar + *************************************************/ + if (opt.html) printf ("
%3s
"); + else if (h.hd_dw == SHABBAT) printf (""); + else if (holiday_type) printf (""); + else printf (""); + + /* Print a day */ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew); + printf ("\n\ +", + h.gd_day, + hd_day_str, + hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew)); + if (holiday_type) printf ("", + hdate_string( HDATE_STRING_HOLIDAY, + hdate_get_holyday (&h, opt.diaspora), + HDATE_STRING_SHORT, HDATE_STRING_LOCAL) + ); + else printf (""); + + printf ("
%2d%3s %s
 
%s
 
\n
"); + + return 0; +} + + + + + + +/**************************************************** +* print month header, month table, month footnotes +****************************************************/ +int print_month ( const int month, const int year, const option_list opt) +{ + hdate_struct h; + + // following are for opt.footnote + int jd_counter, holiday; + //char *language; // for forcing Hebrew printing of footnote + + + /* check if hebrew year (year > 3000) */ + if (year > 3000) hdate_set_hdate (&h, 1, month, year); + else hdate_set_gdate (&h, 1, month, year); + + + print_header (h.gd_mon, h.gd_year, opt); + print_calendar (h.gd_mon, h.gd_year, opt); + printf("\n"); + + + /**************************************************** + * print footnotes + ****************************************************/ + if (opt.footnote) + { + jd_counter = h.hd_jd; + while ( month == h.gd_mon ) + { + holiday = hdate_get_holyday(&h, opt.diaspora); + if (holiday) + { + print_day ( h, month, opt); + /*if (opt.force_hebrew) + { + // BUG - this isn't thread-safe + // --- and it may no longer be nexessary anywhere + // in the code now that I've embedded Hebrew + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + if (opt.colorize) + { + if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME); + else colorize_element(ELEMENT_HOLIDAY_NAME); + } + + if (opt.bidi) + { + char *holiday_str, *holiday_buffer; + size_t holiday_str_len; + holiday_str = hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew); + + holiday_str_len = strlen(holiday_str); + holiday_buffer = malloc(holiday_str_len+1); + memcpy(holiday_buffer, holiday_str, holiday_str_len); + holiday_buffer[holiday_str_len] = '\0'; + revstr(holiday_buffer, holiday_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 16; // 15 fails because of jabotinsky in july + printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer); + + free(holiday_buffer); + } + else printf (" %s\n", + hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew)); + + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + } + jd_counter++; + hdate_set_jd (&h, jd_counter); + } + } + return 0; +} + + +/**************************************************** +* read and parse config file +****************************************************/ +void read_config_file( FILE *config_file, + option_list *opt, + double* latitude, + int* opt_latitude, + double* longitude, + int* opt_longitude, + int* tz ) + +{ + char *input_string; + size_t input_str_len = 100; // WARNING: if you change this value + // you will still have to also + // change a matching value below + // in the statement that includes: + // match_count = sscanf(input_string + char *input_key = ""; + char *input_value = ""; + int line_count = 0; + int menu_item = 0; + size_t menu_len = 0; + int match_count; + int end_of_input_file = FALSE; + int i; + const int num_of_keys = 20; + const char* key_list[] = { "SUNSET_AWARE", // 0 + "LATITUDE", + "LONGITUDE", // 2 + "TIMEZONE", + "DIASPORA", // 4 + "FORCE_ISRAEL", + "PARASHA_NAMES", // 6 + "SHABBAT_INFO", + "FOOTNOTES", // 8 + "FORCE_HEBREW", + "OUTPUT_BIDI", //10 + "SUPPRESS_REVERSE_VIDEO", + "COLORIZE", //12 + "OUTPUT_HTML", + "USE_EXTERNAL_CSS_FILE", + "QUIET_ALERTS", + "THREE_MONTH", //16 + "MENU", + "CANDLE_LIGHTING", //18 + "HAVDALAH" + }; + + input_string = malloc(input_str_len+1); + input_key = malloc(input_str_len+1); + input_value = malloc(input_str_len+1); + while ( end_of_input_file!=TRUE ) + { + end_of_input_file = getline(&input_string, &input_str_len, config_file); + if ( end_of_input_file!=TRUE ) + { + errno = 0; + // The '100' in the next statement is inelegant; it is meant to + // be the value of input_str_len. Alternatively, don't malloc + // input_value above, use the 'a' specifier here, and free(input_value) + // at the end of every successful read and evaluation + match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value); + line_count++; + if (errno != 0) error(0,errno,"scan error at line %d", line_count); +// DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s", +// line_count, match_count, input_key, input_value, input_string); + if (match_count ==2) + { + for (i=0; inot_sunset_aware = 1; + else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0; + break; + case 1: + parse_coordinate(1, input_value, latitude, opt_latitude); + break; + case 2: + parse_coordinate(2, input_value, longitude, opt_longitude); + break; + case 3: + parse_timezone(input_value, tz); + break; + case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1; + break; + case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1; + break; + case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1; + break; + case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->shabbat = 1; + opt->parasha = 1; + } + break; + case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1; + break; + case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1; + break; + case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->bidi = 1; + opt->force_hebrew = 1; + } + break; + case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1; + break; + case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1; + break; + case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->html = 1; + break; + case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1; + break; + case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1; + break; + case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1; + break; + +// MENU + case 17:if (menu_item < MAX_MENU_ITEMS) + { + menu_len = strlen(input_value); + opt->menu_item[menu_item] = malloc(menu_len+1); + memcpy(opt->menu_item[menu_item], input_value,menu_len); + menu_item++; + } + break; +// CANDLE_LIGHTING + case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(input_value); + if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES; + else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES; + } + break; + +// HAVDALAH + case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(input_value); + if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES; + else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES; + } + break; + + } // end of switch(i) + break; // if found a match don't continue for loop + } + } + } + } + } + free(input_string); + free(input_key); + free(input_value); + return; +} + + +/**************************************************** +* exit elegantly +****************************************************/ +void exit_main( option_list *opt, const int exit_code) +{ + int i; + for (i=0; imenu_item[i] == NULL) break; + free(opt->menu_item[i]); + } + exit (exit_code); +} + + +/**************************************************** +* parse a command-line or a config-file menu line +* +* It was appropriate to make this a function, outside +* of main, because of its dual use and dual reference +****************************************************/ +int hcal_parser( const int switch_arg, option_list *opt, + double *lat, int *opt_latitude, + double *lon, int *opt_Longitude, + int *tz, int long_option_index) + +{ + int error_detected = 0; + + switch (switch_arg) + { + + case 0: /* long options */ + switch (long_option_index) + { +/* --version */ case 0: print_version (); exit_main(opt, 0); break; +/* --help */ case 1: print_help (); exit_main(opt, 0); break; +/* --no-reverse */ case 2: opt->no_reverse = 1; break; +/* --html */ case 3: break; +/* --parasha */ case 4: break; +/* --shabbat */ case 5: break; +/* --three-month*/ case 6: break; +/* --colorize */ case 7: break; +/* --footnote */ case 8: break; +/* --hebrew */ case 9: break; +/* --israel */ case 10:break; +/* --latitude */ case 11:break; +/* --longitude */ case 12:break; +/* --timezone */ case 13:break; +/* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break; +/* --quiet-alerts*/ case 15: break; +/* --visual */ case 16: +/* --bidi */ case 17: break; +/* --one-month */ case 18: break; +/* --no-visual */ case 19: +/* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break; +/* --no-color */ case 21: opt->colorize = 0; break; +/* --no-footnote*/ case 22: opt->footnote = 0; break; +/* --menu */ case 23: break; +/* --candles */ case 24: + if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(optarg); + if ( (opt->candles >= MIN_CANDLES_MINUTES) && + (opt->candles <= MAX_CANDLES_MINUTES) ) break; + } + print_parm_error("--candles"); + error_detected++; + } + break; +/* --havdalah */ case 25: + if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(optarg); + if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) && + (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break; + } + print_parm_error("--havdalah"); + error_detected++; + } + break; + + } // end switch for long_options + break; + + + case '1': opt->three_month = 0; break; + case '3': opt->three_month = 1; break; + case 'b': opt->bidi = 1; opt->force_hebrew = 1; break; + case 'c': opt->colorize = 1; break; + case 'd': opt->diaspora = 1; break; + case 'f': opt->footnote = 1; break; + case 'h': opt->html = 1; break; + case 'H': opt->force_hebrew = 1; break; + case 'I': opt->force_israel = 1; break; + case 'i': opt->external_css = 1; break; + case 'm': opt->menu = 1; break; + case 'p': opt->parasha = 1; break; + case 'q': opt->quiet_alerts = 1; break; + case 'l': + error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude); + break; + case 'L': + error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude); + break; + case 's': + opt->shabbat = 1; + opt->parasha = 1; + if (opt->candles == 0) opt->candles = 1; + if (opt->havdalah == 0) opt->havdalah = 1; + break; + case 'z': + error_detected = error_detected + parse_timezone(optarg, tz); + break; + case '?': + // FIXME if (strchr(short_options,optopt)!=NULL) + print_parm_missing_error((char*) &optopt); + error_detected = TRUE; + break; + default: print_usage_hcal (); exit_main(opt, 0); break; + } + return error_detected; +} + +/************************************************** +*************************************************** +*************************************************** +* main +*************************************************** +*************************************************** +**************************************************/ +int main (int argc, char *argv[]) +{ + + /* date */ + int month, year; + + double lat = BAD_COORDINATE; /* set to this value for error handling */ + double lon = BAD_COORDINATE; /* set to this value for error handling */ + int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */ + + int opt_latitude = 0; /* -l option latitude */ + int opt_Longitude = 0; /* -L option longitude */ + + int error_detected = FALSE; /* exit after reporting ALL bad parms */ + + + option_list opt; + opt.bidi = 0; // visual bidi, implies --force-hebrew + opt.html = 0; // -h html format flag + opt.diaspora = 0; // -d Diaspora holidays + opt.external_css = 0; // -i External css file + opt.parasha = 0; // -p print parasha alongside calendar + opt.shabbat = 0; // -c print candle-lighting alongside calendar + opt.candles = 0; + opt.havdalah = 0; + opt.no_reverse = 0; // don't highlight today in reverse video + opt.three_month = 0; // print previous and next months also + opt.colorize = 0; // display calendar in muted, more pleasing tones + opt.footnote = 0; // display description of month's holidays + opt.force_hebrew = 0; // force display of Hebrew data in Hebrew + opt.force_israel = 0; // override diaspora-awareness + opt.not_sunset_aware = 0; // override sunset-awareness + opt.quiet_alerts = 0; + + opt.lat = BAD_COORDINATE; + opt.lon = BAD_COORDINATE; + opt.tz = BAD_TIMEZONE; + + opt.menu = 0; // -m print menus for user-selection + int i; + for (i=0; i. + */ + +/************************************************** +* functions to support hcal and hdate +**************************************************/ + +#include // For hebrew date +//include "../../src/hdate.h" +#include // For atoi, malloc +#include // For error +#include // For errno +#include // For time +#include // for isprint +#include // For fnmatch +#include // For mempcpy +#include // For optarg, optind +#include // For printf, fopen, fclose, fprintf, snprintf. FILE +#include // for get pwuid +#include // for getuid +#include +#include // for mkdir, + + +// support for fnmatch +#define FNM_EXTMATCH (1 << 5) +#define FNM_NOFLAG 0 + +#define BAD_COORDINATE 999 +#define BAD_TIMEZONE 999 +#define DELTA_LONGITUDE 30 + +#define EXIT_CODE_BAD_PARMS 1 + + + +// copied from support.h in src dir +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + +#define FALSE 0 +#define TRUE -1 + + +// support for options parsing +#define MIN_CANDLES_MINUTES 18 +#define DEFAULT_CANDLES_MINUTES 20 +#define MAX_CANDLES_MINUTES 90 +#define MIN_MOTZASH_MINUTES 20 +#define MAX_MOTZASH_MINUTES 90 + + +/************************************************************ +* begin - error message functions +************************************************************/ +void print_parm_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("parameter"), parm_name, + N_("is non-numeric or out of bounds")); +} + +void print_parm_missing_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("missing parameter")); +} + +void print_alert_timezone( int tz ) +{ + error(0,0,"%s: %s, %+d:%d UTC", + N_("ALERT: time zone not entered, using system local time zone"), + *tzname, tz/60, tz%60); +} + +void print_parm_invalid_error( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("is not a valid option")); +} + + +/************************************************************ +* end - error message functions +************************************************************/ + + + + +/************************************************************ +* begin - alert message functions +************************************************************/ +void print_alert_coordinate( char *city_name ) +{ + error(0,0,"%s %s", + N_("ALERT: guessing... will use co-ordinates for"), + city_name); +} + +void print_alert_default_location( int tz ) +{ + switch (tz/60) + { + case -8: print_alert_coordinate( N_("Los Angeles") ); break; + case -6: print_alert_coordinate( N_("Mexico City") ); break; + case -5: print_alert_coordinate( N_("New York City") ); break; +// case -5: print_alert_coordinate( N_("Toronto") ); break; +// case -3: print_alert_coordinate( N_("Sao Paolo") ); break; + case -3: print_alert_coordinate( N_("Buenos Aires") ); break; + case 0: print_alert_coordinate( N_("London") ); break; + case 1: print_alert_coordinate( N_("Paris") ); break; + case 2: print_alert_coordinate( N_("Tel-Aviv") ); break; + case 3: print_alert_coordinate( N_("Moscow") ); break; + case 5: print_alert_coordinate( N_("Tashkent") ); break; + case 8: print_alert_coordinate( N_("Beijing") ); break; +// case 8: print_alert_coordinate( N_("Hong Kong") ); break; + case -10: print_alert_coordinate( N_("Honolulu") ); break; + default: error(0,0,"%s \n%s", N_("Hmmm, ... hate to do this, really ..."), N_("using co-ordinates for the equator, at the center of time zone")); break; + } +} +/************************************************************ +* end - alert message functions +************************************************************/ + + + +/************************************************************ +* set default location +************************************************************/ +void set_default_location( int tz, double *lat, double *lon ) +{ + /* Temporarily, set some default lat/lon coordinates + for certain timezones */ + +/** +{ 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ), +{ 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ), +{ 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ), +{ 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ), +{ 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ), +{ 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ), +{ 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ), +{ 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ), +{ 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ), +{ 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ), +{ 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ), +{ 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ), +{ 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ), +{ 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ), +{ 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ), +{ 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ), +{ 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ), +{ 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ), +{ 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ), +{ 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' ) +**/ + + switch (tz/60) + { + case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles + case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City + case -5: *lat = 40.0; *lon = -74.0; break; // New York +// case -5: *lat = 43.71; *lon = -79.43; break; // Toronto +// case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo + case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires + case 0: *lat = 51.0; *lon = 0.0; break; // London + case 1: *lat = 48.0; *lon = 2.0; break; // Paris + case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv + case 3: *lat = 55.0; *lon = 37.0; break; // Moscow + case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent + case 8: *lat = 39.90; *lon = 116.38; break; // Beijing +// case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong + case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu + default: *lat = 0.0; *lon = tz * .25; break; // center of timeone: + // .25 = (15 degrees) / 60 [because tz is in minutes, not hours] + } + return; +} + + + +/************************************************************ +* check for sunset +************************************************************/ +int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone ) +{ + time_t now_time; + struct tm *now_timep; + int sunrise, sunset; + + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + time(&now_time); + now_timep = localtime(&now_time); + + if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1; + else return 0; +} + + + + +/*********************************************************** + * reverse a hebrew string (for visual bidi) + * parameters: + * source is a pointer to a writeable buffer. + * source_len is the length of a string in source. This + * length must be LESS than the size of the source buffer +***********************************************************/ +void revstr( char *source, const size_t source_len) +{ + #define H_CHAR_WIDTH 2 + +#define DEBUG 0 +#if DEBUG +printf("\nrevstr: entry: sourcelen = %zd, source = %s\n",source_len, source); +#endif + + if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);}; + if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %zd",source_len); exit(0);}; + + size_t i,j; + char *temp_buff; + + temp_buff = malloc(source_len+2); + if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);}; + + for (i=(source_len-1), j=0; j < source_len; i--, j++) + { + if (isprint(source[i])) temp_buff[j] = source[i]; + else + { + // FIXME - presumes H_CHAR_WIDTH = 2 + temp_buff[j++] = source[i-1]; + temp_buff[j] = source[i--]; + } + } + memcpy(source, temp_buff, source_len); + source[source_len] = '\0'; +#if DEBUG +printf("\nrevstr: before free(tempbuff): sourcelen = %zd, source = %s\n",source_len, source); +#endif + free(temp_buff); + return; +} + + +/************************************************************ +* parse coordinate +* +* presumes commandline options were parsed using getopt. +* returns 1 to *opt_found on success +* returns the floating point value of the coordinate in *coordinate +* +* type_flag (1-latitude, 2=longitude) +************************************************************/ +int parse_coordinate( const int type_flag, char *input_string, + double *coordinate, int *opt_found) +{ +//#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" +//#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" + +#define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])" + +#define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])" + + char* seconds; + + double fractional_part = 0; + int direction_modifier = 1; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if (!input_string) + { + if (type_flag == 1) print_parm_missing_error(N_("l (latitude)")); + else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)")); + return TRUE; // error_detected = TRUE; ie failure + } + + /************************************************************ + * parse latitude + ************************************************************/ + if (type_flag == 1) + { + if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("l (latitude)")); + else print_parm_error(N_("l (latitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1; + + + if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS")); + } + else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS:'\"")); + fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60; + seconds = strtok( NULL, "nNsS:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -90) && (*coordinate < 90) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + /************************************************************ + * parse longitude + ************************************************************/ + if (type_flag == 2) + { + if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("L (Longitude)")); + else print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1; + + + if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW")); + } + else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW:'\"")); + fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60; + seconds = strtok( NULL, "eEwW:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -180) && (*coordinate < 180) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + +printf("INTERNAL ERROR: coordinate parse\n"); +return TRUE; // error_detected = TRUE; ie failure +} + +/************************************************************ +* parse timezone +* +* presumes commandline options were parsed using getopt. +* timezone is returned in minutes, not hours +************************************************************/ +int parse_timezone( char *input_string, int *tz) +{ +#define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))" +#define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))" + + int fractional_part; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if ((!input_string) || + ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) && + (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) && + (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) ) + { + print_parm_missing_error(N_("z (time zone)")); + } + else + { + if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *tz = (int) ( atof (input_string) * 60 ); + } + else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0) + { + *tz = atoi( strtok( input_string, ":'\"")) * 60; + fractional_part = atoi( strtok( NULL, ":'\"")); + if (*tz < 0) *tz = *tz - fractional_part; + else *tz = *tz + fractional_part; + } + + if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours + { + return FALSE; // error_detected = FALSE; ie. success + } + else print_parm_error(N_("z (timezone)")); + } + return TRUE; // error_detected = TRUE; ie failure +} + + + + +/************************************************************ +* validate location parameters - lat, lon, tz +************************************************************/ +// originally, this was only for hdate, now also for hcal +// originally, we did this only if we needed the information +// now, because of sunset-awareness, we always perform these checks +// if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) ) +void validate_location( const int opt_latitude, const int opt_Longitude, + double *lat, double *lon, + int *tz, const int quiet_alerts, int error_detected, + void (*print_usage)() ) +{ + + /* latitude and longitude must be paired */ + if ( (opt_latitude) && (!opt_Longitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude")); + error_detected = TRUE; + } + else if ( (opt_Longitude) && (!opt_latitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude")); + error_detected = TRUE; + } + + + if (!error_detected) + { + // if no timezone entered, choose guess method + if (*tz==BAD_TIMEZONE) + { + // system timezone is in seconds, but we deal in minutes + tzset(); + *tz = timezone /-60; + + if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) ) + { + /* reject system local timezone, because it's + too far from the longitude explicitly provided + by the user; guess based on longitude entered */ + *tz = (*lon /15) * 60; + } + if (!quiet_alerts) print_alert_timezone( *tz ); + if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) ) + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + } + printf("\n"); + } + else + { /* we have timezone, what about latitude and longitude? */ + if ( (opt_Longitude) && (opt_latitude) ) + { + // sanity-check longitude versus timezone + // timezone is in minutes + if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE ) + { + error(0,0,"%s %d:%d %s %.3f %s", + N_("time zone value of"), *tz/60, *tz%60, + N_("is incompatible with a longitude of"), *lon, N_("degrees")); + error_detected = TRUE; + } + } + else + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + printf("\n"); + } + } + } + + /* exit after reporting all bad parameters found */ + if (error_detected) + { + print_usage(); + exit(EXIT_CODE_BAD_PARMS); + } +} + + +/************************************************************ +* check validity of date parameters +************************************************************/ +#define CHECK_DAY_PARM 1 +#define CHECK_MONTH_PARM 2 +#define CHECK_YEAR_PARM 3 +int validate_hdate (int parameter_to_check, int day, int month, int year) +{ + hdate_struct h; + + if (year < 0) return FALSE; + + switch (parameter_to_check) + { + + case CHECK_DAY_PARM: + + /************************************************************ + * check day in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((day < 1) || (day > 30) || + ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) || + (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) || + (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) ) + return FALSE; + return TRUE; + } + + /************************************************************ + * check day in Gregorian date + ************************************************************/ + else + { + if ((day < 1) || + ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) || + ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) || + ((day > 29) && (month==2) && ((year%4)==0)) || + ((day > 28) && (month==2) && ((year%4)!=0)) + ) + return FALSE; + return TRUE; + } + break; + + + case CHECK_MONTH_PARM: + + /************************************************************ + * check month in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + if ((month <= 0) || (month > 14)) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) return FALSE; + return TRUE; + } + + /************************************************************ + * check month in Gregorian date + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) return FALSE; + return TRUE; + } + break; + + case CHECK_YEAR_PARM: + if (year > 10999) return FALSE; + return TRUE; + break; + } + return FALSE; +} + +/************************************************************ +* Greeting message to new version +************************************************************/ +void greetings_to_version_16() +{ + error(0,0,"%s",N_("\ +This seems to be to be your first time using this version.\n\ +Please read the new documentation in the man page and config\n\ +file. Attempting to create a config file ...")); +} + + +/************************************************************ +* Open config file, or create one +* - returns filepointer or NULL +* - if file does not exist, attempt to create it +************************************************************/ +FILE* get_config_file( const char* config_dir_name, + const char* config_file_name, + const char* default_config_file_text ) +{ + size_t path_len; + + char* config_home_path_name = ""; + char* config_sub_path_name = ""; + + char* config_dir_path; + char* config_file_path; + + FILE* config_file; + + /************************************************************ + * sub-function to get_config_file: create_config_file + ************************************************************/ + void create_config_file() + { + config_file = fopen(config_file_path, "a"); + if (config_file == NULL) + { + error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path); + return; + } + fprintf(config_file, "%s", default_config_file_text); + error(0,0,"%s: %s",N_("config file created"), config_file_path); + if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); + } + + /************************************************************ + * sub-function to get_config_file: open_config_file + ************************************************************/ + int open_config_file() + { + config_file = fopen(config_file_path, "r"); + if (config_file == NULL) + { + if (errno != ENOENT) return FALSE; + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + + strlen(config_sub_path_name) + + strlen(config_dir_name) +1; + if (path_len < 1) return FALSE; + config_dir_path = malloc(path_len); + if (config_dir_path == NULL) + { + error(0,errno,"%s",N_("memory allocation failure")); + return FALSE; + } + snprintf(config_dir_path, path_len, "%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name); + + if ((mkdir(config_dir_path, (mode_t) 0700) != 0) && + (errno != EEXIST)) + { + free(config_dir_path); + return FALSE; + } + greetings_to_version_16(); + create_config_file(); + free(config_dir_path); + return FALSE; + } + return TRUE; + } + + +/************************************************************ +* main part of function get_config_file +************************************************************/ + config_home_path_name = getenv("XDG_CONFIG_HOME"); + if (config_home_path_name == NULL) + { + config_home_path_name = getenv("HOME"); + if (config_home_path_name == NULL) + { + struct passwd *passwdEnt = getpwuid(getuid()); + config_home_path_name = passwdEnt->pw_dir; + if (config_home_path_name == NULL) return NULL; + } + config_sub_path_name = "/.config"; + } + + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + strlen(config_sub_path_name) + + strlen(config_dir_name) + strlen(config_file_name) + 1; + if (path_len < 1) return NULL; + config_file_path = malloc(path_len); + if (config_file_path == NULL) + { + error(0,errno,"memory allocation failure"); + return NULL; + } + snprintf(config_file_path, path_len, "%s%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name, config_file_name); + + if (open_config_file() == TRUE) + { + free(config_file_path); + return config_file; + } + else + free(config_file_path); + return NULL; +} + + + + +/********************************************************************** +* parse user's menu selection into options and their posibile +* arguments, which can then be parsed (processed really) +* +* menuptr points to the beginning of the menu entry string. This +* pointer should initially be set to NULL. +* menu_len is the length of the menu entry string +* menu_index is the current position of the parser within the string. +* This value should initially be set to 0. +* optptr is a pointer into which we put the location of option text +* to be parsed. This pointer should initially be set to NULL. +* optarg is a pointer to a possible argument to the option. This is a +* global variable defined by GNU getopt(), so it shouldn't be +* declared or passed. +* long_options is a pointer to a structure of type option, as defined +* by getopt_long() +* long_option_index is a pointer to position found in long_options, and +* simulates the similar value returned by getopt_long() +* error_detected is a pointer to an accumulator used to delay aborting +* the program until after ALL input syntax errors are reported. +* +* RETURN VALUES: +* -1 means the menu line string has been completely parsed. +* Otherwise, the return value should be the short option character +* found, or in the case of a long option found, 0. +* This should sound suspiciously similar to the return values issued +* by getopt_long(). +***********************************************************************/ +int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index, + char** optptr, char* short_options, + struct option *long_options, int *long_option_index, + int *error_detected) +{ + int ahead_index; + char *ahead; + + while ( (*menu_index < menu_len) && + (menuptr[*menu_index] != '#') ) + { + if (menuptr[*menu_index] == '-') + { + if ( ( (*menu_index+1) >= menu_len) || + (menuptr[*menu_index+1] == '#') ) break; + else if (menuptr[*menu_index+1] == '-') + { + if ( ( (*menu_index+2) >= menu_len) || + (menuptr[*menu_index+2] == '#') ) break; + *menu_index = *menu_index +2; + + /************************************************** + * We have identified the beginning of what could + * be a long option string. We store a pointer to + * it in optptr and proceed to: + * find its endpoint + * terminate it with a null + * if it has an argument, store a pointer to + * it in optarg and terminate it with a null. + * Then we compare the optptr to our list of + * valid longoptions and pass the information + * to the option parser + *************************************************/ + *optptr = &menuptr[*menu_index]; // ?? + ahead = *optptr; + ahead_index = *menu_index; + while ( (ahead_index < menu_len) && + (strchr(" =#",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + if (memcmp(ahead,"=",1)==0) + { + *ahead = '\0'; + ahead++; + optarg = ahead; + ahead_index++; + while ( (ahead_index < menu_len) && + (strchr(" #",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + } + if ((*ahead == '#' ) && ((ahead_index+1) < menu_len)) + ahead[1] = '#'; + *ahead = '\0'; + *long_option_index = 0; + while ( (long_options[*long_option_index].name != 0) && + (strcmp(long_options[*long_option_index].name, *optptr) != 0) ) + *long_option_index = *long_option_index + 1; + if (long_options[*long_option_index].name == 0) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *menu_index = ahead_index; + return long_options[*long_option_index].val; + } + } + else + { + *menu_index = *menu_index + 1; + /************************************************** + * parse a short option from a menu line + *************************************************/ + if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) || + (menuptr[*menu_index] == ':') ) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *optptr = &menuptr[*menu_index]; + *long_option_index = -1; + if (strchr("lLz", (int) menuptr[*menu_index]) != NULL) + { + ahead_index = *menu_index+1; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++; + optarg = &menuptr[ahead_index]; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++; + menuptr[ahead_index] = '\0'; + *menu_index = ahead_index; + } + return **optptr; + } + + } + } + *menu_index = *menu_index + 1; + } + return -1; +} + + +/************************************************** +* prompt user for menu selection +*************************************************/ +int menu_select( char* menu_list[], int max_menu_items ) +{ + int i, j; + + for (i=0; i< max_menu_items; i++) + { + if (menu_list[i] == NULL) break; + if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)")); + printf(" %d: %s\n",i,menu_list[i]); + } + j = i; + if (i == 0) + { + error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file")); + return -1; + } + printf("\n%s: ",N_("enter your selection, or to continue")); + i = getchar() - 48; // effectively converts valid values to integers + if ((i < 0) || (i >= j)) + { + error(0,0,N_("menu selection received was out of bounds")); + return -1; + } + printf("\n"); + return i; +} diff --git a/.pc/docdir.patch/Makefile.am b/.pc/docdir.patch/Makefile.am new file mode 100644 index 0000000..27a97d1 --- /dev/null +++ b/.pc/docdir.patch/Makefile.am @@ -0,0 +1,32 @@ +## Process this file with automake to produce Makefile.in + +PACKAGE_NAME = libhdate +PACKAGE_STRING = library for Hebrew date information +PACKAGE_TARNAME = +PACKAGE_URL = libhdate.sourceforge.net +PACKAGE_VERSION = 1.6.02 +VERSION = 1.6.02 + +SUBDIRS = po docs src examples bindings + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libhdate.pc + +libhdate_CFLAGS = -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie +libhdate_LDFLAGS = -z relro -z now + + +libhdatedocdir = ${prefix}/share/doc/libhdate +libhdatedoc_DATA = \ + README\ + COPYING\ + AUTHORS\ + ChangeLog\ + INSTALL\ + NEWS\ + USE \ + ABOUT-NLS + +EXTRA_DIST = $(libhdatedoc_DATA) libhdate.pc.in + +ACLOCAL_AMFLAGS = -I m4 diff --git a/.pc/duplicate_gnu_source.patch/examples/hcal/hcal.c b/.pc/duplicate_gnu_source.patch/examples/hcal/hcal.c new file mode 100644 index 0000000..aa1d601 --- /dev/null +++ b/.pc/duplicate_gnu_source.patch/examples/hcal/hcal.c @@ -0,0 +1,2021 @@ +/* hcal.c http://libhdate.sourceforge.net + * Hebrew calendar (part of package libhdate) + * + * compile: + * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal + * + * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define _GNU_SOURCE // for mempcpy +#include // For printf +#include // For hebrew date +//#include "../../src/hdate.h" +#include // For atoi, malloc +#include // For setlocale +#include // For getopt_long +#include // For strlen, mempcpy +#include // For time, tzset +//#include // for unicode character operations + +#define FALSE 0 +#define TRUE -1 +#define SHABBAT 7 + +#define HDATE_STRING_SHORT 1 + +// for opt.menu[MAX_MENU_ITEMS] +#define MAX_MENU_ITEMS 10 + + + +// for colorization +#define CODE_REVERSE_VIDEO "%c[7m", 27 +#define CODE_RESTORE_VIDEO "%c[m", 27 +#define CODE_BLACK "%c[30m", 27 +#define CODE_LIGHT_RED "%c[31m", 27 +#define CODE_LIGHT_GREEN "%c[32m", 27 +#define CODE_LIGHT_BROWN "%c[33m", 27 +#define CODE_DARK_BLUE "%c[34m", 27 +#define CODE_LIGHT_PURPLE "%c[35m", 27 +#define CODE_LIGHT_AQUA "%c[36m", 27 +#define CODE_LIGHT_GREY "%c[37m", 27 +#define CODE_BOLD_GREY "%c[1;30m", 27 +#define CODE_BOLD_RED "%c[1;31m", 27 +#define CODE_BOLD_GREEN "%c[1;32m", 27 +#define CODE_BOLD_YELLOW "%c[1;33m", 27 +#define CODE_BOLD_BLUE "%c[1;34m", 27 +#define CODE_BOLD_PURPLE "%c[1;35m", 27 +#define CODE_BOLD_AQUA "%c[1;36m", 27 +#define CODE_BOLD_WHITE "%c[1;37m", 27 +#define ELEMENT_WEEKDAY_G 1 +#define ELEMENT_WEEKDAY_H 2 +#define ELEMENT_SHABBAT_DAY 3 +#define ELEMENT_HOLIDAY_DAY 4 +#define ELEMENT_HOLIDAY_FLAG 5 +#define ELEMENT_SHABBAT_NAME 6 +#define ELEMENT_WEEKDAY_NAMES 7 +#define ELEMENT_MONTH_G 8 +#define ELEMENT_MONTH_H 9 +#define ELEMENT_SHABBAT_TIMES 10 +#define ELEMENT_PARASHA 11 +#define ELEMENT_THIS_SHABBAT_TIMES 12 +#define ELEMENT_THIS_PARASHA 13 +#define ELEMENT_HOLIDAY_NAME 14 +#define ELEMENT_TODAY_HOLIDAY_DAY 15 +#define ELEMENT_TODAY_HOLIDAY_NAME 16 + +/************************************************** +* functions to support hcal and hdate +**************************************************/ +#include "./local_functions.c" + + + +static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' }; +/* Holiday types: (reference hdate_holyday.c) + / - 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 +*/ + + + +typedef struct { + int html; + int external_css; + int diaspora; + int parasha; + int shabbat; + int candles; + int havdalah; + int no_reverse; + int three_month; + int colorize; + int footnote; + int jd_today_g; + int jd_today_h; + int force_hebrew; + int force_israel; + int not_sunset_aware; + int quiet_alerts; + int bidi; + double lat; + double lon; + int tz; + int menu; + char* menu_item[MAX_MENU_ITEMS]; + } option_list; + +typedef struct { + int g_month_1; + int g_year_1; + int g_month_2; + int g_year_2; + int h_month_1; + int h_year_1; + int h_month_2; + int h_year_2; + } header_info; + + +const char* hcal_config_file_text = N_("\ +# configuration file for hcal - Hebrew calendar program\n\ +# part of package libhdate\n\ +#\n# Should you mangle this file and wish to restore its default content,\n\ +# rename or delete this file and run hcal; hcal will automatically\n\ +# regenerate the default content.\n#\n\ +# Your system administrator can set system-wide defaults for hcal by\n\ +# modifying file .\n\ +# You may override all defaults by changing the contents of this file.\n\ +#\n\ +# Version information\n\ +# This may be used by updates to hcal to determine how to parse the file\n\ +# and whether additional information and options should be appended to\n\ +# the end of this file.\n\ +VERSION=2.00\n\ +# Location awareness\n\ +# hcal wants to accurately highlight the current Hebrew day, including\n\ +# during the hours between sunset and secular midnight. If you don't\n\ +# provide it with latitude, longitude, and time zone information, hcal\n\ +# will try to guess the information, based upon your system timezone,\n\ +# and its (limited, and maybe biased) of the dominant Jewish community\n\ +# in that timezone. When hcal is forced to guess, it alerts the user\n\ +# with a message that includes the guessed location.\n\ +# hcal's guesses will also affect its default behaviour for output of\n\ +# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\ +#SUNSET_AWARE=TRUE\n\ +# LATITUDE and LONGITUDE may be in decimal format or in the form\n\ +# degrees[:minutes[:seconds]] with the characters :'\" as possible\n\ +# delimiters. Use negative values to indicate South and West, or\n\ +# use the abbreviated compass directions N, S, E, W.\n\ +#LATITUDE=\n\ +#LONGITUDE=\n\ +# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\ +# with the characters :'\" as possible delimiters.\n\ +#TIMEZONE=\n\n\ +# Israel and the diaspora\n\ +# If hcal guesses that you're not in Israel, the DIASPORA option will be\n\ +# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\ +# forces hcal to display calendar information for Israel, using hcal's\n\ +# default coordinates foe Israel, or coordinates that you provide that\n\ +# seem legitmately within Israel.\n\ +# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\ +# Sukkot, set BOTH flags true in order to see holiday information for\n\ +# a non-resident vistor to Israel. The command line options for these\n\ +# features are --israel, -I, --diaspora, -d.\n\ +#FORCE_DIASPORA=FALSE;\n\ +#FORCE_ISRAEL=FALSE;\n\n\ +# Shabbat related\n\ +# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\ +# The command line options for these features are -p (--parasha), and\n\ +# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\ +# before sunset). The HAVDALAH field can accept a value of 20 - 90\n\ +# (minutes after sunset).\n\ +#PARASHA_NAMES=FALSE\n\ +#SHABBAT_INFO=FALSE\n\ +#CANDLE_LIGHTING=FALSE\n\ +#HAVDALAH=FALSE\n\n\ +# Holiday identification\n\ +# hcal flags holidays by replacing the gregorian/Hebrew date separator\n\ +# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\ +# will have hcal output after the month's calendar, a list of the month's\n\ +# holidays along with the days on which they occur.\n\ +#FOOTNOTE=FALSE\n\n\ +# Output in hebrew characters\n\ +# hcal defaults to output all information in your default language, so\n\ +# if your default language is Hebrew, you're all set. Otherwise, you can\n\ +# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\ +# still outputting gregorian information in your default language. To\n\ +# output ALL information in Hebrew, run something like this:\n\ +# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\ +# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\ +# output, you need to install a terminal font that includes the Hebrew\n\ +# character set (hint: unicode).\n\ +# The command line option for FORCE_HEBREW is either --hebrew or -H\n\ +#FORCE_HEBREW=FALSE\n\n\ +# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\ +# Unfortunately, the world can not be depended upon to be either. Most\n\ +# Xwindow applications will display the data fine with FORCE_HEBREW; most\n\ +# xterm implementations will not. (in fact, the only xterm clone I know\n\ +# of that comes close is mlterm). If using FORCE_HEBREW results in\n\ +# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\ +# This will reverse the order of the Hebrew characters, so they will\n\ +# display 'visual'ly correct; however, such output will not be suitable\n\ +# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\ +# automatically forces hebrew.\n\ +# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\ +#OUTPUT_BIDI=FALSE\n\n\ +# Display enhancements\n\ +# hcal defaults to display the current day in reverse video\n\ +# The command line option for this feature is --no-reverse\n\ +#SUPPRESS_REVERSE_VIDEO=FALSE;\n\ +# hcal can display its output \"calming, muted tones\". Note that piping\n\ +# colorized output may yield unexpected results.\n\ +#COLORIZE=FALSE\n\n\ +# HTML OUTPUT\n\ +#OUTPUT_HTML=FALSE\n\ +#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\ +# Suppress alerts and warnings\n\ +# hcal alerts the user via STDERR when it guesses the user's location.\n\ +#QUIET_ALERTS=FALSE\n\n\ +# Three month display\n\ +# hcal can display a previous, current and next month side-by-side. hcal\n\ +# can also display a calendar for an entire year in four rows of three\n\ +# months each. Note that this will display properly only if your console\n\ +# is set for at least 127 columns. Note also that setting this option to\n\ +# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\ +#THREE_MONTH=FALSE\n\n\ +# User-defined menus\n\ +# You may specify here command-line strings to optionally be parsed\n\ +# by hcal at execution time. To do so, use the command line option -m\n\ +# (--menu). hcal will process first the settings of this config file,\n\ +# then the other settings of your command line, and then will prompt\n\ +# you for which menu item you would like to select. hcal will process\n\ +# your menu selection as if it were a new command line, further modifying\n\ +# all the prior settings.\n\ +# Only the first ten \"MENU=\" entries will be read. Each line will be\n\ +# truncated at one hundred characters\n\ +#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\ +#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\ +#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\ +#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\ +"); + + +/************************************************** +* print version +*************************************************/ +int print_version () +{ + printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6")); + return 0; +} + +/************************************************** +* print usage +*************************************************/ +void print_usage_hcal () +{ + printf ("%s\n", +N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\ + coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\ + -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\ + timezone: -z nn[( .nn | :mm )]\n\ +Try \'hcal --help\' for more information")); +} + +/************************************************** +* print help +*************************************************/ +void print_help () +{ + print_usage_hcal(); + printf ("%s\n", +N_("Hebrew calendar\nOPTIONS:\n\ + -1 --one-month over-ride config file setting if you had set\n\ + option --three-month as a default there\n\ + -3 --three-month displays previous/next months\n\ + side by side. requires 127 columns\n\ + -b --bidi prints hebrew in reverse (visual)\n\ + --visual\n\ + --no-bidi over-ride config file setting if you had set\n\ + --no-visual option -bidi as a default there\n\ + -c --colorize displays in calming, muted tones\n\ + --no-color over-ride a --colorize setting in your config file\n\ + -d --diaspora use diaspora reading and holidays.\n\ + -f --footnote print descriptive notes of holidays\n\ + --no-footnote over-ride a footnote setting in your config file\n\ + -h --html output in html format to stdout\n\ + -H --hebrew print hebrew information in Hebrew\n\ + -i use external css file \"./hcal.css\".\n\ + -I --israel override a diaspora default\n\ + --no-reverse do not highlight today's date\n\ + -m --menu prompt user-defined menu from config file\n\ + -p --parasha print week's parasha on each calendar row\n\ + -q --quiet-alerts suppress warning messages\n\ + -s --shabbat print Shabbat times and parshiot\n\ + --candles modify default minhag of 20 minutes. (17\n\ +\n\ +\n\ +\n\ +\n\ +\n"); + + /* some alternative css styles */ + printf ("\n\ +\n\ +\n\ +\n"); + + if ( (force_hebrew) || (hdate_is_hebrew_locale()) ) + printf ("Hebrew Calendar\n\n
\n"); + else + printf ("Hebrew Calendar\n\n
\n"); + + return 0; +} + + + +/************************************************** + * HTML - print footer + *************************************************/ +int print_html_footer () +{ + printf ("\n"); + + printf ("\n"); + + return 0; +} + + +/************************************************** +* Print HTML header - month line +*************************************************/ +void print_header_month_line_html( const header_info header) +{ + + // TODO - fix bug ellul xxxx - tishrei xxxx+1 +// char *h_year_1; +// h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *h_year_1 = NULL; + + /************************************************** + * Print Gregorian month and year + **************************************************/ + printf ("\n", + hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL), + header.g_year_1); + + h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW); + /************************************************** + * Print Hebrew month and year + **************************************************/ + printf ("
%s %d"); + if (header.h_month_1 != header.h_month_2) + { + printf ("%s-", + hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + } + printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + printf ("\n"); + printf ("%s
\n", h_year_1); + + printf ("\n\n"); + + + if (h_year_1 != NULL) free(h_year_1); +} + + +/************************************************** +* HTML - print column headings for days of weeks +**************************************************/ +void print_header_dow_line_html() +{ + int j; + + for (j = 1; j < 8; j++) + printf ("", + hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE)); +} + + + +/************************************************** + * end HTML functions + *************************************************/ + + +/************************************************* +* Display data in a more pleasing visual manner +*************************************************/ +void colorize_element ( const int element ) +{ + switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; + } +/* switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; +*/ +} + + + +/************************************************** + * print header - month line to stdout + *************************************************/ +void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi ) +{ + char *g_month, *h1_month, *h2_month; + char *h1_year = NULL; + char *h2_year = NULL; + size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len; + + + char *hebrew_buffer, *hebrew_buffer_next; + size_t hebrew_buffer_len, literals_len; + + int j; + size_t padding = 0; + + + /************************************************** + * Print Gregorian month and year + *************************************************/ + g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL); + if (colorize) colorize_element(ELEMENT_MONTH_G); + printf ("%s %d", g_month, header.g_year_1); + if (colorize) printf(CODE_RESTORE_VIDEO); + + /************************************************** + * Print Hebrew month and year + * + * because we want this printed right-justified on + * the same line, we need to calculate how many + * spaces to pad. + * + * because of the possible user option --bidi, we + * need to buffer the entire Hebrew text in order + * reverse its sequence for 'visual' display. + * + * This all requires collecting the data first + * and determining each's length. + *************************************************/ + + #define CALENDAR_WIDTH 41 + #define DASH_WIDTH 3 // includes surrounding spaces + #define SPACE_WIDTH 1 + + + /************************************************* + * padding info for gregorian date + *************************************************/ + g_month_len = strlen(g_month); + g_year_len = 4; + switch (header.g_year_1) + { + case 1-9: g_year_len = 1; break; + case 10-99: g_year_len = 2; break; + case 100-999: g_year_len = 3; break; + } + + + /************************************************** + * collect padding info for Hebrew date + *************************************************/ + h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew); + h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew); +//printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0); + + h1_month_len = strlen(h1_month); + h1_year_len = strlen(h1_year); +// DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len); +// DEBUG - int ii; for (ii=0; ii\n"); + else printf ("\n"); + + + /************************************************** + * print column headings for days of weeks + **************************************************/ + if (opt.html) print_header_dow_line_html(); + else + { + if (opt.three_month) + { + print_header_dow_line_stdout(opt.colorize); + printf(" "); + } + print_header_dow_line_stdout(opt.colorize); + if (opt.three_month) + { + printf(" "); + print_header_dow_line_stdout(opt.colorize); + } + } + + /************************************************** + * terminate line + **************************************************/ + if (opt.html) printf ("\n"); + else printf ("\n"); + + return 0; +} + + +/************************************************** +* print HTML calendar entry (ie. a single day) +*************************************************/ +void print_day_html ( const hdate_struct h, const int month, const option_list opt) +{ + + int holiday_type; +// char *hd_day; +// hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *hd_day_str = NULL; + + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + + if (h.gd_mon != month) printf ("\n"); + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print stdout calendar entry (ie. a single day) +*************************************************/ +void print_day ( const hdate_struct h, const int month, const option_list opt) +{ + + // for forcing Hebrew printing of Hebrew data + //char *language; + + // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1); + char *hd_day_str = NULL; + + size_t hd_day_buffer_str_len; + + int holiday_type; + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + /************************************************** + * out of month - needs padding + *************************************************/ + if (h.gd_mon != month) printf(" "); + + + /************************************************** + * in month - print the data + *************************************************/ + else + { + /************************************************* + * Gregorian date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_g) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_G); + } + + /************************************************* + * Gregorian date entry - the day of the month + *************************************************/ + // this next line is necessary to align numbers + // correctly with bidi (tested using mlterm) + if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) ) + printf ("%d ", h.gd_day); + else printf ("%2d", h.gd_day); + + /************************************************* + * Gregorian date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_g) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + + /************************************************* + * holiday flag + *************************************************/ + printf ("%c", holiday_flag[holiday_type]); + + + /************************************************* + * Hebrew date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_h) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_H); + } + + + /************************************************* + * Hebrew date entry - day of the month + *************************************************/ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew); + if (opt.bidi) + { + hd_day_buffer_str_len = (size_t) strlen(hd_day_str); + if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE) + hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1; + revstr(hd_day_str, hd_day_buffer_str_len); + } + if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) && + ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) ) + { // need to pad Hebrew dates 1-10, 20, 30 + printf ("%s%s"," ",hd_day_str); + } + else printf ("%2s", hd_day_str); + + /************************************************* + * Hebrew date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_h) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + } + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print a calendar week's entry (ie. seven columns) +*************************************************/ +void print_week( int jd, const int month, const option_list opt) +{ +#define long_parasha_name 0 + + hdate_struct h; + + int calendar_column; + + // for opt.shabbat + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + int this_week; + hdate_struct yom_shishi; + + // for opt.parasha + int shabbat_name; + char *shabbat_name_str, *shabbat_name_buffer; + size_t shabbat_name_str_len; + + + // for forcing Hebrew printing of Hebrew data + //char *language; + + + /************************************************** + * for each column of calendar + *************************************************/ + for (calendar_column = 0; calendar_column < 7; calendar_column++) + { + + /************************************************** + * Get this day's information + *************************************************/ + hdate_set_jd (&h, jd); + if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) ) + yom_shishi = h; + + + /************************************************** + * HTML calendar option + *************************************************/ + if (opt.html) print_day_html ( h, month, opt ); + + + + /************************************************** + * non-HTML calendar option + *************************************************/ + else print_day ( h, month, opt); + + + /************************************************** + * space between days of week + *************************************************/ + if (calendar_column != 6) printf (" "); + + /************************************************** + * advance to next day of week + *************************************************/ + jd++; + } + + /************************************************** + * print end of calendar line + *************************************************/ + if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) ) + { + + /******************************************************** + * determine whether this line gets special highlighting + ********************************************************/ + if ((opt.colorize) + && ((opt.shabbat) || (opt.parasha)) + && ((jd - 1) > opt.jd_today_h) + && (((jd - 1) - opt.jd_today_h) < 7) ) + this_week = TRUE; + else this_week = FALSE; + + /************************************************* + * print shabbat times + *************************************************/ + if (opt.shabbat) + { + // candlelighting times + /// note: compiler incorrectly issued warnings: + /// "may be used uninitialized in this function [-Wmaybe-uninitialized]" + /// The initialization occurs above (~line 1005) "yom_shishi = h" + hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year, + opt.lat, opt.lon, &sunrise, &sunset); + + // FIXME - allow for further minhag variation + if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz; + else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf (" %02d:%02d", sunset / 60, sunset % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + + printf(" - "); + + // motzay shabat time + hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat, + opt.lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + + // FIXME - allow for further minhag variation + if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz; + else three_stars = three_stars + opt.tz; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf ("%02d:%02d", three_stars / 60, three_stars % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + + + /************************************************* + * print shabbat name + *************************************************/ + if (opt.parasha) + { + + /************************************************* + * print shabbat name - force-hebrew setup + *************************************************/ + // BUG - this isn't thread-safe + /*if (opt.force_hebrew) + { + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + + + shabbat_name = hdate_get_parasha (&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_PARASHA, shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + else + { + shabbat_name = hdate_get_holyday(&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_HOLIDAY, + shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + } + if (shabbat_name) + { + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_PARASHA); + else colorize_element(ELEMENT_PARASHA); + } + if (opt.bidi) + { + shabbat_name_str_len = strlen(shabbat_name_str); + shabbat_name_buffer = malloc(shabbat_name_str_len+1); + memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len); + shabbat_name_buffer[shabbat_name_str_len] = '\0'; + revstr(shabbat_name_buffer, shabbat_name_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 15; + printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer); + + free(shabbat_name_buffer); + } + else printf(" %s", shabbat_name_str); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + } + } +} + + + + +/************************************************** +* print month table +*************************************************/ +int print_calendar ( const int current_month, const int current_year, const option_list opt) +{ + hdate_struct h; + int calendar_line; + int max_calendar_lines = 4; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int previous_month = 1, next_month = 1; + int previous_year, next_year; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int jd_current_month, jd_previous_month = 1, jd_next_month = 1; + + void how_many_calendar_lines( int month, int start_dow ) + { + switch (month) + { + case 4: + case 6: + case 9: + case 11: if (start_dow == 7) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: if (start_dow > 5) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5; + break; + } + } + + /********************************************************* + * Preliminaries: + * - Find the first sunday(s) of each calendar + * - Find number of calendar lines + *********************************************************/ + hdate_set_gdate (&h, 1, current_month, current_year); + jd_current_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * three months, side-by-side + *********************************************************/ + if (opt.three_month) + { + /********************************************************* + * previous month + *********************************************************/ + if (current_month == 1) + { + previous_month = 12; + previous_year = current_year - 1; + } + else + { + previous_month = current_month - 1; + previous_year = current_year; + } + hdate_set_gdate (&h, 1, previous_month, previous_year); + jd_previous_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * next month + *********************************************************/ + if (current_month == 12) + { + next_month = 1; + next_year = current_year + 1; + } + else + { + next_month = current_month + 1; + next_year = current_year; + } + hdate_set_gdate (&h, 1, next_month, next_year); + jd_next_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + } + + + + /************************************************** + * maximum six lines of calendar + **************************************************/ + for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++) + { + if (opt.html) printf ("\n"); + + if (opt.three_month) + { + print_week(jd_previous_month, previous_month, opt); + jd_previous_month = jd_previous_month + 7; + printf(" "); + } + + print_week(jd_current_month, current_month, opt); + jd_current_month = jd_current_month + 7; + + + if (opt.three_month) + { + printf(" "); + print_week(jd_next_month, next_month, opt); + jd_next_month = jd_next_month + 7; + } + + if (opt.html) printf ("\n"); + else printf ("\n"); + } + + + /************************************************** + * print end of calendar + *************************************************/ + if (opt.html) printf ("
%3s
"); + else if (h.hd_dw == SHABBAT) printf (""); + else if (holiday_type) printf (""); + else printf (""); + + /* Print a day */ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew); + printf ("\n\ +", + h.gd_day, + hd_day_str, + hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew)); + if (holiday_type) printf ("", + hdate_string( HDATE_STRING_HOLIDAY, + hdate_get_holyday (&h, opt.diaspora), + HDATE_STRING_SHORT, HDATE_STRING_LOCAL) + ); + else printf (""); + + printf ("
%2d%3s %s
 
%s
 
\n
"); + + return 0; +} + + + + + + +/**************************************************** +* print month header, month table, month footnotes +****************************************************/ +int print_month ( const int month, const int year, const option_list opt) +{ + hdate_struct h; + + // following are for opt.footnote + int jd_counter, holiday; + //char *language; // for forcing Hebrew printing of footnote + + + /* check if hebrew year (year > 3000) */ + if (year > 3000) hdate_set_hdate (&h, 1, month, year); + else hdate_set_gdate (&h, 1, month, year); + + + print_header (h.gd_mon, h.gd_year, opt); + print_calendar (h.gd_mon, h.gd_year, opt); + printf("\n"); + + + /**************************************************** + * print footnotes + ****************************************************/ + if (opt.footnote) + { + jd_counter = h.hd_jd; + while ( month == h.gd_mon ) + { + holiday = hdate_get_holyday(&h, opt.diaspora); + if (holiday) + { + print_day ( h, month, opt); + /*if (opt.force_hebrew) + { + // BUG - this isn't thread-safe + // --- and it may no longer be nexessary anywhere + // in the code now that I've embedded Hebrew + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + if (opt.colorize) + { + if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME); + else colorize_element(ELEMENT_HOLIDAY_NAME); + } + + if (opt.bidi) + { + char *holiday_str, *holiday_buffer; + size_t holiday_str_len; + holiday_str = hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew); + + holiday_str_len = strlen(holiday_str); + holiday_buffer = malloc(holiday_str_len+1); + memcpy(holiday_buffer, holiday_str, holiday_str_len); + holiday_buffer[holiday_str_len] = '\0'; + revstr(holiday_buffer, holiday_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 16; // 15 fails because of jabotinsky in july + printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer); + + free(holiday_buffer); + } + else printf (" %s\n", + hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew)); + + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + } + jd_counter++; + hdate_set_jd (&h, jd_counter); + } + } + return 0; +} + + +/**************************************************** +* read and parse config file +****************************************************/ +void read_config_file( FILE *config_file, + option_list *opt, + double* latitude, + int* opt_latitude, + double* longitude, + int* opt_longitude, + int* tz ) + +{ + char *input_string; + size_t input_str_len = 100; // WARNING: if you change this value + // you will still have to also + // change a matching value below + // in the statement that includes: + // match_count = sscanf(input_string + char *input_key = ""; + char *input_value = ""; + int line_count = 0; + int menu_item = 0; + size_t menu_len = 0; + int match_count; + int end_of_input_file = FALSE; + int i; + const int num_of_keys = 20; + const char* key_list[] = { "SUNSET_AWARE", // 0 + "LATITUDE", + "LONGITUDE", // 2 + "TIMEZONE", + "DIASPORA", // 4 + "FORCE_ISRAEL", + "PARASHA_NAMES", // 6 + "SHABBAT_INFO", + "FOOTNOTES", // 8 + "FORCE_HEBREW", + "OUTPUT_BIDI", //10 + "SUPPRESS_REVERSE_VIDEO", + "COLORIZE", //12 + "OUTPUT_HTML", + "USE_EXTERNAL_CSS_FILE", + "QUIET_ALERTS", + "THREE_MONTH", //16 + "MENU", + "CANDLE_LIGHTING", //18 + "HAVDALAH" + }; + + input_string = malloc(input_str_len+1); + input_key = malloc(input_str_len+1); + input_value = malloc(input_str_len+1); + while ( end_of_input_file!=TRUE ) + { + end_of_input_file = getline(&input_string, &input_str_len, config_file); + if ( end_of_input_file!=TRUE ) + { + errno = 0; + // The '100' in the next statement is inelegant; it is meant to + // be the value of input_str_len. Alternatively, don't malloc + // input_value above, use the 'a' specifier here, and free(input_value) + // at the end of every successful read and evaluation + match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value); + line_count++; + if (errno != 0) error(0,errno,"scan error at line %d", line_count); +// DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s", +// line_count, match_count, input_key, input_value, input_string); + if (match_count ==2) + { + for (i=0; inot_sunset_aware = 1; + else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0; + break; + case 1: + parse_coordinate(1, input_value, latitude, opt_latitude); + break; + case 2: + parse_coordinate(2, input_value, longitude, opt_longitude); + break; + case 3: + parse_timezone(input_value, tz); + break; + case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1; + break; + case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1; + break; + case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1; + break; + case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->shabbat = 1; + opt->parasha = 1; + } + break; + case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1; + break; + case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1; + break; + case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->bidi = 1; + opt->force_hebrew = 1; + } + break; + case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1; + break; + case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1; + break; + case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->html = 1; + break; + case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1; + break; + case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1; + break; + case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1; + break; + +// MENU + case 17:if (menu_item < MAX_MENU_ITEMS) + { + menu_len = strlen(input_value); + opt->menu_item[menu_item] = malloc(menu_len+1); + memcpy(opt->menu_item[menu_item], input_value,menu_len); + menu_item++; + } + break; +// CANDLE_LIGHTING + case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(input_value); + if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES; + else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES; + } + break; + +// HAVDALAH + case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(input_value); + if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES; + else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES; + } + break; + + } // end of switch(i) + break; // if found a match don't continue for loop + } + } + } + } + } + free(input_string); + free(input_key); + free(input_value); + return; +} + + +/**************************************************** +* exit elegantly +****************************************************/ +void exit_main( option_list *opt, const int exit_code) +{ + int i; + for (i=0; imenu_item[i] == NULL) break; + free(opt->menu_item[i]); + } + exit (exit_code); +} + + +/**************************************************** +* parse a command-line or a config-file menu line +* +* It was appropriate to make this a function, outside +* of main, because of its dual use and dual reference +****************************************************/ +int hcal_parser( const int switch_arg, option_list *opt, + double *lat, int *opt_latitude, + double *lon, int *opt_Longitude, + int *tz, int long_option_index) + +{ + int error_detected = 0; + + switch (switch_arg) + { + + case 0: /* long options */ + switch (long_option_index) + { +/* --version */ case 0: print_version (); exit_main(opt, 0); break; +/* --help */ case 1: print_help (); exit_main(opt, 0); break; +/* --no-reverse */ case 2: opt->no_reverse = 1; break; +/* --html */ case 3: break; +/* --parasha */ case 4: break; +/* --shabbat */ case 5: break; +/* --three-month*/ case 6: break; +/* --colorize */ case 7: break; +/* --footnote */ case 8: break; +/* --hebrew */ case 9: break; +/* --israel */ case 10:break; +/* --latitude */ case 11:break; +/* --longitude */ case 12:break; +/* --timezone */ case 13:break; +/* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break; +/* --quiet-alerts*/ case 15: break; +/* --visual */ case 16: +/* --bidi */ case 17: break; +/* --one-month */ case 18: break; +/* --no-visual */ case 19: +/* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break; +/* --no-color */ case 21: opt->colorize = 0; break; +/* --no-footnote*/ case 22: opt->footnote = 0; break; +/* --menu */ case 23: break; +/* --candles */ case 24: + if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(optarg); + if ( (opt->candles >= MIN_CANDLES_MINUTES) && + (opt->candles <= MAX_CANDLES_MINUTES) ) break; + } + print_parm_error("--candles"); + error_detected++; + } + break; +/* --havdalah */ case 25: + if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(optarg); + if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) && + (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break; + } + print_parm_error("--havdalah"); + error_detected++; + } + break; + + } // end switch for long_options + break; + + + case '1': opt->three_month = 0; break; + case '3': opt->three_month = 1; break; + case 'b': opt->bidi = 1; opt->force_hebrew = 1; break; + case 'c': opt->colorize = 1; break; + case 'd': opt->diaspora = 1; break; + case 'f': opt->footnote = 1; break; + case 'h': opt->html = 1; break; + case 'H': opt->force_hebrew = 1; break; + case 'I': opt->force_israel = 1; break; + case 'i': opt->external_css = 1; break; + case 'm': opt->menu = 1; break; + case 'p': opt->parasha = 1; break; + case 'q': opt->quiet_alerts = 1; break; + case 'l': + error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude); + break; + case 'L': + error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude); + break; + case 's': + opt->shabbat = 1; + opt->parasha = 1; + if (opt->candles == 0) opt->candles = 1; + if (opt->havdalah == 0) opt->havdalah = 1; + break; + case 'z': + error_detected = error_detected + parse_timezone(optarg, tz); + break; + case '?': + // FIXME if (strchr(short_options,optopt)!=NULL) + print_parm_missing_error((char*) &optopt); + error_detected = TRUE; + break; + default: print_usage_hcal (); exit_main(opt, 0); break; + } + return error_detected; +} + +/************************************************** +*************************************************** +*************************************************** +* main +*************************************************** +*************************************************** +**************************************************/ +int main (int argc, char *argv[]) +{ + + /* date */ + int month, year; + + double lat = BAD_COORDINATE; /* set to this value for error handling */ + double lon = BAD_COORDINATE; /* set to this value for error handling */ + int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */ + + int opt_latitude = 0; /* -l option latitude */ + int opt_Longitude = 0; /* -L option longitude */ + + int error_detected = FALSE; /* exit after reporting ALL bad parms */ + + + option_list opt; + opt.bidi = 0; // visual bidi, implies --force-hebrew + opt.html = 0; // -h html format flag + opt.diaspora = 0; // -d Diaspora holidays + opt.external_css = 0; // -i External css file + opt.parasha = 0; // -p print parasha alongside calendar + opt.shabbat = 0; // -c print candle-lighting alongside calendar + opt.candles = 0; + opt.havdalah = 0; + opt.no_reverse = 0; // don't highlight today in reverse video + opt.three_month = 0; // print previous and next months also + opt.colorize = 0; // display calendar in muted, more pleasing tones + opt.footnote = 0; // display description of month's holidays + opt.force_hebrew = 0; // force display of Hebrew data in Hebrew + opt.force_israel = 0; // override diaspora-awareness + opt.not_sunset_aware = 0; // override sunset-awareness + opt.quiet_alerts = 0; + + opt.lat = BAD_COORDINATE; + opt.lon = BAD_COORDINATE; + opt.tz = BAD_TIMEZONE; + + opt.menu = 0; // -m print menus for user-selection + int i; + for (i=0; i. + */ + +#define _GNU_SOURCE // For mempcpy, asprintf +#include // For hebrew date +//#include "../../src/hdate.h" +#include // For atoi, getenv, setenv +#include // For setlocale +#include // For getopt_long +#include // For strchr, mempcpy, asprintf + +#include "./local_functions.c" + +#define DATA_WAS_NOT_PRINTED 0 +#define DATA_WAS_PRINTED 1 + +// for opt.menu[MAX_MENU_ITEMS] +#define MAX_MENU_ITEMS 10 + + +char *debug_var; // system environment variable + +static char * sunrise_text = N_("sunrise"); +static char * sunset_text = N_("sunset"); +static char * first_light_text = N_("first_light"); +static char * talit_text = N_("talit"); +static char * midday_text = N_("midday"); +static char * first_stars_text = N_("first_stars"); +static char * three_stars_text = N_("three_stars"); +static char * sun_hour_text = N_("sun_hour"); +static char * candles_text = N_("candle-lighting"); +static char * havdalah_text = N_("havdalah"); + +typedef struct { + int hebrew; + int bidi; + int yom; + int leShabbat; + int leSeder; + int tablular_output; + int not_sunset_aware; + int print_tomorrow; + int quiet_alerts; + int sun; + int candles; + int havdalah; + int times; + int short_format; + int only_if_holiday; + int holidays; + int omer; + int only_if_parasha; + int parasha; + int julian; + int diaspora; + int iCal; + int menu; + char* menu_item[MAX_MENU_ITEMS]; + } option_list; + + +const char* hdate_config_file_text = N_("\ +# configuration file for hdate - Hebrew date information program\n\ +# part of package libhdate\n\ +#\n# Should you mangle this file and wish to restore its default content,\n\ +# rename or delete this file and run hdate; hdate will automatically\n\ +# regenerate the default content.\n#\n\ +# Your system administrator can set system-wide defaults for hcal by\n\ +# modifying file .\n\ +# You may override all defaults by changing the contents of this file.\n\ +#\n\ +# Version information\n\ +# This may be used by updates to hcal to determine how to parse the file\n\ +# and whether additional information and options should be appended to\n\ +# the end of this file.\n\ +VERSION=2.00\n\ +#\n\ +# Location awareness\n\ +# hdate wants to accurately highlight the current Hebrew day, including\n\ +# during the hours between sunset and secular midnight. If you don't\n\ +# provide it with latitude, longitude, and time zone information, hdate\n\ +# will try to guess the information, based upon your system timezone,\n\ +# and its (limited, and maybe biased) of the dominant Jewish community\n\ +# in that timezone. When hdate is forced to guess, it alerts the user\n\ +# with a message that includes the guessed location.\n\ +# hdate's guesses will also affect its default behaviour for output of\n\ +# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\ +#SUNSET_AWARE=TRUE\n\ +# LATITUDE and LONGITUDE may be in decimal format or in the form\n\ +# degrees[:minutes[:seconds]] with the characters :'\" as possible\n\ +# delimiters. Use negative values to indicate South and West, or\n\ +# use the abbreviated compass directions N, S, E, W.\n\ +#LATITUDE=\n\ +#LONGITUDE=\n\ +# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\ +# with the characters :'\" as possible delimiters.\n\ +#TIMEZONE=\n\n\ +# Output in hebrew characters\n\ +# hdate defaults to output all information in your default language, so\n\ +# if your default language is Hebrew, you're all set. Otherwise, you can\n\ +# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\ +# still outputting gregorian information in your default language. To\n\ +# output ALL information in Hebrew, run something like this:\n\ +# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n\ +# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\ +# output, you need to install a terminal font that includes the Hebrew\n\ +# character set (hint: unicode).\n\ +#FORCE_HEBREW=FALSE\n\n\ +# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\ +# Unfortunately, the world can not be depended upon to be either. Most\n\ +# Xwindow applications will display the data fine with FORCE_HEBREW; most\n\ +# xterm implementations will not. (in fact, the only xterm clone I know\n\ +# of that comes close is mlterm). If using FORCE_HEBREW results in\n\ +# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\ +# This will reverse the order of the Hebrew characters, so they will\n\ +# display 'visual'ly correct; however, such output will not be suitable\n\ +# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\ +# automatically forces hebrew.\n\ +#OUTPUT_BIDI=FALSE\n\n\ +# The Hebrew language output of Hebrew information can also be 'styled'\n\ +# in the following ways:\n\ +# option YOM ~> yom shishi, aleph tishrei ...\n\ +# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n\ +# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n\ +#YOM=FALSE\n\ +#LESHABBAT=FALSE\n\ +#LESEDER=FALSE\n\ +\n\ +#SUN_RISE_SET=FALSE\n\ +#TIMES_OF_DAY=FALSE\n\ +#SHORT_FORMAT=FALSE\n\ +#SEFIRAT_HAOMER=FALSE\n\ +#DIASPORA=FALSE\n\ +\n\ +\n\ +# Shabbat related\n\ +# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\ +# The command line options for these features are -r (--parasha), and\n\ +# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\ +# before sunset). The HAVDALAH field can accept a value of 20 - 90\n\ +# (minutes after sunset).\n\ +#PARASHA_NAMES=FALSE\n\ +#ONLY_IF_PARASHA_IS_READ=FALSE\n\ +#SHABBAT_INFO=FALSE\n\n\ +#CANDLE_LIGHTING=FALSE\n\ +#HAVDALAH=FALSE\n\n\ +# Holiday related\n\ +#HOLIDAYS=FALSE\n\ +#ONLY_IF_HOLIDAY=FALSE\n\n\ +# Tabular output\n\ +# This option has hdate output the information you request in a single\n\ +# comma-delimited line per day, suitable for piping or import to\n\ +# spreadsheet formatting applications, etc. To belabor the obvious,\n\ +# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n\ +# The command line option for this feature is, um, --table\n\ +#TABULAR=FALSE\n\n\ +# iCal format\n\ +# hdate can output its information in iCal-compatable format\n\ +# ICAL=FALSE\n\ +# Suppress alerts and warnings\n\ +# hdate alerts the user via STDERR when it guesses the user's location.\n\ +#QUIET_ALERTS=FALSE\n\n\ +# Julian day number\n\ +# The Julian day number is a .... See ... for more details.\n\ +# setting the option JULIAN_DAY will have hdate output that number in\n\ +# the format JDN-nnnnnnn at the beginning of its first line of output.\n\ +#JULIAN_DAY=FALSE\n\n\ +# User-defined menus\n\ +# You may specify here command-line strings to optionally be parsed\n\ +# by hcal at execution time. To do so, use the command line option -m\n\ +# (--menu). hcal will process first the settings of this config file,\n\ +# then the other settings of your command line, and then will prompt\n\ +# you for which menu item you would like to select. hcal will process\n\ +# your menu selection as if it were a new command line, further modifying\n\ +# all the prior settings.\n\ +# Only the first ten \"MENU=\" entries will be read. Each line will be\n\ +# truncated at one hundred characters\n\ +#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\ +#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n\ +#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n\ +#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\ +"); + + +/************************************************************ +* print version information +************************************************************/ +int print_version () +{ + printf ("%s\n" ,N_("hdate - display Hebrew date information\nversion 1.6")); + return 0; +} + +/************************************************************ +* print usage information +************************************************************/ +void print_usage_hdate () +{ + printf ("%s\n", +N_("Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n\ + hdate [options] [coordinates timezone] [julian_day]\n\n\ + coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n\ + -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\ + timezone: -z nn[( .nn | :mm )]\n\ +Try \'hdate --help\' for more information")); +} + + +/************************************************************ +* print help information +************************************************************/ +void print_help () +{ + print_usage_hdate(); + + printf ("%s\n", N_("hdate - display Hebrew date information\nOPTIONS:\n\ + -b --bidi prints hebrew in reverse (visual)\n\ + --visual\n\ + -c print Shabbat start/end times.\n\ + --candles modify default minhag of 20 minutes. (17hd_jd+(7-h->hd_dw)); + /* this return value is the reading number, + used to print parshiot */ + return hdate_get_parasha (&coming_Shabbat, opt_d); + } + + + +/************************************************************ +* print one date - both Gregorian and Hebrew +************************************************************/ +int print_date (hdate_struct * h, hdate_struct * tomorrow, option_list opt, double lat, double lon) +{ + char *motzash = ""; // prefix for Saturday night + char *eve_before = ""; // prefix if after sunset + char *for_day_of_g = ""; // Hebrew prefix for day of week + char *apostrophe = ""; // Hebrew suffix for day of week + char *bet_g = ""; // Hebrew prefix for Gregorian month + char *bet_h = ""; // Hebrew prefix for Hebrew month + char *psik_mark = ""; // --force-yom + char *for_day_of_h = ""; // --force-yom + char *for_week_of = ""; // --force-leshabbat --force-leseder + int is_parasha_read; + int h_dow_form = HDATE_STRING_SHORT; + + char *hday_int_str, *hyear_int_str; + hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + +/* +#ifdef ENABLE_NLS + locale = setlocale (LC_MESSAGES, NULL); + language = getenv ("LANGUAGE"); +#else + locale = NULL; + language = NULL; +#endif +*/ + + /************************************************************ + * preliminary - if it's after sunset, it's tomorrow already + * but we will only acknowledge this if printing in the long + * format (which is the default) + ************************************************************/ + if (opt.print_tomorrow) + { + if (opt.hebrew) + { + if (h->hd_dw==7) motzash = "מוצ\"ש, "; + if (h->hd_dw==6) eve_before = "ליל"; + else eve_before = "אור ל"; + if (!opt.yom) for_day_of_h="-"; + } + else eve_before = N_("eve of "); + } + + + /************************************************************ + * preliminary - prepare Hebrew prefixes if forcing any Hebrew + ************************************************************/ + if (opt.hebrew) + { + bet_h="ב"; + /* preliminary - prepare Yom prefix */ + if (opt.yom) + { + if ( !((opt.print_tomorrow) && (h->hd_dw==6))) for_day_of_h="יום"; + if ( ((h->hd_dw!=7) || ((h->hd_dw==7) && (opt.print_tomorrow))) && + ( !((opt.print_tomorrow) && (h->hd_dw==6))) ) apostrophe = "'"; + if ((h->hd_dw==6) && (opt.print_tomorrow)) h_dow_form = HDATE_STRING_LONG; + psik_mark=","; + + if (opt.leShabbat) + { + if (h->hd_dw==7) for_week_of="פרשת"; + else for_week_of="לשבת"; + } + else if (opt.leSeder) for_week_of="לסדר"; + } + } + + /************************************************************ + * preliminary - prepare the Hebrew prefixes + * for the Gregorian month and day of week + ************************************************************/ + if (hdate_is_hebrew_locale()) + { bet_g="ב"; for_day_of_g="יום ";} + + + + /************************************************************ + * Three major print formats: iCal, short, long + ************************************************************/ + + + /************************************************************ + * iCal format + ************************************************************/ + if (opt.iCal) + { + printf ("%s%s %s%s ", for_day_of_g, hday_int_str, bet_h, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew)); + + printf ("%s", hyear_int_str); + } + + + /************************************************************ + * short format + ************************************************************/ + else if (opt.short_format) + { + printf ("%d.%d.%d ", h->gd_day, h->gd_mon, h->gd_year); + + + if (!hdate_is_hebrew_locale() && (!opt.hebrew)) + { + printf ("%d", h->hd_day); + } + else + { + printf ("%s", hday_int_str); + } + + printf (" %s %s\n", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_int_str); + } + + + /************************************************************ + * long (normal) format + ************************************************************/ + else + { + /************************************************************ + * Gregorian date - the easy part + ************************************************************/ + printf ("%s%s, %d %s%s %d, ", + for_day_of_g, + hdate_string( HDATE_STRING_DOW, h->hd_dw, opt.short_format, HDATE_STRING_LOCAL), + h->gd_day, + bet_g, + hdate_string( HDATE_STRING_GMONTH, h->gd_mon, opt.short_format, HDATE_STRING_LOCAL), + h->gd_year); + + + /************************************************************ + * Start of the Hebrew date + ************************************************************/ + if (opt.print_tomorrow) *h = *tomorrow; + + + /************************************************************ + * All these definitions were backports to enable bidi + ************************************************************/ + char *hebrew_buffer, *hebrew_buffer1, *hebrew_buffer2, *hebrew_buffer3, *hebrew_buffer4, *hebrew_buffer_next; + size_t hebrew_buffer_len = 0; + size_t hebrew_buffer1_len = 0; + size_t hebrew_buffer2_len = 0; + size_t hebrew_buffer3_len = 0; + size_t hebrew_buffer4_len = 0; + + + /************************************************************ + * prepare buffers with Hebrew day of week, including + * possibly Shabbat name + ************************************************************/ + if (opt.hebrew) + { + if (opt.yom) + { + hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s%s%s %s%s", motzash, eve_before, for_day_of_h, + hdate_string( HDATE_STRING_DOW, h->hd_dw, h_dow_form, opt.hebrew), apostrophe); + if ((opt.leShabbat) || (opt.leSeder)) + { + is_parasha_read = find_shabbat(h, opt.diaspora); + if (is_parasha_read) + hebrew_buffer2_len = asprintf(&hebrew_buffer2, " %s %s", for_week_of, + hdate_string( HDATE_STRING_PARASHA, is_parasha_read, opt.short_format, opt.hebrew) + ); + } + hebrew_buffer3_len = asprintf (&hebrew_buffer3, "%s ", psik_mark); + } + } + else hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s", eve_before); + + + hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + /************************************************************ + * prepare buffers with Hebrew dd mmmm yyyy + ************************************************************/ + hebrew_buffer4_len = + asprintf (&hebrew_buffer4, "%s %s%s %s", + hday_int_str, + bet_h, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_int_str); + + /************************************************************ + * prepare another GrUB - grand unified buffer + ************************************************************/ + hebrew_buffer_len = hebrew_buffer1_len + hebrew_buffer2_len + hebrew_buffer3_len + hebrew_buffer4_len; + hebrew_buffer = malloc(hebrew_buffer_len+1); + + hebrew_buffer_next = mempcpy(hebrew_buffer, hebrew_buffer1, hebrew_buffer1_len); + if (hebrew_buffer2_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer2, hebrew_buffer2_len); + if (hebrew_buffer3_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer3, hebrew_buffer3_len); + hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer4, hebrew_buffer4_len); + hebrew_buffer[hebrew_buffer_len]='\0'; + /************************************************************ + * bidi support (what all the buffering was for) + ************************************************************/ + if (opt.bidi) revstr(hebrew_buffer, hebrew_buffer_len); + + /************************************************************ + * Finally. print the information + ************************************************************/ + printf ("%s\n", hebrew_buffer); + + /************************************************************ + * CLEANUP - free allocated memory + ************************************************************/ + if (hebrew_buffer1_len > 0) free(hebrew_buffer1); + if (hebrew_buffer2_len > 0) free(hebrew_buffer2); + if (hebrew_buffer3_len > 0) free(hebrew_buffer3); + free(hebrew_buffer4); + free(hebrew_buffer); + } + + + /************************************************************ + * CLEANUP - free allocated memory + ************************************************************/ + if (hday_int_str != NULL) free(hday_int_str); + if (hyear_int_str != NULL) free(hyear_int_str); + + return 0; +} + + + +/************************************************************ +* option 's' - sunrise/set times +************************************************************/ +int +print_sunrise (hdate_struct * h, double lat, double lon, int tz, int opt_i) +{ + int sunrise, sunset; + + /* get times */ + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + print_astronomical_time( sunrise_text, sunrise, tz); + print_astronomical_time( sunset_text, sunset, tz); + + return DATA_WAS_PRINTED; +} + + + +/************************************************************ +* option 't' - day times +************************************************************/ +int print_times (hdate_struct * h, double lat, double lon, int tz, int opt_i) +{ + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + + /* get times */ + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sun_hour, &first_light, &talit, &sunrise, + &midday, &sunset, &first_stars, &three_stars); + + print_astronomical_time( first_light_text, first_light, tz); + print_astronomical_time( talit_text, talit, tz); + print_astronomical_time( sunrise_text, sunrise, tz); + print_astronomical_time( midday_text, midday, tz); + print_astronomical_time( sunset_text, sunset, tz); + print_astronomical_time( first_stars_text, first_stars, tz); + print_astronomical_time( three_stars_text, three_stars, tz); + printf("%s: %02d:%02d\n",N_("sun_hour"), sun_hour/60, sun_hour%60); + + return DATA_WAS_PRINTED; +} + + + +/************************************************************ +* option 'h' - holiday identification +************************************************************/ +/* int print_holiday (hdate_struct * h, int opt.diaspora, int short_format, int opt_i) +{ + int holiday; + + holiday = hdate_get_holyday (h, opt.diaspora); + if (holiday) + { + printf ("%s\n", hdate_string (holiday, short_format)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} +*/ + +/************************************************************ +* option 'o' - sefirat ha'omer +************************************************************/ +int print_omer (hdate_struct * h, int const short_form, int const hebrew_form) +{ + int omer_day; + + omer_day = hdate_get_omer_day(h); + if (omer_day != 0) + { + printf ("%s %s \n", N_("today is day"), hdate_string(HDATE_STRING_OMER, omer_day, short_form, hebrew_form)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} + + + +/************************************************************ +* option 'r' - parashat hashavua +************************************************************/ +/* int print_reading (hdate_struct * h, int opt.diaspora, int short_format, int opt_i) +{ + int reading; + + reading = hdate_get_parasha (h, opt.diaspora); + if (reading) + { + printf ("%s %s\n", N_("Parashat"), hdate_string (reading, short_format)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} +*/ + + +/************************************************************ +* option 'c' - candle-lighting time; tzeit Shabbat +************************************************************/ +int print_candles (hdate_struct * h, double lat, double lon, int tz, option_list opt) +{ + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + + // check for friday - print knisat shabat + if ( (h->hd_dw == 6) && (opt.candles) ) + { + // get times + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + // FIXME - allow for further minhag variation + if (opt.candles != 1) sunset = sunset - opt.candles; + else sunset = sunset - DEFAULT_CANDLES_MINUTES; + + // print candlelighting times + print_astronomical_time( candles_text, sunset, tz); + return DATA_WAS_PRINTED; + } + + // check for saturday - print motzay shabat + else if ( (h->hd_dw == 7) && (opt.havdalah) ) + { + // get times + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, + lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + + // FIXME - allow for further minhag variation + if (opt.havdalah != 1) three_stars = sunset + opt.havdalah; + + // print motzay shabat + print_astronomical_time( havdalah_text, three_stars, tz); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} + +/************************************************************ +* print tabular header +************************************************************/ +void print_tabular_header( option_list opt) +{ + printf("%s,%s",N_("Gregorian date"), N_("Hebrew Date")); + if (opt.times) printf(",%s,%s,%s,%s,%s,%s,%s,%s",first_light_text,talit_text,sunrise_text,midday_text,sunset_text,first_stars_text,three_stars_text,sun_hour_text ); + else if (opt.sun) printf(",%s,%s",sunrise_text,sunset_text); + if (opt.candles) printf(",%s", candles_text); + if (opt.havdalah) printf(",%s", havdalah_text); + if (opt.holidays) printf(",%s",N_("holiday")); + if (opt.omer) printf(",%s",N_("omer count")); + if (opt.parasha) printf(",%s",N_("parashat")); + printf("\n"); +return; +} + +/************************************************************ +* print one day - tabular output * +************************************************************/ +int print_tabular_day (hdate_struct * h, option_list opt, + double lat, double lon, int tz) +{ + int sun_hour = -1; + int first_light = -1; + int talit = -1; + int sunrise = -1; + int midday = -1; + int sunset = -1; + int first_stars = -1; + int three_stars = -1; + + hdate_struct tomorrow; + int data_printed = 0; + + int parasha = 0; + int holiday = 0; + int omer_day = 0; + + char *hday_str = NULL; + char *hyear_str = NULL; + + // for bidi (revstr) + char *hebrew_buffer = NULL; + size_t hebrew_buffer_len = 0; + + /************************************************************ + * options -R, -H are restrictive filters, so if there is no + * parasha reading / holiday, print nothing. + ************************************************************/ + parasha = hdate_get_parasha (h, opt.diaspora); + holiday = hdate_get_holyday (h, opt.diaspora); + if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday) + return 0; + if (opt.only_if_parasha && !opt.only_if_holiday && !parasha) + return 0; + if (opt.only_if_holiday && !opt.only_if_parasha && !holiday) + return 0; + + + + /************************************************************ + * print Gregorian date + ************************************************************/ + printf ("%d.%d.%d,", h->gd_day, h->gd_mon, h->gd_year); + + + /************************************************************ + * begin - print Hebrew date + ************************************************************/ + + // BUG - looks like a bug - why sunset awareness in tabular output? + if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1); + + if (opt.bidi) + { + hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + hebrew_buffer_len = + asprintf (&hebrew_buffer, "%s %s %s", + hday_str, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_str); + revstr(hebrew_buffer, hebrew_buffer_len); + printf ("%s", hebrew_buffer); + if (hebrew_buffer != NULL) free(hebrew_buffer); + } + else + { + // review sometime whether both checks are still necessary (see below for hyear) + //if ((!hdate_is_hebrew_locale()) && (!opt.hebrew)) + //{ /* non hebrew numbers */ + // printf ("%d", h->hd_day); + //} + //else /* Hebrew */ + //{ + hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,opt.hebrew); + printf ("%s", hday_str); + //} + + printf (" %s ", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, opt.hebrew)); + + hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,opt.hebrew); + printf ("%s", hyear_str); + } + if (hday_str != NULL) free(hday_str); + if (hyear_str != NULL) free(hyear_str); + /************************************************************ + * end - print Hebrew date + ************************************************************/ + + + if (opt.times) + { + /* get astronomical times */ + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sun_hour, &first_light, &talit, &sunrise, + &midday, &sunset, &first_stars, &three_stars); + /* print astronomical times */ + print_astronomical_time_tabular( first_light, tz); + print_astronomical_time_tabular( talit, tz); + print_astronomical_time_tabular( sunrise, tz); + print_astronomical_time_tabular( midday, tz); + print_astronomical_time_tabular( sunset, tz); + print_astronomical_time_tabular( first_stars, tz); + print_astronomical_time_tabular( three_stars, tz); + printf(",%02d:%02d",sun_hour/60, sun_hour%60); + } + else if (opt.sun) + { + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + print_astronomical_time_tabular( sunrise, tz); + print_astronomical_time_tabular( sunset, tz); + } + + if (opt.candles) + { + if ( (h->hd_dw != 6) && (!opt.only_if_parasha) ) sunset = -1; //printf(","); + else + { + if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon, + h->gd_year, lat, lon, &sunrise, &sunset); + if (opt.candles != 1) sunset = sunset - opt.candles; + else sunset = sunset- DEFAULT_CANDLES_MINUTES; + } + print_astronomical_time_tabular( sunset, tz); + } + + if (opt.havdalah) + { + if ( (h->hd_dw != 7) && (!opt.only_if_parasha) ) three_stars = -1; //printf(","); + else + { + if (opt.havdalah != 1) + { + if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon, + h->gd_year, lat, lon, &sunrise, &sunset); + three_stars = sunset + opt.havdalah; + } + else + { + if(three_stars == -1) hdate_get_utc_sun_time_full ( + h->gd_day, h->gd_mon, h->gd_year, lat, + lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + } + } + print_astronomical_time_tabular( three_stars, tz); + } + + if (opt.holidays && holiday) + printf (",%s", + hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew)); + + if (opt.omer) + { + omer_day = hdate_get_omer_day(h); + if (omer_day != 0) printf (",%d", omer_day); + } + + if (opt.parasha && parasha) + { + if (!opt.bidi) printf (",%s", + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + else + { + hebrew_buffer_len = asprintf (&hebrew_buffer, "%s", + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + revstr(hebrew_buffer, hebrew_buffer_len); + printf (",%s", hebrew_buffer); + if (hebrew_buffer != NULL) free(hebrew_buffer); + } + } + printf("\n"); + + if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset(); + + return 0; +} + + + + +/************************************************************ +* print one day - regular output +************************************************************/ +int print_day (hdate_struct * h, option_list opt, + double lat, double lon, int tz) +{ + + time_t t; + hdate_struct tomorrow; + + int iCal_uid_counter = 0; + int data_printed = 0; + int parasha = 0; + int holiday = 0; + + + /************************************************************ + * options -R, -H are restrictive filters, so if there is no + * parasha reading / holiday, print nothing. + ************************************************************/ + parasha = hdate_get_parasha (h, opt.diaspora); + holiday = hdate_get_holyday (h, opt.diaspora); + if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday) + return 0; + if (opt.only_if_parasha && !opt.only_if_holiday && !parasha) + return 0; + if (opt.only_if_holiday && !opt.only_if_parasha && !holiday) + return 0; + + + /************************************************************ + * print the iCal event header + ************************************************************/ + if (opt.iCal) + { + printf ("BEGIN:VEVENT\n"); + printf ("UID:hdate-%ld-%d\n", time(&t), ++iCal_uid_counter); + printf ("DTSTART;VALUE=DATE:%04d%02d%02d\n", h->gd_year, + h->gd_mon, h->gd_day); + printf ("SUMMARY:"); + } + + + /************************************************************ + * print the Julian Day Number + ************************************************************/ + if (opt.julian) printf ("JDN-%d ", h->hd_jd); + + + /************************************************************ + * print the date + ************************************************************/ + if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1); + print_date (h, &tomorrow, opt, lat, lon); + + + + /************************************************************ + * begin - print additional information for day + ************************************************************/ + if (opt.print_tomorrow) *h = tomorrow; + if (opt.sun) data_printed = data_printed | print_sunrise (h, lat, lon, tz, opt.iCal); + if (opt.times) data_printed = data_printed | print_times (h, lat, lon, tz, opt.iCal); + if (opt.holidays && holiday) + { + printf ("%s\n", + hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew)); + data_printed = DATA_WAS_PRINTED; + } + if (opt.omer) data_printed = data_printed | print_omer (h, opt.short_format, opt.hebrew); + if (opt.parasha && parasha) + { + printf ("%s %s\n", N_("Parashat"), + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + data_printed = DATA_WAS_PRINTED; + } + if (opt.candles || opt.havdalah) data_printed = data_printed | print_candles (h, lat, lon, tz, opt); + if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset(); + /************************************************************ + * end - print additional information for day + ************************************************************/ + + + + + /************************************************************ + * print the iCal event footer + ************************************************************/ + if (opt.iCal) + { + printf ("\nCLASS:PUBLIC\n"); + printf ("DTEND;VALUE=DATE:%04d%02d%02d\n", h->gd_year, + h->gd_mon, h->gd_day); + printf ("CATEGORIES:Holidays\n"); + printf ("END:VEVENT\n"); + } + + return 0; +} + + + +/************************************************************ +* print one Gregorian month - tabular output +************************************************************/ +int print_tabular_gmonth( option_list opt, + double lat, double lon, int tz, int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_gdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month days */ + while (h.gd_mon == month) + { + print_tabular_day (&h, opt, lat, lon, tz); + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + + +/************************************************************ +* print one Gregorian month - regular output +************************************************************/ +int print_gmonth (option_list opt, double lat, double lon, int tz, + int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_gdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month header */ + if (!opt.iCal && !opt.short_format) + printf ("\n%s:\n", + hdate_string( HDATE_STRING_GMONTH, h.gd_mon, opt.short_format, HDATE_STRING_LOCAL)); + + /* print month days */ + while (h.gd_mon == month) + { + print_day (&h, opt, lat, lon, tz); + + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + + +/************************************************************ +* print one Hebrew month - tabular output * +************************************************************/ +int print_tabular_hmonth + ( option_list opt, double lat, double lon, int tz, + int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month days */ + while (h.gd_mon == month) + { + print_tabular_header( opt ); + print_tabular_day (&h, opt, lat, lon, tz); + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + +/************************************************************ +* print one Hebrew month - regular output +************************************************************/ +int print_hmonth (hdate_struct * h, option_list opt, + double lat, double lon, int tz, int month, int year) +{ + int jd; + + /* get date of month start */ + jd = h->hd_jd; + + /* print month header */ + if (!opt.iCal && !opt.short_format) + printf ("\n%s:\n", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew)); + + /* print month days */ + while (h->hd_mon == month) + { + print_day (h, opt, lat, lon, tz); + + jd++; + hdate_set_jd (h, jd); + } + return 0; +} + + + +/************************************************************ +* print one Gregorian year - tabular output * +************************************************************/ +int print_tabular_gyear + ( option_list opt, double lat, double lon, int tz, int year) +{ + int month = 1; + while (month < 13) + { + print_tabular_gmonth(opt, lat, lon, tz, month, year); + month++; + } + return 0; +} + + +/************************************************************ +* print one Hebrew year - tabular output * +************************************************************/ +int print_tabular_hyear + ( option_list opt, double lat, double lon, int tz, int year) +{ + hdate_struct h; + int month = 1; + + /* print year months */ + while (month < 13) + { + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_tabular_hmonth(opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_tabular_hmonth(opt, lat, lon, tz, 14, year); + } + else + { + print_tabular_hmonth(opt, lat, lon, tz, month, year); + } + month++; + } + return 0; +} + + + +/************************************************************ +* print one Gregorian year - regular output +************************************************************/ +int print_gyear (option_list opt, double lat, double lon, int tz, int year) +{ + + int month = 1; + + /* print year header */ + if (!opt.iCal && !opt.short_format) + printf ("%d:\n", year); + + /* print year months */ + while (month < 13) + { + print_gmonth ( opt, lat, lon, tz, month, year); + month++; + } + + return 0; +} + + + +/************************************************************ +* print one hebrew year - regular output +************************************************************/ +int print_hyear (option_list opt, double lat, double lon, int tz, int year) +{ + hdate_struct h; + int month = 1; + + char *h_int_str; + h_int_str = hdate_string(HDATE_STRING_INT, year,HDATE_STRING_LONG,opt.hebrew); + // FIXME - error check for NULL return value + + /* print year header */ + if (!opt.iCal && !opt.short_format) printf ("%s:\n", h_int_str); + + /* print year months */ + while (month < 13) + { + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_hmonth (&h, opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_hmonth (&h, opt, lat, lon, tz, 14, year); + } + else + { + print_hmonth (&h, opt, lat, lon, tz, month, year); + } + month++; + } + + return 0; +} + + + +/**************************************************** +* read and parse config file +****************************************************/ +void read_config_file( FILE *config_file, + option_list *opt, + double* latitude, + int* opt_latitude, + double* longitude, + int* opt_longitude, + int* tz ) +{ + char *input_string; + size_t input_str_len = 100; // WARNING: if you change this value + // you will still have to also + // change a matching value below + // in the statement that includes: + // match_count = sscanf(input_string + char *input_key = ""; + char *input_value = ""; + int menu_item = 0; + size_t menu_len = 0; + int line_count = 0; + int match_count; + int end_of_input_file = FALSE; + int i; + const int num_of_keys = 26; + const char* key_list[] = { "SUNSET_AWARE", // 0 + "LATITUDE", + "LONGITUDE", // 2 + "TIMEZONE", + "DIASPORA", // 4 + "FORCE_ISRAEL", + "PARASHA_NAMES", // 6 + "SHABBAT_INFO", + "FORCE_HEBREW", // 8 + "OUTPUT_BIDI", + "QUIET_ALERTS", //10 + "YOM", + "LESHABBAT", //12 + "LESEDER", + "TABULAR", //14 + "ICAL", + "SEFIRAT_HAOMER", //16 + "SHORT_FORMAT", + "TIMES_OF_DAY", //18 + "SUN_RISE_SET", + "ONLY_IF_PARASHA_IS_READ", + "ONLY_IF_HOLIDAY", + "JULIAN_DAY", //22 + "CANDLE_LIGHTING", + "HAVDALAH", //24 + "MENU" + }; + + input_string = malloc(input_str_len+1); + input_key = malloc(input_str_len+1); + input_value = malloc(input_str_len+1); + + while ( end_of_input_file != TRUE ) + { + end_of_input_file = getline(&input_string, &input_str_len, config_file); + if ( end_of_input_file != TRUE ) + { + errno = 0; + // The '100' in the next statement is inelegant; it is meant to + // be the value of input_str_len. Alternatively, don't malloc + // input_value above, use the 'a' specifier here, and free(input_value) + // at the end of every successful read and evaluation + match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value); + line_count++; + if (errno != 0) error(0,errno,"scan error at line %d", line_count); + if (match_count ==2) + { + for (i=0; inot_sunset_aware = 1; + else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0; + break; + +// LATITUDE + case 1: + parse_coordinate(1, input_value, latitude, opt_latitude); + break; + +// LONGITUDE + case 2: + parse_coordinate(2, input_value, longitude, opt_longitude); + break; + +// TIMEZONE + case 3: + parse_timezone(input_value, tz); + break; + +// DIASPORA + case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1; + break; + + +// case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0; +// else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1; + break; + +// PARASHA_NAMES + case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1; + break; + +// SHABBAT_INFO + case 7:if (strcmp(input_value,"FALSE") == 0) + { + // maybe not do anything if set FALSE + opt->candles = 0; + opt->havdalah = 0; + opt->parasha = 0; + } + else if (strcmp(input_value,"TRUE") == 0) + { + opt->candles = 1; + opt->havdalah = 1; + opt->parasha = 1; + } + break; + +// FORCE_HEBREW + case 8:if (strcmp(input_value,"FALSE") == 0) opt->hebrew = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->hebrew = 1; + break; + +// OUTPUT_BIDI + case 9:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->bidi = 1; + opt->hebrew = 1; + } + break; + +// QUIET_ALERTS + case 10:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1; + break; + +// YOM + case 11:if (strcmp(input_value,"FALSE") == 0) opt->yom = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// LESHABBAT + case 12:if (strcmp(input_value,"FALSE") == 0) opt->leShabbat = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->leShabbat = 1; + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// LESEDER + case 13:if (strcmp(input_value,"FALSE") == 0) opt->leSeder = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->leSeder = 1; + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// TABULAR + case 14:if (strcmp(input_value,"FALSE") == 0) opt->tablular_output = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->tablular_output = 1; + break; + +// ICAL + case 15:if (strcmp(input_value,"FALSE") == 0) opt->iCal = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->iCal = 1; + break; + +// SEFIRAT_HAOMER + case 16:if (strcmp(input_value,"FALSE") == 0) opt->omer = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->omer = 1; + break; + +// SHORT_FORMAT + case 17:if (strcmp(input_value,"FALSE") == 0) opt->short_format = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->short_format = 1; + break; + +// TIMES_OF_DAY + case 18:if (strcmp(input_value,"FALSE") == 0) opt->times = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->times = 1; + break; + +// SUN_RISE_SET + case 19:if (strcmp(input_value,"FALSE") == 0) opt->sun = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->sun = 1; + break; + +// ONLY_IF_PARASHA_IS_READ + case 20:if (strcmp(input_value,"FALSE") == 0) opt->only_if_parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->only_if_parasha = 1; + break; + +// ONLY_IF_HOLIDAY + case 21:if (strcmp(input_value,"FALSE") == 0) opt->only_if_holiday = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->only_if_holiday = 1; + break; + +// JULIAN_DAY + case 22:if (strcmp(input_value,"FALSE") == 0) opt->julian = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->julian = 1; + break; + +// CANDLE_LIGHTING + case 23:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(input_value); + if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES; + else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES; + } + break; + +// HAVDALAH + case 24:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(input_value); + if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES; + else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES; + } + break; + +// MENU + case 25:if (menu_item < MAX_MENU_ITEMS) + { + menu_len = strlen(input_value); + opt->menu_item[menu_item] = malloc(menu_len+1); + memcpy(opt->menu_item[menu_item], input_value,menu_len); + menu_item++; + } + break; + + } // end of switch(i) + break; // if found a match don't continue for loop + } + } + } + } + } + free(input_string); + free(input_key); + free(input_value); + return; +} + + +/**************************************************** +* exit elegantly +****************************************************/ +void exit_main( option_list *opt, int exit_code) +{ + int i; + for (i=0; imenu_item[i] == NULL) break; + free(opt->menu_item[i]); + } + exit (exit_code); +} + + + +/**************************************************** +* parse a command-line or a config-file menu line +* +* It was appropriate to make this a function, outside +* of main, because of its dual use and dual reference +****************************************************/ +int hdate_parser( int switch_arg, option_list *opt, + double *lat, int *opt_latitude, + double *lon, int *opt_Longitude, + int *tz, int long_option_index) +{ + int error_detected = 0; + + switch (switch_arg) + { + + case 0: /* long options */ + switch (long_option_index) + { +/* --version */ case 0: print_version (); exit_main(opt,0); break; +/* --help */ case 1: print_help (); exit_main(opt,0); break; +/* --hebrew */ case 2: opt->hebrew = 1; break; +/* --yom */ case 3: + opt->yom = 1; + opt->hebrew = 1; + break; +/* --leshabbat */ case 4: + opt->leShabbat = 1; + opt->yom = 1; + opt->hebrew = 1; + break; +/* --leseder */ case 5: + opt->leSeder = 1; + opt->yom = 1; + opt->hebrew = 1; + break; +/* --table */ case 6: break; +/* --not-sunset-aware */case 7: opt->not_sunset_aware = 1; break; +/* --quiet-alerts */ case 8: break; +/* --short-format */ case 9: break; +/* --parasha */ case 10:break; +/* --holidays */ case 11:break; +/* --shabbat-times */ case 12:break; +/* --sun */ case 13: +/* --sunset */ case 14: +/* --sunrise */ case 15:break; +/* --candle-lighting */ case 16: +/* --candles */ case 17: + if (optarg == NULL) opt->candles = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(optarg); + if ( (opt->candles >= MIN_CANDLES_MINUTES) && + (opt->candles <= MAX_CANDLES_MINUTES) ) break; + } + print_parm_error("--candles"); // do not gettext! + error_detected++; + } + break; + +/* --havdalah */ case 18: + if (optarg == NULL) opt->havdalah = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(optarg); + if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) && + (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break; + } + print_parm_error("--havdalah"); // do not gettext! + error_detected++; + } + break; + +/* --latitude */ case 19:break; +/* --longitude */ case 20:break; +/* --timezone */ case 21:break; +/* --bidi */ case 22: +/* --visual */ case 23:break; +/* --omer */ case 24:break; +/* --ical */ case 25:break; +/* --julian */ case 26:break; +/* --diaspora */ case 27:break; +/* --menu */ case 28:break; + + } // end switch for long_options + break; + + + case 'b': opt->bidi = 1; opt->hebrew = 1; break; + case 'c': if (opt->candles == 0) opt->candles = 1; + if (opt->havdalah == 0) opt->havdalah = 1; + break; + case 'd': opt->diaspora = 1; break; + case 'H': opt->only_if_holiday = 1; /* why no break? */ + /* it seems ok 'H' is used only to abort + a print, so it always needs 'h' set */ + case 'h': opt->holidays = 1; break; + case 'i': opt->iCal = 1; break; + case 'j': opt->julian = 1; break; + case 'q': opt->quiet_alerts = 1; break; + case 'm': opt->menu = 1; break; + case 'o': opt->omer = 1; break; + case 'R': opt->only_if_parasha = 1; + case 'r': opt->parasha = 1; break; + case 'S': opt->short_format = 1; break; + case 's': opt->sun = 1; break; + case 't': opt->times = 1; break; + case 'T': opt->tablular_output = 1; break; + case 'l': + error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude); + break; + case 'L': + error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude); + break; + case 'z': + error_detected = error_detected + parse_timezone(optarg, tz); + break; + case '?': +// if (strchr(short_options,optopt)==NULL) +// error(0,0,"option %c unknown",optopt); + print_parm_missing_error((char*) &optopt); + error_detected = TRUE; + break; + default: + print_usage_hdate (); exit_main(opt,0); break; + } + + return error_detected; +} + + + + + +/************************************************************ +************************************************************* +************************************************************* +* main function +************************************************************* +************************************************************* +************************************************************/ +int main (int argc, char *argv[]) +{ + + hdate_struct h; /* The Hebrew date */ + int c; + + int day; /* The Gregorian date */ + int month; + int year; + + double lat = BAD_COORDINATE; /* set to this value for error handling */ + double lon = BAD_COORDINATE; /* set to this value for error handling */ + int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */ + + int opt_latitude = 0; /* -l option latitude */ + int opt_Longitude = 0; /* -L option longitude */ + + int error_detected = FALSE; /* exit after reporting ALL bad parms */ + + + option_list opt; + opt.hebrew = 0; + opt.bidi = 0; + opt.yom = 0; + opt.leShabbat = 0; + opt.leSeder = 0; + opt.tablular_output = 0; + opt.not_sunset_aware = 0; + opt.quiet_alerts = 0; + opt.print_tomorrow = 0; /* This isn't a command line option; + It here to restrict sunset_aware to + single-day outputs */ + opt.sun = 0; /* -s option sunrise/set times */ + opt.candles = 0; + opt.havdalah = 0; + opt.times = 0; /* -t option print times of day */ + opt.short_format = 0; /* -S Short format flag */ + opt.holidays = 0; /* -h option holidays */ + opt.only_if_holiday = 0; /* -H option just holidays */ + opt.parasha = 0; /* -r option reading */ + opt.only_if_parasha = 0; /* -R option just reading */ + opt.julian = 0; /* -j option Julian day number */ + opt.diaspora = 0; /* -d option diaspora */ + opt.iCal = 0; /* -i option iCal */ + opt.omer = 0; /* -o option Sfirat Haomer */ + + opt.menu = 0; // -m print menus for user-selection + int i; + for (i=0; i 348021) + { + hdate_set_jd (&h, year); + + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_day(&h, opt, lat, lon, tz); + } + else + { + if (opt.iCal) print_ical_header (); + print_day (&h, opt, lat, lon, tz); + if (opt.iCal) print_ical_footer (); + } + } + + + /************************************************************ + * process entire Hebrew year + ************************************************************/ + else if (year > 3000) + { + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_hyear( opt, lat, lon, tz, year); + } + else + { + if (opt.iCal) print_ical_header (); + print_hyear ( opt, lat, lon, tz, year); + if (opt.iCal) print_ical_footer (); + } + } + /************************************************************ + * process entire Gregorian year + ************************************************************/ + else + { + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_gyear( opt, lat, lon, tz, year); + } + else + { + if (opt.iCal) print_ical_header (); + + print_gyear ( opt, lat, lon, tz, year); + + if (opt.iCal) print_ical_footer (); + } + + } + } + + + /************************************************************ + * parse input date - only month and year entered + ************************************************************/ + else if (argc == (optind + 2)) + { + + year = atoi (argv[optind + 1]); + month = atoi (argv[optind]); + + /* handle errors */ + if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); } + + + /************************************************************ + * process entire Hebrew month + ************************************************************/ + if (year > 3000) + { + /* begin bounds check for month */ + if ((month <= 0) || (month > 14)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + /* end bounds check for month */ + + + if (opt.tablular_output) + { + print_tabular_header( opt ); + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_tabular_hmonth ( opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_tabular_hmonth ( opt, lat, lon, tz, 14, year); + } + else + { + print_tabular_hmonth ( opt, lat, lon, tz, month, year); + } + } + else + { + if (opt.iCal) print_ical_header (); + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_hmonth (&h, opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_hmonth (&h, opt, lat, lon, tz, 14, year); + } + else + { + print_hmonth (&h, opt, lat, lon, tz, month, year); + } + if (opt.iCal) + print_ical_footer (); + } + } + + /************************************************************ + * process entire Gregorian month + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_gmonth(opt, lat, lon, tz, month, year); + } + + else + { + if (opt.iCal)print_ical_header (); + + print_gmonth (opt, lat, lon, tz, month, year); + + if (opt.iCal) print_ical_footer (); + } + } + } + + + /************************************************************ + * parse input date - day, month and year entered + ************************************************************/ + else if (argc == (optind + 3)) + { + year = atoi (argv[optind + 2]); + month = atoi (argv[optind + 1]); + day = atoi (argv[optind]); + + /* handle error */ + if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); } + + + /************************************************************ + * get Hebrew date + ************************************************************/ + if (year > 3000) + { + /* begin bounds check for month */ + if ((month <= 0) || (month > 14)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + /* end bounds check for month */ + + if ((day <= 0) || (day > 30) || + ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) || + (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) || + (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) ) + { print_parm_error(N_("day")); exit_main(&opt,0); } + + + hdate_set_hdate (&h, day, month, year); + } + + /************************************************************ + * get Gregorian date + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + if ((day <= 0) || + ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) || + ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) || + ((day > 29) && (month==2) && ((year%4)==0)) || + ((day > 28) && (month==2) && ((year%4)!=0)) + ) + { print_parm_error(N_("day")); exit_main(&opt,0); } + + hdate_set_gdate (&h, day, month, year); + } + + /************************************************************ + * process a single date + ************************************************************/ + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_day(&h, opt, lat, lon, tz); + } + + else + { + if (opt.iCal) print_ical_header (); + print_day (&h, opt, lat, lon, tz); + + if (opt.iCal) print_ical_footer (); + } + } + + + /************************************************************ + * parse input date - too many fields were received + ************************************************************/ + else + { + error(0,0,"%s", N_("too many arguments; after options max is dd mm yyyy")); + exit_main(&opt,0); + } + + return 0; +} diff --git a/.pc/duplicate_gnu_source.patch/examples/hcal/local_functions.c b/.pc/duplicate_gnu_source.patch/examples/hcal/local_functions.c new file mode 100644 index 0000000..aa001b7 --- /dev/null +++ b/.pc/duplicate_gnu_source.patch/examples/hcal/local_functions.c @@ -0,0 +1,933 @@ +/* local_functions.c http://libhdate.sourceforge.net + * a collection of functions in support of both hcal.c and hdate.c + * hcal.c Hebrew calendar (part of package libhdate) + * hdate.c Hebrew date/times information(part of package libhdate) + * + * compile: + * gcc `pkg-config --libs --cflags libhdate` ocal_functions.c -o local_functions + * + * Copyright: 2011-2012 (c) Boruch Baum + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/************************************************** +* functions to support hcal and hdate +**************************************************/ +#define _GNU_SOURCE // For mempcpy, asprintf + +#include // For hebrew date +//include "../../src/hdate.h" +#include // For atoi, malloc +#include // For error +#include // For errno +#include // For time +#include // for isprint +#include // For fnmatch +#include // For mempcpy +#include // For optarg, optind +#include // For printf, fopen, fclose, fprintf, snprintf. FILE +#include // for get pwuid +#include // for getuid +#include +#include // for mkdir, + + +// support for fnmatch +#define FNM_EXTMATCH (1 << 5) +#define FNM_NOFLAG 0 + +#define BAD_COORDINATE 999 +#define BAD_TIMEZONE 999 +#define DELTA_LONGITUDE 30 + +#define EXIT_CODE_BAD_PARMS 1 + + + +// copied from support.h in src dir +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + +#define FALSE 0 +#define TRUE -1 + + +// support for options parsing +#define MIN_CANDLES_MINUTES 18 +#define DEFAULT_CANDLES_MINUTES 20 +#define MAX_CANDLES_MINUTES 90 +#define MIN_MOTZASH_MINUTES 20 +#define MAX_MOTZASH_MINUTES 90 + + +/************************************************************ +* begin - error message functions +************************************************************/ +void print_parm_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("parameter"), parm_name, + N_("is non-numeric or out of bounds")); +} + +void print_parm_missing_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("missing parameter")); +} + +void print_alert_timezone( int tz ) +{ + error(0,0,"%s: %s, %+d:%d UTC", + N_("ALERT: time zone not entered, using system local time zone"), + *tzname, tz/60, tz%60); +} + +void print_parm_invalid_error( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("is not a valid option")); +} + + +/************************************************************ +* end - error message functions +************************************************************/ + + + + +/************************************************************ +* begin - alert message functions +************************************************************/ +void print_alert_coordinate( char *city_name ) +{ + error(0,0,"%s %s", + N_("ALERT: guessing... will use co-ordinates for"), + city_name); +} + +void print_alert_default_location( int tz ) +{ + switch (tz/60) + { + case -8: print_alert_coordinate( N_("Los Angeles") ); break; + case -6: print_alert_coordinate( N_("Mexico City") ); break; + case -5: print_alert_coordinate( N_("New York City") ); break; +// case -5: print_alert_coordinate( N_("Toronto") ); break; +// case -3: print_alert_coordinate( N_("Sao Paolo") ); break; + case -3: print_alert_coordinate( N_("Buenos Aires") ); break; + case 0: print_alert_coordinate( N_("London") ); break; + case 1: print_alert_coordinate( N_("Paris") ); break; + case 2: print_alert_coordinate( N_("Tel-Aviv") ); break; + case 3: print_alert_coordinate( N_("Moscow") ); break; + case 5: print_alert_coordinate( N_("Tashkent") ); break; + case 8: print_alert_coordinate( N_("Beijing") ); break; +// case 8: print_alert_coordinate( N_("Hong Kong") ); break; + case -10: print_alert_coordinate( N_("Honolulu") ); break; + default: error(0,0,"%s \n%s", N_("Hmmm, ... hate to do this, really ..."), N_("using co-ordinates for the equator, at the center of time zone")); break; + } +} +/************************************************************ +* end - alert message functions +************************************************************/ + + + +/************************************************************ +* set default location +************************************************************/ +void set_default_location( int tz, double *lat, double *lon ) +{ + /* Temporarily, set some default lat/lon coordinates + for certain timezones */ + +/** +{ 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ), +{ 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ), +{ 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ), +{ 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ), +{ 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ), +{ 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ), +{ 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ), +{ 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ), +{ 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ), +{ 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ), +{ 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ), +{ 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ), +{ 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ), +{ 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ), +{ 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ), +{ 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ), +{ 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ), +{ 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ), +{ 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ), +{ 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' ) +**/ + + switch (tz/60) + { + case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles + case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City + case -5: *lat = 40.0; *lon = -74.0; break; // New York +// case -5: *lat = 43.71; *lon = -79.43; break; // Toronto +// case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo + case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires + case 0: *lat = 51.0; *lon = 0.0; break; // London + case 1: *lat = 48.0; *lon = 2.0; break; // Paris + case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv + case 3: *lat = 55.0; *lon = 37.0; break; // Moscow + case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent + case 8: *lat = 39.90; *lon = 116.38; break; // Beijing +// case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong + case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu + default: *lat = 0.0; *lon = tz * .25; break; // center of timeone: + // .25 = (15 degrees) / 60 [because tz is in minutes, not hours] + } + return; +} + + + +/************************************************************ +* check for sunset +************************************************************/ +int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone ) +{ + time_t now_time; + struct tm *now_timep; + int sunrise, sunset; + + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + time(&now_time); + now_timep = localtime(&now_time); + + if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1; + else return 0; +} + + + + +/*********************************************************** + * reverse a hebrew string (for visual bidi) + * parameters: + * source is a pointer to a writeable buffer. + * source_len is the length of a string in source. This + * length must be LESS than the size of the source buffer +***********************************************************/ +void revstr( char *source, const size_t source_len) +{ + #define H_CHAR_WIDTH 2 + +#define DEBUG 0 +#if DEBUG +printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source); +#endif + + if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);}; + if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);}; + + size_t i,j; + char *temp_buff; + + temp_buff = malloc(source_len+2); + if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);}; + + for (i=(source_len-1), j=0; j < source_len; i--, j++) + { + if (isprint(source[i])) temp_buff[j] = source[i]; + else + { + // FIXME - presumes H_CHAR_WIDTH = 2 + temp_buff[j++] = source[i-1]; + temp_buff[j] = source[i--]; + } + } + memcpy(source, temp_buff, source_len); + source[source_len] = '\0'; +#if DEBUG +printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source); +#endif + free(temp_buff); + return; +} + + +/************************************************************ +* parse coordinate +* +* presumes commandline options were parsed using getopt. +* returns 1 to *opt_found on success +* returns the floating point value of the coordinate in *coordinate +* +* type_flag (1-latitude, 2=longitude) +************************************************************/ +int parse_coordinate( const int type_flag, char *input_string, + double *coordinate, int *opt_found) +{ +//#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" +//#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" + +#define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])" + +#define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])" + + char* seconds; + + double fractional_part = 0; + int direction_modifier = 1; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if (!input_string) + { + if (type_flag == 1) print_parm_missing_error(N_("l (latitude)")); + else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)")); + return TRUE; // error_detected = TRUE; ie failure + } + + /************************************************************ + * parse latitude + ************************************************************/ + if (type_flag == 1) + { + if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("l (latitude)")); + else print_parm_error(N_("l (latitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1; + + + if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS")); + } + else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS:'\"")); + fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60; + seconds = strtok( NULL, "nNsS:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -90) && (*coordinate < 90) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + /************************************************************ + * parse longitude + ************************************************************/ + if (type_flag == 2) + { + if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("L (Longitude)")); + else print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1; + + + if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW")); + } + else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW:'\"")); + fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60; + seconds = strtok( NULL, "eEwW:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -180) && (*coordinate < 180) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + +printf("INTERNAL ERROR: coordinate parse\n"); +return TRUE; // error_detected = TRUE; ie failure +} + +/************************************************************ +* parse timezone +* +* presumes commandline options were parsed using getopt. +* timezone is returned in minutes, not hours +************************************************************/ +int parse_timezone( char *input_string, int *tz) +{ +#define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))" +#define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))" + + int fractional_part; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if ((!input_string) || + ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) && + (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) && + (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) ) + { + print_parm_missing_error(N_("z (time zone)")); + } + else + { + if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *tz = (int) ( atof (input_string) * 60 ); + } + else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0) + { + *tz = atoi( strtok( input_string, ":'\"")) * 60; + fractional_part = atoi( strtok( NULL, ":'\"")); + if (*tz < 0) *tz = *tz - fractional_part; + else *tz = *tz + fractional_part; + } + + if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours + { + return FALSE; // error_detected = FALSE; ie. success + } + else print_parm_error(N_("z (timezone)")); + } + return TRUE; // error_detected = TRUE; ie failure +} + + + + +/************************************************************ +* validate location parameters - lat, lon, tz +************************************************************/ +// originally, this was only for hdate, now also for hcal +// originally, we did this only if we needed the information +// now, because of sunset-awareness, we always perform these checks +// if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) ) +void validate_location( const int opt_latitude, const int opt_Longitude, + double *lat, double *lon, + int *tz, const int quiet_alerts, int error_detected, + void (*print_usage)() ) +{ + + /* latitude and longitude must be paired */ + if ( (opt_latitude) && (!opt_Longitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude")); + error_detected = TRUE; + } + else if ( (opt_Longitude) && (!opt_latitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude")); + error_detected = TRUE; + } + + + if (!error_detected) + { + // if no timezone entered, choose guess method + if (*tz==BAD_TIMEZONE) + { + // system timezone is in seconds, but we deal in minutes + tzset(); + *tz = timezone /-60; + + if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) ) + { + /* reject system local timezone, because it's + too far from the longitude explicitly provided + by the user; guess based on longitude entered */ + *tz = (*lon /15) * 60; + } + if (!quiet_alerts) print_alert_timezone( *tz ); + if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) ) + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + } + printf("\n"); + } + else + { /* we have timezone, what about latitude and longitude? */ + if ( (opt_Longitude) && (opt_latitude) ) + { + // sanity-check longitude versus timezone + // timezone is in minutes + if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE ) + { + error(0,0,"%s %d:%d %s %.3f %s", + N_("time zone value of"), *tz/60, *tz%60, + N_("is incompatible with a longitude of"), *lon, N_("degrees")); + error_detected = TRUE; + } + } + else + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + printf("\n"); + } + } + } + + /* exit after reporting all bad parameters found */ + if (error_detected) + { + print_usage(); + exit(EXIT_CODE_BAD_PARMS); + } +} + + +/************************************************************ +* check validity of date parameters +************************************************************/ +#define CHECK_DAY_PARM 1 +#define CHECK_MONTH_PARM 2 +#define CHECK_YEAR_PARM 3 +int validate_hdate (int parameter_to_check, int day, int month, int year) +{ + hdate_struct h; + + if (year < 0) return FALSE; + + switch (parameter_to_check) + { + + case CHECK_DAY_PARM: + + /************************************************************ + * check day in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((day < 1) || (day > 30) || + ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) || + (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) || + (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) ) + return FALSE; + return TRUE; + } + + /************************************************************ + * check day in Gregorian date + ************************************************************/ + else + { + if ((day < 1) || + ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) || + ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) || + ((day > 29) && (month==2) && ((year%4)==0)) || + ((day > 28) && (month==2) && ((year%4)!=0)) + ) + return FALSE; + return TRUE; + } + break; + + + case CHECK_MONTH_PARM: + + /************************************************************ + * check month in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + if ((month <= 0) || (month > 14)) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) return FALSE; + return TRUE; + } + + /************************************************************ + * check month in Gregorian date + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) return FALSE; + return TRUE; + } + break; + + case CHECK_YEAR_PARM: + if (year > 10999) return FALSE; + return TRUE; + break; + } + return FALSE; +} + +/************************************************************ +* Greeting message to new version +************************************************************/ +void greetings_to_version_16() +{ + error(0,0,"%s",N_("\ +This seems to be to be your first time using this version.\n\ +Please read the new documentation in the man page and config\n\ +file. Attempting to create a config file ...")); +} + + +/************************************************************ +* Open config file, or create one +* - returns filepointer or NULL +* - if file does not exist, attempt to create it +************************************************************/ +FILE* get_config_file( const char* config_dir_name, + const char* config_file_name, + const char* default_config_file_text ) +{ + size_t path_len; + + char* config_home_path_name = ""; + char* config_sub_path_name = ""; + + char* config_dir_path; + char* config_file_path; + + FILE* config_file; + + /************************************************************ + * sub-function to get_config_file: create_config_file + ************************************************************/ + void create_config_file() + { + config_file = fopen(config_file_path, "a"); + if (config_file == NULL) + { + error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path); + return; + } + fprintf(config_file, "%s", default_config_file_text); + error(0,0,"%s: %s",N_("config file created"), config_file_path); + if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); + } + + /************************************************************ + * sub-function to get_config_file: open_config_file + ************************************************************/ + int open_config_file() + { + config_file = fopen(config_file_path, "r"); + if (config_file == NULL) + { + if (errno != ENOENT) return FALSE; + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + + strlen(config_sub_path_name) + + strlen(config_dir_name) +1; + if (path_len < 1) return FALSE; + config_dir_path = malloc(path_len); + if (config_dir_path == NULL) + { + error(0,errno,"%s",N_("memory allocation failure")); + return FALSE; + } + snprintf(config_dir_path, path_len, "%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name); + + if ((mkdir(config_dir_path, (mode_t) 0700) != 0) && + (errno != EEXIST)) + { + free(config_dir_path); + return FALSE; + } + greetings_to_version_16(); + create_config_file(); + free(config_dir_path); + return FALSE; + } + return TRUE; + } + + +/************************************************************ +* main part of function get_config_file +************************************************************/ + config_home_path_name = getenv("XDG_CONFIG_HOME"); + if (config_home_path_name == NULL) + { + config_home_path_name = getenv("HOME"); + if (config_home_path_name == NULL) + { + struct passwd *passwdEnt = getpwuid(getuid()); + config_home_path_name = passwdEnt->pw_dir; + if (config_home_path_name == NULL) return NULL; + } + config_sub_path_name = "/.config"; + } + + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + strlen(config_sub_path_name) + + strlen(config_dir_name) + strlen(config_file_name) + 1; + if (path_len < 1) return NULL; + config_file_path = malloc(path_len); + if (config_file_path == NULL) + { + error(0,errno,"memory allocation failure"); + return NULL; + } + snprintf(config_file_path, path_len, "%s%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name, config_file_name); + + if (open_config_file() == TRUE) + { + free(config_file_path); + return config_file; + } + else + free(config_file_path); + return NULL; +} + + + + +/********************************************************************** +* parse user's menu selection into options and their posibile +* arguments, which can then be parsed (processed really) +* +* menuptr points to the beginning of the menu entry string. This +* pointer should initially be set to NULL. +* menu_len is the length of the menu entry string +* menu_index is the current position of the parser within the string. +* This value should initially be set to 0. +* optptr is a pointer into which we put the location of option text +* to be parsed. This pointer should initially be set to NULL. +* optarg is a pointer to a possible argument to the option. This is a +* global variable defined by GNU getopt(), so it shouldn't be +* declared or passed. +* long_options is a pointer to a structure of type option, as defined +* by getopt_long() +* long_option_index is a pointer to position found in long_options, and +* simulates the similar value returned by getopt_long() +* error_detected is a pointer to an accumulator used to delay aborting +* the program until after ALL input syntax errors are reported. +* +* RETURN VALUES: +* -1 means the menu line string has been completely parsed. +* Otherwise, the return value should be the short option character +* found, or in the case of a long option found, 0. +* This should sound suspiciously similar to the return values issued +* by getopt_long(). +***********************************************************************/ +int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index, + char** optptr, char* short_options, + struct option *long_options, int *long_option_index, + int *error_detected) +{ + int ahead_index; + char *ahead; + + while ( (*menu_index < menu_len) && + (menuptr[*menu_index] != '#') ) + { + if (menuptr[*menu_index] == '-') + { + if ( ( (*menu_index+1) >= menu_len) || + (menuptr[*menu_index+1] == '#') ) break; + else if (menuptr[*menu_index+1] == '-') + { + if ( ( (*menu_index+2) >= menu_len) || + (menuptr[*menu_index+2] == '#') ) break; + *menu_index = *menu_index +2; + + /************************************************** + * We have identified the beginning of what could + * be a long option string. We store a pointer to + * it in optptr and proceed to: + * find its endpoint + * terminate it with a null + * if it has an argument, store a pointer to + * it in optarg and terminate it with a null. + * Then we compare the optptr to our list of + * valid longoptions and pass the information + * to the option parser + *************************************************/ + *optptr = &menuptr[*menu_index]; // ?? + ahead = *optptr; + ahead_index = *menu_index; + while ( (ahead_index < menu_len) && + (strchr(" =#",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + if (memcmp(ahead,"=",1)==0) + { + *ahead = '\0'; + ahead++; + optarg = ahead; + ahead_index++; + while ( (ahead_index < menu_len) && + (strchr(" #",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + } + if ((*ahead == '#' ) && ((ahead_index+1) < menu_len)) + ahead[1] = '#'; + *ahead = '\0'; + *long_option_index = 0; + while ( (long_options[*long_option_index].name != 0) && + (strcmp(long_options[*long_option_index].name, *optptr) != 0) ) + *long_option_index = *long_option_index + 1; + if (long_options[*long_option_index].name == 0) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *menu_index = ahead_index; + return long_options[*long_option_index].val; + } + } + else + { + *menu_index = *menu_index + 1; + /************************************************** + * parse a short option from a menu line + *************************************************/ + if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) || + (menuptr[*menu_index] == ':') ) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *optptr = &menuptr[*menu_index]; + *long_option_index = -1; + if (strchr("lLz", (int) menuptr[*menu_index]) != NULL) + { + ahead_index = *menu_index+1; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++; + optarg = &menuptr[ahead_index]; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++; + menuptr[ahead_index] = '\0'; + *menu_index = ahead_index; + } + return **optptr; + } + + } + } + *menu_index = *menu_index + 1; + } + return -1; +} + + +/************************************************** +* prompt user for menu selection +*************************************************/ +int menu_select( char* menu_list[], int max_menu_items ) +{ + int i, j; + + for (i=0; i< max_menu_items; i++) + { + if (menu_list[i] == NULL) break; + if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)")); + printf(" %d: %s\n",i,menu_list[i]); + } + j = i; + if (i == 0) + { + error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file")); + return -1; + } + printf("\n%s: ",N_("enter your selection, or to continue")); + i = getchar() - 48; // effectively converts valid values to integers + if ((i < 0) || (i >= j)) + { + error(0,0,N_("menu selection received was out of bounds")); + return -1; + } + printf("\n"); + return i; +} diff --git a/.pc/duplicate_gnu_source.patch/src/deprecated.c b/.pc/duplicate_gnu_source.patch/src/deprecated.c new file mode 100644 index 0000000..bc62f65 --- /dev/null +++ b/.pc/duplicate_gnu_source.patch/src/deprecated.c @@ -0,0 +1,152 @@ +/* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net + * + * Copyright (C) 2011-2012 Boruch Baum + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define _GNU_SOURCE +#include +#include +#include + +#ifdef ENABLE_NLS +#include +#endif + +#include "hdate.h" +#include "support.h" + +/** + @brief convert an integer to hebrew string UTF-8 (logical) + + @param n The int to convert ( 0 < n < 11000) + + @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. + [deprecation date 2011-12-28] + The original function outputted to a local static string, + and suggested that the caller copied it away. +*/ +char * +hdate_get_int_string (int const n) +{ + char *dest; + int hebrew_form = HDATE_STRING_HEBREW; + + if (!hdate_is_hebrew_locale()) hebrew_form = HDATE_STRING_LOCAL; + return hdate_string( HDATE_STRING_INT, n, HDATE_STRING_SHORT, hebrew_form); +} + + +/** + @brief Return a static string, with name of week day. + + @param day_of_week The number of the day 1..7 (1 - sun). + @param 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_day_string (int const day_of_week, int const short_form) +{ + return hdate_string( HDATE_STRING_DOW, day_of_week, short_form, HDATE_STRING_LOCAL); +} + +/** + @brief Return a static string, with name of month. + + @param month The number of the month 1..12 (1 - jan). + @param 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_month_string (int const month, int const short_form) +{ + return hdate_string( HDATE_STRING_GMONTH, month, short_form, HDATE_STRING_LOCAL); +} + +/** + @brief Return a static string, with name of hebrew month. + + @param month The number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). + @param 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 (int const month, int const short_form) +{ + return hdate_string( HDATE_STRING_HMONTH, month, short_form, HDATE_STRING_LOCAL); +} + +/** + @brief Name of hebrew holiday. + + @param holiday The holiday number. + @param 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_holyday_string (int const holiday, int const short_text) +{ + return hdate_string( HDATE_STRING_HOLIDAY, holiday, short_text, HDATE_STRING_LOCAL); +} + +/** + @brief Name of Parasha + + @param parasha The Number of Parasha 1-Bereshit + (55 through 61 are joined strings e.g. Vayakhel Pekudei) + @param 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_parasha_string (int const parasha, int const short_form) +{ + return hdate_string( HDATE_STRING_PARASHA, parasha, short_form, HDATE_STRING_LOCAL); +} + +/** + @brief Return a string, with the day in the omer + + @param omer day The day in the omer. + @return 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. + [deprecation date 2011-12-28] + @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. +*/ +char * +hdate_get_omer_string (int const omer_day) +{ + return hdate_string( HDATE_STRING_OMER, + omer_day, + HDATE_STRING_LONG, + HDATE_STRING_LOCAL); + +} diff --git a/.pc/duplicate_gnu_source.patch/src/hdate_strings.c b/.pc/duplicate_gnu_source.patch/src/hdate_strings.c new file mode 100644 index 0000000..c970128 --- /dev/null +++ b/.pc/duplicate_gnu_source.patch/src/hdate_strings.c @@ -0,0 +1,587 @@ +/* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net + * + * Copyright (C) 2011-2012 Boruch Baum + * 2004-2007 Yaacov Zamir + * 1984-2003 Amos Shapir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define _GNU_SOURCE +#include +#include +#include + +#ifdef ENABLE_NLS +#include +#endif + +#include "hdate.h" +#include "support.h" + +/** + @brief helper function to find hebrew locale + + @return 0 - latin locale, -1 - hebrew locale +*/ +int +hdate_is_hebrew_locale() +{ + char *locale; + char *language; + + /* Get the name of the current locale. */ +#ifdef ENABLE_NLS + locale = setlocale (LC_MESSAGES, NULL); + language = getenv ("LANGUAGE"); +#else + locale = NULL; + language = NULL; +#endif + + if (!((locale && (locale[0] == 'h') && (locale[1] == 'e')) || + (language && (language[0] == 'h') && (language[1] == 'e')))) + { + /* not hebrew locale return false */ + return 0; + } + + return -1; +} + +/** + @brief Return a string, with the hebrew date. + + @return 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" ) formated date. You must free() the + pointer after use. + + @param h The hdate_struct of the date to print. + @param diaspora if true give diaspora holydays + @param 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. +*/ + +char * hdate_get_format_date (hdate_struct const *h, int const diaspora, int const short_format) +{ + int hebrew_format = HDATE_STRING_LOCAL; + int omer_day = 0; + int holiday = 0; + char *bet_h = ""; // Hebrew prefix for Hebrew month + + char *hebrew_buffer1, *hebrew_buffer2; + size_t hebrew_buffer1_len = -1; + size_t hebrew_buffer2_len = -1; + + char *hday_int_str, *hyear_int_str, *omer_str; + + if (hdate_is_hebrew_locale()) + { + bet_h="ב"; + hebrew_format = HDATE_STRING_HEBREW; + } + + hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,hebrew_format); + if (hday_int_str == NULL) return NULL; + hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,hebrew_format); + if (hyear_int_str == NULL) + { + free(hday_int_str); + return NULL; + } + + /************************************************************ + * short format + ************************************************************/ + if (short_format) + { + hebrew_buffer1_len = asprintf (&hebrew_buffer1, "%s %s %s\n", + hday_int_str, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, hebrew_format), + hyear_int_str); + } + + + /************************************************************ + * long (normal) format + ************************************************************/ + else + { + hebrew_buffer1_len = asprintf (&hebrew_buffer1, "%s %s%s %s", + hday_int_str, + bet_h, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, hebrew_format), + hyear_int_str); + + /* if a day in the omer print it */ + if (hebrew_buffer1_len != -1) omer_day = hdate_get_omer_day(h); + if (omer_day != 0) + { + omer_str = hdate_string(HDATE_STRING_OMER, omer_day, HDATE_STRING_LONG, hebrew_format); + hebrew_buffer2_len = asprintf (&hebrew_buffer2, "%s, %s", hebrew_buffer1, omer_str); + if (omer_str != NULL) free(omer_str); + free(hebrew_buffer1); + if (hebrew_buffer2_len != -1) hebrew_buffer1 = hebrew_buffer2; + hebrew_buffer1_len = hebrew_buffer2_len; + } + + /* if holiday print it */ + if (hebrew_buffer1_len != -1) holiday = hdate_get_holyday (h, diaspora); + if (holiday != 0) + { + hebrew_buffer2_len = asprintf (&hebrew_buffer2, "%s, %s", hebrew_buffer1, + hdate_string( HDATE_STRING_HOLIDAY, holiday, HDATE_STRING_LONG, hebrew_format)); + free(hebrew_buffer1); + if (hebrew_buffer2_len != -1) hebrew_buffer1 = hebrew_buffer2; + hebrew_buffer1_len = hebrew_buffer2_len; + } + + } + + free(hday_int_str); + free(hyear_int_str); + if (hebrew_buffer1_len != -1) return hebrew_buffer1; + return NULL; +} + +/** + @brief Return a static string, with the package name and version + + @return a a static string, with the package name and version +*/ +char * +hdate_get_version_string () +{ + static char version[500]; + + /* make a "packge version" string */ +// snprintf (version, 500, "%s %s", PACKAGE, VERSION); + + return (version); +} + +/** + @brief Return a static string, with the name of translator + + @return a a static string, with the name of translator +*/ +char * +hdate_get_translator_string () +{ + /* if untranslated return null */ + if (strcmp (_("translator"), "translator") == 0) + return NULL; + + /* return the translator name */ + return _("translator"); +} + +/** + @brief Return string values for hdate information + @return 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. + @param type_of_string 0 = integer, 1 = day of week, 2 = parshaot, + 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer + @param 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 ) + @param short_form 0 = short format + @param hebrew_form 0 = not hebrew (native/embedded) +*/ + +// TODO - Number days of chol hamoed, and maybe have an entry for shabbat chol hamoed +// DONE - (I hope) change short to be = 1 long = 0, and switch order of data structures +// this way user app opt.short = 0/FALSE will work as a parameter to pass here + +// These definitions are in hdate.h +// +// HDATE_STRING_INT 0 +// HDATE_STRING_DOW 1 +// HDATE_STRING_PARASHA 2 +// HDATE_STRING_HMONTH 3 +// HDATE_STRING_GMONTH 4 +// HDATE_STRING_HOLIDAY 5 +// HDATE_STRING_OMER 6 +// HDATE STRING_SHORT 1 +// HDATE_STRING_LONG 0 +// HDATE_STRING_HEBREW 1 +// HDATE_STRING_LOCAL 0 +char* hdate_string( int const type_of_string, int const index, int const input_short_form, int const input_hebrew_form) +{ + int short_form = 0; + int hebrew_form = 0; + + // type_of_string: integer and omer require allocated strings + char *return_string = NULL; + char *h_int_string = NULL; + int return_string_len = -1; + + #define H_CHAR_WIDTH 2 + static char *digits[3][10] = { + {" ", "א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט"}, + {"ט", "י", "כ", "ל", "מ", "נ", "ס", "ע", "פ", "צ"}, + {" ", "ק", "ר", "ש", "ת"} + }; + + static char *days[2][2][7] = { + { // begin english + { // begin english long + N_("Sunday"), N_("Monday"), N_("Tuesday"), N_("Wednesday"), + N_("Thursday"), N_("Friday"), N_("Saturday")}, + { // begin english short + N_("Sun"), N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), + N_("Fri"), N_("Sat")} + }, + { // begin hebrew + { // begin hebrew long + "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"}, + { // begin hebrew short + "א", "ב", "ג", "ד", "ה", "ו", "ש"} + } + }; + + static char *parashaot[2][2][62] = { + { // begin english + { // begin english long + N_("none"), N_("Bereshit"), N_("Noach"), + N_("Lech-Lecha"), N_("Vayera"), N_("Chayei Sara"), + N_("Toldot"), N_("Vayetzei"), N_("Vayishlach"), + N_("Vayeshev"), N_("Miketz"), N_("Vayigash"), /* 11 */ + N_("Vayechi"), N_("Shemot"), N_("Vaera"), + N_("Bo"), N_("Beshalach"), N_("Yitro"), + N_("Mishpatim"), N_("Terumah"), N_("Tetzaveh"), /* 20 */ + N_("Ki Tisa"), N_("Vayakhel"), N_("Pekudei"), + N_("Vayikra"), N_("Tzav"), N_("Shmini"), + N_("Tazria"), N_("Metzora"), N_("Achrei Mot"), + N_("Kedoshim"), N_("Emor"), N_("Behar"), /* 32 */ + N_("Bechukotai"), N_("Bamidbar"), N_("Nasso"), + N_("Beha'alotcha"), N_("Sh'lach"), N_("Korach"), + N_("Chukat"), N_("Balak"), N_("Pinchas"), /* 41 */ + N_("Matot"), N_("Masei"), N_("Devarim"), + N_("Vaetchanan"), N_("Eikev"), N_("Re'eh"), + N_("Shoftim"), N_("Ki Teitzei"), N_("Ki Tavo"), /* 50 */ + N_("Nitzavim"), N_("Vayeilech"), N_("Ha'Azinu"), + N_("Vezot Habracha"), /* 54 */ + N_("Vayakhel-Pekudei"),N_("Tazria-Metzora"), N_("Achrei Mot-Kedoshim"), + N_("Behar-Bechukotai"),N_("Chukat-Balak"), N_("Matot-Masei"), + N_("Nitzavim-Vayeilech")}, + { // begin english short + N_("none"), N_("Bereshit"), N_("Noach"), + N_("Lech-Lecha"), N_("Vayera"), N_("Chayei Sara"), + N_("Toldot"), N_("Vayetzei"), N_("Vayishlach"), + N_("Vayeshev"), N_("Miketz"), N_("Vayigash"), /* 11 */ + N_("Vayechi"), N_("Shemot"), N_("Vaera"), + N_("Bo"), N_("Beshalach"), N_("Yitro"), + N_("Mishpatim"), N_("Terumah"), N_("Tetzaveh"), /* 20 */ + N_("Ki Tisa"), N_("Vayakhel"), N_("Pekudei"), + N_("Vayikra"), N_("Tzav"), N_("Shmini"), + N_("Tazria"), N_("Metzora"), N_("Achrei Mot"), + N_("Kedoshim"), N_("Emor"), N_("Behar"), /* 32 */ + N_("Bechukotai"), N_("Bamidbar"), N_("Nasso"), + N_("Beha'alotcha"), N_("Sh'lach"), N_("Korach"), + N_("Chukat"), N_("Balak"), N_("Pinchas"), /* 41 */ + N_("Matot"), N_("Masei"), N_("Devarim"), + N_("Vaetchanan"), N_("Eikev"), N_("Re'eh"), + N_("Shoftim"), N_("Ki Teitzei"), N_("Ki Tavo"), /* 50 */ + N_("Nitzavim"), N_("Vayeilech"), N_("Ha'Azinu"), + N_("Vezot Habracha"), /* 54 */ + N_("Vayakhel-Pekudei"),N_("Tazria-Metzora"), N_("Achrei Mot-Kedoshim"), + N_("Behar-Bechukotai"),N_("Chukat-Balak"), N_("Matot-Masei"), + N_("Nitzavim-Vayeilech")} + }, + { // begin hebrew + { // begin hebrew long + "none", "בראשית", "נח", + "לך לך", "וירא", "חיי שרה", + "תולדות", "ויצא", "וישלח", + "וישב", "מקץ", "ויגש", /* 11 */ + "ויחי", "שמות", "וארא", + "בא", "בשלח", "יתרו", + "משפטים", "תרומה", "תצוה", /* 20 */ + "כי תשא", "ויקהל", "פקודי", + "ויקרא", "צו", "שמיני", + "תזריע", "מצורע", "אחרי מות", + "קדושים", "אמור", "בהר", /* 32 */ + "בחוקתי", "במדבר", "נשא", + "בהעלתך", "שלח", "קרח", + "חקת", "בלק", "פנחס", /* 41 */ + "מטות", "מסעי", "דברים", + "ואתחנן", "עקב", "ראה", + "שופטים", "כי תצא", "כי תבוא", /* 50 */ + "נצבים", "וילך", "האזינו", + "וזאת הברכה", /* 54 */ + "ויקהל-פקודי", "תזריע-מצורע", "אחרי מות-קדושים", + "בהר-בחוקתי", "חוקת-בלק", "מטות מסעי", + "נצבים-וילך"}, + { // begin hebrew short + "none", "בראשית", "נח", + "לך לך", "וירא", "חיי שרה", + "תולדות", "ויצא", "וישלח", + "וישב", "מקץ", "ויגש", /* 11 */ + "ויחי", "שמות", "וארא", + "בא", "בשלח", "יתרו", + "משפטים", "תרומה", "תצוה", /* 20 */ + "כי תשא", "ויקהל", "פקודי", + "ויקרא", "צו", "שמיני", + "תזריע", "מצורע", "אחרי מות", + "קדושים", "אמור", "בהר", /* 32 */ + "בחוקתי", "במדבר", "נשא", + "בהעלתך", "שלח", "קרח", + "חקת", "בלק", "פנחס", /* 41 */ + "מטות", "מסעי", "דברים", + "ואתחנן", "עקב", "ראה", + "שופטים", "כי תצא", "כי תבוא", /* 50 */ + "נצבים", "וילך", "האזינו", + "וזאת הברכה", /* 54 */ + "ויקהל-פקודי", "תזריע-מצורע", "אחרי מות-קדושים", + "בהר-בחוקתי", "חוקת-בלק", "מטות מסעי", + "נצבים-וילך"} + } + }; + + static char *hebrew_months[2][2][14] = { + { // begin english + { // begin english long + N_("Tishrei"), N_("Cheshvan"), N_("Kislev"), N_("Tevet"), + N_("Sh'vat"), N_("Adar"), N_("Nisan"), N_("Iyyar"), + N_("Sivan"), N_("Tammuz"), N_("Av"), N_("Elul"), N_("Adar I"), + N_("Adar II")}, + { // begin english short + N_("Tishrei"), N_("Cheshvan"), N_("Kislev"), N_("Tevet"), + N_("Sh'vat"), N_("Adar"), N_("Nisan"), N_("Iyyar"), + N_("Sivan"), N_("Tammuz"), N_("Av"), N_("Elul"), N_("Adar I"), + N_("Adar II")} + }, + { // begin hebrew + { // begin hebrew long + "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "ניסן", "אייר", + "סיון", "תמוז", "אב", "אלול", "אדר א", "אדר ב" }, + { // begin hebrew short + "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "ניסן", "אייר", + "סיון", "תמוז", "אב", "אלול", "אדר א", "אדר ב" }} + }; + + static char *gregorian_months[2][12] = { + {N_("January"), N_("February"), N_("March"), + N_("April"), N_("May"), N_("June"), + N_("July"), N_("August"), N_("September"), + N_("October"), N_("November"), N_("December")}, + {N_("Jan"), N_("Feb"), N_("Mar"), N_("Apr"), N_("May"), + N_("Jun"), N_("Jul"), N_("Aug"), N_("Sep"), N_("Oct"), + N_("Nov"), N_("Dec")}, + }; + + static char *holidays[2][2][37] = { + { // begin english + { // begin english long + N_("Rosh Hashana I"), N_("Rosh Hashana II"), + N_("Tzom Gedaliah"), N_("Yom Kippur"), + N_("Sukkot"), N_("Hol hamoed Sukkot"), + N_("Hoshana raba"), N_("Simchat Torah"), + N_("Chanukah"), N_("Asara B'Tevet"), + N_("Tu B'Shvat"), N_("Ta'anit Esther"), + N_("Purim"), N_("Shushan Purim"), + N_("Pesach"), N_("Hol hamoed Pesach"), + N_("Yom HaAtzma'ut"), N_("Lag B'Omer"), + N_("Erev Shavuot"), N_("Shavuot"), + N_("Tzom Tammuz"), N_("Tish'a B'Av"), + N_("Tu B'Av"), N_("Yom HaShoah"), + N_("Yom HaZikaron"), N_("Yom Yerushalayim"), + N_("Shmini Atzeret"), N_("Pesach VII"), + N_("Pesach VIII"), N_("Shavuot II"), + N_("Sukkot II"), N_("Pesach II"), + N_("Family Day"), N_("Memorial day for fallen whose place of burial is unknown"), + N_("Yitzhak Rabin memorial day"), N_("Zeev Zhabotinsky day"), + N_("Erev Yom Kippur")}, + { // begin english short + N_("Rosh Hashana I"), N_("Rosh Hashana II"), + N_("Tzom Gedaliah"), N_("Yom Kippur"), + N_("Sukkot"), N_("Hol hamoed Sukkot"), + N_("Hoshana raba"), N_("Simchat Torah"), + N_("Chanukah"), N_("Asara B'Tevet"), /* 10 */ + N_("Tu B'Shvat"), N_("Ta'anit Esther"), + N_("Purim"), N_("Shushan Purim"), + N_("Pesach"), N_("Hol hamoed Pesach"), + N_("Yom HaAtzma'ut"), N_("Lag B'Omer"), + N_("Erev Shavuot"), N_("Shavuot"), /* 20 */ + N_("Tzom Tammuz"), N_("Tish'a B'Av"), + N_("Tu B'Av"), N_("Yom HaShoah"), + N_("Yom HaZikaron"), N_("Yom Yerushalayim"), + N_("Shmini Atzeret"), N_("Pesach VII"), + N_("Pesach VIII"), N_("Shavuot II"), /* 30 */ + N_("Sukkot II"), N_("Pesach II"), + N_("Family Day"), N_("Memorial day for fallen whose place of burial is unknown"), + N_("Rabin memorial day"), N_("Zhabotinsky day"), + N_("Erev Yom Kippur")} + }, + { // begin hebrew + { // begin hebrew long + "א ר\"ה", "ב' ר\"ה", + "צום גדליה", "יוה\"כ", + "סוכות", "חוה\"מ סוכות", + "הוש\"ר", "שמח\"ת", + "חנוכה", "י' בטבת", /* 10 */ + "ט\"ו בשבט", "תענית אסתר", + "פורים", "שושן פורים", + "פסח", "חוה\"מ פסח", + "יום העצמאות", "ל\"ג בעומר", + "ערב שבועות", "שבועות", /* 20 */ + "צום תמוז", "ט' באב", + "ט\"ו באב", "יום השואה", + "יום הזכרון", "יום י-ם", + "שמיני עצרת", "ז' פסח", + "אחרון של פסח", "ב' שבועות", /* 30 */ + "ב' סוכות", "ב' פסח", + "יום המשפחה", "יום זכרון...", + "יום הזכרון ליצחק רבין","יום ז\'בוטינסקי", + "עיוה\"כ"}, + { // begin hebrew short + "א' ראש השנה", "ב' ראש השנה", + "צום גדליה", "יום הכפורים", + "סוכות", "חול המועד סוכות", + "הושענא רבה", "שמחת תורה", + "חנוכה", "צום עשרה בטבת",/* 10 */ + "ט\"ו בשבט", "תענית אסתר", + "פורים", "שושן פורים", + "פסח", "חול המועד פסח", + "יום העצמאות", "ל\"ג בעומר", + "ערב שבועות", "שבועות", /* 20 */ + "צום שבעה עשר בתמוז", "תשעה באב", + "ט\"ו באב", "יום השואה", + "יום הזכרון", "יום ירושלים", + "שמיני עצרת", "שביעי פסח", + "אחרון של פסח", "שני של שבועות",/* 30 */ + "שני של סוכות", "שני של פסח", + "יום המשפחה", "יום זכרון...", + "יום הזכרון ליצחק רבין","יום ז\'בוטינסקי", + "עיוה\"כ"} } + }; + +#ifdef ENABLE_NLS + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (PACKAGE, "UTF-8"); +#endif + + // validate parameters + if (input_short_form != 0) short_form = 1; + if (input_hebrew_form != 0) hebrew_form = 1; + + switch (type_of_string) + { + case HDATE_STRING_DOW: if (index >= 1 && index <= 7) + return _(days[hebrew_form][short_form][index - 1]); + break; + case HDATE_STRING_PARASHA: if (index >= 1 && index <= 61) + return _(parashaot[hebrew_form][short_form][index]); + break; + case HDATE_STRING_HMONTH: + if (index >= 1 && index <= 14) + return _(hebrew_months[hebrew_form][short_form][index - 1]); + break; + case HDATE_STRING_GMONTH: + if (index >= 1 && index <= 12) + return _(gregorian_months[short_form][index - 1]); + break; + case HDATE_STRING_HOLIDAY: if (index >= 1 && index <= 37) + return _(holidays[hebrew_form][short_form][index - 1]); + break; + case HDATE_STRING_OMER: + if (index > 0 && index < 50) + { + h_int_string = hdate_string(HDATE_STRING_INT, index, HDATE_STRING_LONG, hebrew_form); + if (h_int_string == NULL) return NULL; + + return_string_len = asprintf( + &return_string, "%s %s", h_int_string, _("in the Omer")); + + free(h_int_string); + + if (return_string_len != -1) return return_string; + } + return NULL; + break; + case HDATE_STRING_INT: + if ((index > 0) && (index < 11000)) + { + // not hebrew form - return the number in decimal form + if (!hebrew_form) + { + return_string_len = asprintf (&return_string, "%d", index); + if (return_string_len == -1) return NULL; + return return_string; + } + + // HEBREW_NUMBER_BUFFER_SIZE 17 defined in hdate.h + return_string = malloc(HEBREW_NUMBER_BUFFER_SIZE); + if (return_string == NULL) return NULL; + + return_string[0] = '\0'; + + int n = index; + + if (n >= 1000) + { + strncat (return_string, digits[0][n / 1000], H_CHAR_WIDTH); + n %= 1000; + } + while (n >= 400) + { + strncat (return_string, digits[2][4], H_CHAR_WIDTH); + n -= 400; + } + if (n >= 100) + { + strncat (return_string, digits[2][n / 100], H_CHAR_WIDTH); + n %= 100; + } + if (n >= 10) + { + if (n == 15 || n == 16) + n -= 9; + strncat (return_string, digits[1][n / 10], H_CHAR_WIDTH); + n %= 10; + } + if (n > 0) + strncat (return_string, digits[0][n], H_CHAR_WIDTH); + + // possibly add the ' and " to hebrew numbers + if (!short_form) + { + return_string_len = strlen (return_string); + if (return_string_len <= H_CHAR_WIDTH) strncat (return_string, "'", H_CHAR_WIDTH); + else + { + return_string[return_string_len + 1] = return_string[return_string_len]; + return_string[return_string_len] = return_string[return_string_len - 1]; + return_string[return_string_len - 1] = return_string[return_string_len - 2]; + return_string[return_string_len - 2] = '\"'; + return_string[return_string_len + 2] = '\0'; + } + } + return return_string; + } + return NULL; + break; + } // end of switch(type_of_string) + + return NULL; +} diff --git a/.pc/ld-as-needed.patch/bindings/perl/Makefile.am b/.pc/ld-as-needed.patch/bindings/perl/Makefile.am new file mode 100644 index 0000000..30ae6e8 --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/perl/Makefile.am @@ -0,0 +1,25 @@ + +EXTRA_DIST = hdate.i + +if WITH_PERL + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cxx *.so *wrap* *.pm + +all-am: hdate.so + + +hdate.so: hdate_wrap.cxx + g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src + g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so + +hdate_wrap.cxx: hdate.i + swig -perl -c++ hdate.i + +install-data-local: hdate.so + $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/ + $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so + $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm + +endif diff --git a/.pc/ld-as-needed.patch/bindings/perl/Makefile.in b/.pc/ld-as-needed.patch/bindings/perl/Makefile.in new file mode 100644 index 0000000..8ef9cf5 --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/perl/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/perl +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i +@WITH_PERL_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_PERL_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.pm +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/perl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_PERL_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_PERL_TRUE@all-am: hdate.so + +@WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx +@WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src +@WITH_PERL_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so + +@WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i +@WITH_PERL_TRUE@ swig -perl -c++ hdate.i + +@WITH_PERL_TRUE@install-data-local: hdate.so +@WITH_PERL_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/ +@WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so +@WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/ld-as-needed.patch/bindings/php/Makefile.am b/.pc/ld-as-needed.patch/bindings/php/Makefile.am new file mode 100644 index 0000000..6a5363d --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/php/Makefile.am @@ -0,0 +1,29 @@ + +EXTRA_DIST = hdate.i hdate.ini + +if WITH_PHP + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cpp *.h *.so *.php *wrap* + +all-am: hdate.so + + +hdate.so: hdate_wrap.cpp + g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp + gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so + +hdate_wrap.cpp: hdate.i + swig -php5 -c++ hdate.i + +install-data-local: hdate.so hdate.ini hdate.php + $(mkinstalldirs) $(DESTDIR)$(PH_MODULES_PATH) + $(INSTALL_DATA) hdate.so $(DESTDIR)$(PH_MODULES_PATH)/hdate.so + + $(mkinstalldirs) $(DESTDIR)$(PH_CONFIG_PATH) + $(INSTALL_DATA) hdate.ini $(DESTDIR)$(PH_CONFIG_PATH)/hdate.ini + + $(mkinstalldirs) $(DESTDIR)$(PH_INCLUDE_PATH) + $(INSTALL_DATA) hdate.php $(DESTDIR)$(PH_INCLUDE_PATH)/hdate.php +endif diff --git a/.pc/ld-as-needed.patch/bindings/php/Makefile.in b/.pc/ld-as-needed.patch/bindings/php/Makefile.in new file mode 100644 index 0000000..10570d3 --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/php/Makefile.in @@ -0,0 +1,450 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/php +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i hdate.ini +@WITH_PHP_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_PHP_TRUE@CLEANFILES = *.o *.cpp *.h *.so *.php *wrap* +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/php/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/php/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_PHP_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_PHP_TRUE@all-am: hdate.so + +@WITH_PHP_TRUE@hdate.so: hdate_wrap.cpp +@WITH_PHP_TRUE@ g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp +@WITH_PHP_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so + +@WITH_PHP_TRUE@hdate_wrap.cpp: hdate.i +@WITH_PHP_TRUE@ swig -php5 -c++ hdate.i + +@WITH_PHP_TRUE@install-data-local: hdate.so hdate.ini hdate.php +@WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_MODULES_PATH) +@WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PH_MODULES_PATH)/hdate.so + +@WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_CONFIG_PATH) +@WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.ini $(DESTDIR)$(PH_CONFIG_PATH)/hdate.ini + +@WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_INCLUDE_PATH) +@WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.php $(DESTDIR)$(PH_INCLUDE_PATH)/hdate.php + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/ld-as-needed.patch/bindings/python/Makefile.am b/.pc/ld-as-needed.patch/bindings/python/Makefile.am new file mode 100644 index 0000000..a2469e9 --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/python/Makefile.am @@ -0,0 +1,25 @@ + +EXTRA_DIST = hdate.i + +if WITH_PYTHON + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cxx *.so *wrap* *.py + +all-am: _hdate.so + + +_hdate.so: hdate_wrap.cxx + g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src + g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so + +hdate_wrap.cxx: hdate.i + swig -python -c++ hdate.i + +install-data-local: _hdate.so + $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH) + $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so + $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py + +endif diff --git a/.pc/ld-as-needed.patch/bindings/python/Makefile.in b/.pc/ld-as-needed.patch/bindings/python/Makefile.in new file mode 100644 index 0000000..bcf3f49 --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/python/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/python +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i +@WITH_PYTHON_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_PYTHON_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.py +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/python/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_PYTHON_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_PYTHON_TRUE@all-am: _hdate.so + +@WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx +@WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src +@WITH_PYTHON_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so + +@WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i +@WITH_PYTHON_TRUE@ swig -python -c++ hdate.i + +@WITH_PYTHON_TRUE@install-data-local: _hdate.so +@WITH_PYTHON_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH) +@WITH_PYTHON_TRUE@ $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so +@WITH_PYTHON_TRUE@ $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/ld-as-needed.patch/bindings/ruby/Makefile.am b/.pc/ld-as-needed.patch/bindings/ruby/Makefile.am new file mode 100644 index 0000000..43c4d5e --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/ruby/Makefile.am @@ -0,0 +1,24 @@ + +EXTRA_DIST = hdate.i + +if WITH_RUBY + +DEPS= $(top_builddir)/src/libhdate.la + +CLEANFILES = *.o *.cxx *.so *wrap* + +all-am: hdate.so + + +hdate.so: hdate_wrap.cxx + g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src + gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so + +hdate_wrap.cxx: hdate.i + swig -c++ -ruby hdate.i + +install-data-local: hdate.so + $(mkinstalldirs) $(DESTDIR)$(RU_MODULES_PATH) + $(INSTALL_DATA) hdate.so $(DESTDIR)$(RU_MODULES_PATH)/hdate.so + +endif diff --git a/.pc/ld-as-needed.patch/bindings/ruby/Makefile.in b/.pc/ld-as-needed.patch/bindings/ruby/Makefile.in new file mode 100644 index 0000000..cd166ac --- /dev/null +++ b/.pc/ld-as-needed.patch/bindings/ruby/Makefile.in @@ -0,0 +1,444 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = bindings/ruby +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GP_MODULES_PATH = @GP_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PA_MODULES_PATH = @PA_MODULES_PATH@ +PA_VERSION = @PA_VERSION@ +PE_CFLAGS = @PE_CFLAGS@ +PE_MODULES_PATH = @PE_MODULES_PATH@ +PH_CONFIG_PATH = @PH_CONFIG_PATH@ +PH_INCLUDE_PATH = @PH_INCLUDE_PATH@ +PH_MODULES_PATH = @PH_MODULES_PATH@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PY_CFLAGS = @PY_CFLAGS@ +PY_MODULES_PATH = @PY_MODULES_PATH@ +PY_VERSION = @PY_VERSION@ +RANLIB = @RANLIB@ +RU_CFLAGS = @RU_CFLAGS@ +RU_MODULES_PATH = @RU_MODULES_PATH@ +RU_VERSION = @RU_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_fpc = @have_fpc@ +have_gpc = @have_gpc@ +have_perl = @have_perl@ +have_php = @have_php@ +have_php_config = @have_php_config@ +have_python = @have_python@ +have_ruby = @have_ruby@ +have_swig = @have_swig@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = hdate.i +@WITH_RUBY_TRUE@DEPS = $(top_builddir)/src/libhdate.la +@WITH_RUBY_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/ruby/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bindings/ruby/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@WITH_RUBY_FALSE@install-data-local: +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +@WITH_RUBY_TRUE@all-am: hdate.so + +@WITH_RUBY_TRUE@hdate.so: hdate_wrap.cxx +@WITH_RUBY_TRUE@ g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src +@WITH_RUBY_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so + +@WITH_RUBY_TRUE@hdate_wrap.cxx: hdate.i +@WITH_RUBY_TRUE@ swig -c++ -ruby hdate.i + +@WITH_RUBY_TRUE@install-data-local: hdate.so +@WITH_RUBY_TRUE@ $(mkinstalldirs) $(DESTDIR)$(RU_MODULES_PATH) +@WITH_RUBY_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(RU_MODULES_PATH)/hdate.so + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/.pc/size_t.patch/examples/hcal/local_functions.c b/.pc/size_t.patch/examples/hcal/local_functions.c new file mode 100644 index 0000000..c178ab6 --- /dev/null +++ b/.pc/size_t.patch/examples/hcal/local_functions.c @@ -0,0 +1,932 @@ +/* local_functions.c http://libhdate.sourceforge.net + * a collection of functions in support of both hcal.c and hdate.c + * hcal.c Hebrew calendar (part of package libhdate) + * hdate.c Hebrew date/times information(part of package libhdate) + * + * compile: + * gcc `pkg-config --libs --cflags libhdate` ocal_functions.c -o local_functions + * + * Copyright: 2011-2012 (c) Boruch Baum + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/************************************************** +* functions to support hcal and hdate +**************************************************/ + +#include // For hebrew date +//include "../../src/hdate.h" +#include // For atoi, malloc +#include // For error +#include // For errno +#include // For time +#include // for isprint +#include // For fnmatch +#include // For mempcpy +#include // For optarg, optind +#include // For printf, fopen, fclose, fprintf, snprintf. FILE +#include // for get pwuid +#include // for getuid +#include +#include // for mkdir, + + +// support for fnmatch +#define FNM_EXTMATCH (1 << 5) +#define FNM_NOFLAG 0 + +#define BAD_COORDINATE 999 +#define BAD_TIMEZONE 999 +#define DELTA_LONGITUDE 30 + +#define EXIT_CODE_BAD_PARMS 1 + + + +// copied from support.h in src dir +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + +#define FALSE 0 +#define TRUE -1 + + +// support for options parsing +#define MIN_CANDLES_MINUTES 18 +#define DEFAULT_CANDLES_MINUTES 20 +#define MAX_CANDLES_MINUTES 90 +#define MIN_MOTZASH_MINUTES 20 +#define MAX_MOTZASH_MINUTES 90 + + +/************************************************************ +* begin - error message functions +************************************************************/ +void print_parm_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("parameter"), parm_name, + N_("is non-numeric or out of bounds")); +} + +void print_parm_missing_error ( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("missing parameter")); +} + +void print_alert_timezone( int tz ) +{ + error(0,0,"%s: %s, %+d:%d UTC", + N_("ALERT: time zone not entered, using system local time zone"), + *tzname, tz/60, tz%60); +} + +void print_parm_invalid_error( char *parm_name ) +{ + error(0,0,"%s: %s %s %s",N_("error"), + N_("option"), parm_name, N_("is not a valid option")); +} + + +/************************************************************ +* end - error message functions +************************************************************/ + + + + +/************************************************************ +* begin - alert message functions +************************************************************/ +void print_alert_coordinate( char *city_name ) +{ + error(0,0,"%s %s", + N_("ALERT: guessing... will use co-ordinates for"), + city_name); +} + +void print_alert_default_location( int tz ) +{ + switch (tz/60) + { + case -8: print_alert_coordinate( N_("Los Angeles") ); break; + case -6: print_alert_coordinate( N_("Mexico City") ); break; + case -5: print_alert_coordinate( N_("New York City") ); break; +// case -5: print_alert_coordinate( N_("Toronto") ); break; +// case -3: print_alert_coordinate( N_("Sao Paolo") ); break; + case -3: print_alert_coordinate( N_("Buenos Aires") ); break; + case 0: print_alert_coordinate( N_("London") ); break; + case 1: print_alert_coordinate( N_("Paris") ); break; + case 2: print_alert_coordinate( N_("Tel-Aviv") ); break; + case 3: print_alert_coordinate( N_("Moscow") ); break; + case 5: print_alert_coordinate( N_("Tashkent") ); break; + case 8: print_alert_coordinate( N_("Beijing") ); break; +// case 8: print_alert_coordinate( N_("Hong Kong") ); break; + case -10: print_alert_coordinate( N_("Honolulu") ); break; + default: error(0,0,"%s \n%s", N_("Hmmm, ... hate to do this, really ..."), N_("using co-ordinates for the equator, at the center of time zone")); break; + } +} +/************************************************************ +* end - alert message functions +************************************************************/ + + + +/************************************************************ +* set default location +************************************************************/ +void set_default_location( int tz, double *lat, double *lon ) +{ + /* Temporarily, set some default lat/lon coordinates + for certain timezones */ + +/** +{ 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ), +{ 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ), +{ 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ), +{ 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ), +{ 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ), +{ 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ), +{ 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ), +{ 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ), +{ 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ), +{ 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ), +{ 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ), +{ 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ), +{ 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ), +{ 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ), +{ 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ), +{ 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ), +{ 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ), +{ 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ), +{ 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ), +{ 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' ) +**/ + + switch (tz/60) + { + case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles + case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City + case -5: *lat = 40.0; *lon = -74.0; break; // New York +// case -5: *lat = 43.71; *lon = -79.43; break; // Toronto +// case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo + case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires + case 0: *lat = 51.0; *lon = 0.0; break; // London + case 1: *lat = 48.0; *lon = 2.0; break; // Paris + case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv + case 3: *lat = 55.0; *lon = 37.0; break; // Moscow + case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent + case 8: *lat = 39.90; *lon = 116.38; break; // Beijing +// case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong + case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu + default: *lat = 0.0; *lon = tz * .25; break; // center of timeone: + // .25 = (15 degrees) / 60 [because tz is in minutes, not hours] + } + return; +} + + + +/************************************************************ +* check for sunset +************************************************************/ +int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone ) +{ + time_t now_time; + struct tm *now_timep; + int sunrise, sunset; + + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + time(&now_time); + now_timep = localtime(&now_time); + + if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1; + else return 0; +} + + + + +/*********************************************************** + * reverse a hebrew string (for visual bidi) + * parameters: + * source is a pointer to a writeable buffer. + * source_len is the length of a string in source. This + * length must be LESS than the size of the source buffer +***********************************************************/ +void revstr( char *source, const size_t source_len) +{ + #define H_CHAR_WIDTH 2 + +#define DEBUG 0 +#if DEBUG +printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source); +#endif + + if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);}; + if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);}; + + size_t i,j; + char *temp_buff; + + temp_buff = malloc(source_len+2); + if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);}; + + for (i=(source_len-1), j=0; j < source_len; i--, j++) + { + if (isprint(source[i])) temp_buff[j] = source[i]; + else + { + // FIXME - presumes H_CHAR_WIDTH = 2 + temp_buff[j++] = source[i-1]; + temp_buff[j] = source[i--]; + } + } + memcpy(source, temp_buff, source_len); + source[source_len] = '\0'; +#if DEBUG +printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source); +#endif + free(temp_buff); + return; +} + + +/************************************************************ +* parse coordinate +* +* presumes commandline options were parsed using getopt. +* returns 1 to *opt_found on success +* returns the floating point value of the coordinate in *coordinate +* +* type_flag (1-latitude, 2=longitude) +************************************************************/ +int parse_coordinate( const int type_flag, char *input_string, + double *coordinate, int *opt_found) +{ +//#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" +//#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))" +//#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))" + +#define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])" + +#define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])" +#define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])" + + char* seconds; + + double fractional_part = 0; + int direction_modifier = 1; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if (!input_string) + { + if (type_flag == 1) print_parm_missing_error(N_("l (latitude)")); + else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)")); + return TRUE; // error_detected = TRUE; ie failure + } + + /************************************************************ + * parse latitude + ************************************************************/ + if (type_flag == 1) + { + if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("l (latitude)")); + else print_parm_error(N_("l (latitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1; + + + if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS")); + } + else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "nNsS:'\"")); + fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60; + seconds = strtok( NULL, "nNsS:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -90) && (*coordinate < 90) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + /************************************************************ + * parse longitude + ************************************************************/ + if (type_flag == 2) + { + if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) + && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) ) + { + if (fnmatch("-*", input_string, FNM_NOFLAG)==0) + print_parm_missing_error(N_("L (Longitude)")); + else print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + + + if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1; + + + if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW")); + } + else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0) + { + *coordinate = (double) atof( strtok( input_string, "eEwW:'\"")); + fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60; + seconds = strtok( NULL, "eEwW:'\""); + if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600; + } + + if (*coordinate > 0) + *coordinate = (*coordinate + fractional_part) * direction_modifier; + else + *coordinate = *coordinate - fractional_part; + + + if( (*coordinate > -180) && (*coordinate < 180) ) + { + *opt_found = 1; + return FALSE; // error_detected = FALSE; ie. success + } + print_parm_error(N_("L (Longitude)")); + return TRUE; // error_detected = TRUE; ie failure + } + +printf("INTERNAL ERROR: coordinate parse\n"); +return TRUE; // error_detected = TRUE; ie failure +} + +/************************************************************ +* parse timezone +* +* presumes commandline options were parsed using getopt. +* timezone is returned in minutes, not hours +************************************************************/ +int parse_timezone( char *input_string, int *tz) +{ +#define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))" +#define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))" + + int fractional_part; + + /************************************************************ + * input_string should hold the value to parse + * It must exist and be numeric + * we don't want confuse it with the next option of for "-x" + ************************************************************/ + if ((!input_string) || + ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) && + (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) && + (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) ) + { + print_parm_missing_error(N_("z (time zone)")); + } + else + { + if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0) + { + *tz = (int) ( atof (input_string) * 60 ); + } + else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0) + { + *tz = atoi( strtok( input_string, ":'\"")) * 60; + fractional_part = atoi( strtok( NULL, ":'\"")); + if (*tz < 0) *tz = *tz - fractional_part; + else *tz = *tz + fractional_part; + } + + if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours + { + return FALSE; // error_detected = FALSE; ie. success + } + else print_parm_error(N_("z (timezone)")); + } + return TRUE; // error_detected = TRUE; ie failure +} + + + + +/************************************************************ +* validate location parameters - lat, lon, tz +************************************************************/ +// originally, this was only for hdate, now also for hcal +// originally, we did this only if we needed the information +// now, because of sunset-awareness, we always perform these checks +// if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) ) +void validate_location( const int opt_latitude, const int opt_Longitude, + double *lat, double *lon, + int *tz, const int quiet_alerts, int error_detected, + void (*print_usage)() ) +{ + + /* latitude and longitude must be paired */ + if ( (opt_latitude) && (!opt_Longitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude")); + error_detected = TRUE; + } + else if ( (opt_Longitude) && (!opt_latitude) ) + { + error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude")); + error_detected = TRUE; + } + + + if (!error_detected) + { + // if no timezone entered, choose guess method + if (*tz==BAD_TIMEZONE) + { + // system timezone is in seconds, but we deal in minutes + tzset(); + *tz = timezone /-60; + + if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) ) + { + /* reject system local timezone, because it's + too far from the longitude explicitly provided + by the user; guess based on longitude entered */ + *tz = (*lon /15) * 60; + } + if (!quiet_alerts) print_alert_timezone( *tz ); + if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) ) + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + } + printf("\n"); + } + else + { /* we have timezone, what about latitude and longitude? */ + if ( (opt_Longitude) && (opt_latitude) ) + { + // sanity-check longitude versus timezone + // timezone is in minutes + if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE ) + { + error(0,0,"%s %d:%d %s %.3f %s", + N_("time zone value of"), *tz/60, *tz%60, + N_("is incompatible with a longitude of"), *lon, N_("degrees")); + error_detected = TRUE; + } + } + else + { + if (!quiet_alerts) print_alert_default_location( *tz ); + set_default_location( *tz, lat, lon ); + printf("\n"); + } + } + } + + /* exit after reporting all bad parameters found */ + if (error_detected) + { + print_usage(); + exit(EXIT_CODE_BAD_PARMS); + } +} + + +/************************************************************ +* check validity of date parameters +************************************************************/ +#define CHECK_DAY_PARM 1 +#define CHECK_MONTH_PARM 2 +#define CHECK_YEAR_PARM 3 +int validate_hdate (int parameter_to_check, int day, int month, int year) +{ + hdate_struct h; + + if (year < 0) return FALSE; + + switch (parameter_to_check) + { + + case CHECK_DAY_PARM: + + /************************************************************ + * check day in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((day < 1) || (day > 30) || + ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) || + (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) || + (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) ) + return FALSE; + return TRUE; + } + + /************************************************************ + * check day in Gregorian date + ************************************************************/ + else + { + if ((day < 1) || + ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) || + ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) || + ((day > 29) && (month==2) && ((year%4)==0)) || + ((day > 28) && (month==2) && ((year%4)!=0)) + ) + return FALSE; + return TRUE; + } + break; + + + case CHECK_MONTH_PARM: + + /************************************************************ + * check month in Hebrew date + ************************************************************/ + if (year > 3000) + { + if (year > 10999) return FALSE; + if ((month <= 0) || (month > 14)) return FALSE; + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) return FALSE; + return TRUE; + } + + /************************************************************ + * check month in Gregorian date + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) return FALSE; + return TRUE; + } + break; + + case CHECK_YEAR_PARM: + if (year > 10999) return FALSE; + return TRUE; + break; + } + return FALSE; +} + +/************************************************************ +* Greeting message to new version +************************************************************/ +void greetings_to_version_16() +{ + error(0,0,"%s",N_("\ +This seems to be to be your first time using this version.\n\ +Please read the new documentation in the man page and config\n\ +file. Attempting to create a config file ...")); +} + + +/************************************************************ +* Open config file, or create one +* - returns filepointer or NULL +* - if file does not exist, attempt to create it +************************************************************/ +FILE* get_config_file( const char* config_dir_name, + const char* config_file_name, + const char* default_config_file_text ) +{ + size_t path_len; + + char* config_home_path_name = ""; + char* config_sub_path_name = ""; + + char* config_dir_path; + char* config_file_path; + + FILE* config_file; + + /************************************************************ + * sub-function to get_config_file: create_config_file + ************************************************************/ + void create_config_file() + { + config_file = fopen(config_file_path, "a"); + if (config_file == NULL) + { + error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path); + return; + } + fprintf(config_file, "%s", default_config_file_text); + error(0,0,"%s: %s",N_("config file created"), config_file_path); + if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); + } + + /************************************************************ + * sub-function to get_config_file: open_config_file + ************************************************************/ + int open_config_file() + { + config_file = fopen(config_file_path, "r"); + if (config_file == NULL) + { + if (errno != ENOENT) return FALSE; + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + + strlen(config_sub_path_name) + + strlen(config_dir_name) +1; + if (path_len < 1) return FALSE; + config_dir_path = malloc(path_len); + if (config_dir_path == NULL) + { + error(0,errno,"%s",N_("memory allocation failure")); + return FALSE; + } + snprintf(config_dir_path, path_len, "%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name); + + if ((mkdir(config_dir_path, (mode_t) 0700) != 0) && + (errno != EEXIST)) + { + free(config_dir_path); + return FALSE; + } + greetings_to_version_16(); + create_config_file(); + free(config_dir_path); + return FALSE; + } + return TRUE; + } + + +/************************************************************ +* main part of function get_config_file +************************************************************/ + config_home_path_name = getenv("XDG_CONFIG_HOME"); + if (config_home_path_name == NULL) + { + config_home_path_name = getenv("HOME"); + if (config_home_path_name == NULL) + { + struct passwd *passwdEnt = getpwuid(getuid()); + config_home_path_name = passwdEnt->pw_dir; + if (config_home_path_name == NULL) return NULL; + } + config_sub_path_name = "/.config"; + } + + // maybe replace all this with a single line asprintf() + path_len = strlen(config_home_path_name) + strlen(config_sub_path_name) + + strlen(config_dir_name) + strlen(config_file_name) + 1; + if (path_len < 1) return NULL; + config_file_path = malloc(path_len); + if (config_file_path == NULL) + { + error(0,errno,"memory allocation failure"); + return NULL; + } + snprintf(config_file_path, path_len, "%s%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name, config_file_name); + + if (open_config_file() == TRUE) + { + free(config_file_path); + return config_file; + } + else + free(config_file_path); + return NULL; +} + + + + +/********************************************************************** +* parse user's menu selection into options and their posibile +* arguments, which can then be parsed (processed really) +* +* menuptr points to the beginning of the menu entry string. This +* pointer should initially be set to NULL. +* menu_len is the length of the menu entry string +* menu_index is the current position of the parser within the string. +* This value should initially be set to 0. +* optptr is a pointer into which we put the location of option text +* to be parsed. This pointer should initially be set to NULL. +* optarg is a pointer to a possible argument to the option. This is a +* global variable defined by GNU getopt(), so it shouldn't be +* declared or passed. +* long_options is a pointer to a structure of type option, as defined +* by getopt_long() +* long_option_index is a pointer to position found in long_options, and +* simulates the similar value returned by getopt_long() +* error_detected is a pointer to an accumulator used to delay aborting +* the program until after ALL input syntax errors are reported. +* +* RETURN VALUES: +* -1 means the menu line string has been completely parsed. +* Otherwise, the return value should be the short option character +* found, or in the case of a long option found, 0. +* This should sound suspiciously similar to the return values issued +* by getopt_long(). +***********************************************************************/ +int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index, + char** optptr, char* short_options, + struct option *long_options, int *long_option_index, + int *error_detected) +{ + int ahead_index; + char *ahead; + + while ( (*menu_index < menu_len) && + (menuptr[*menu_index] != '#') ) + { + if (menuptr[*menu_index] == '-') + { + if ( ( (*menu_index+1) >= menu_len) || + (menuptr[*menu_index+1] == '#') ) break; + else if (menuptr[*menu_index+1] == '-') + { + if ( ( (*menu_index+2) >= menu_len) || + (menuptr[*menu_index+2] == '#') ) break; + *menu_index = *menu_index +2; + + /************************************************** + * We have identified the beginning of what could + * be a long option string. We store a pointer to + * it in optptr and proceed to: + * find its endpoint + * terminate it with a null + * if it has an argument, store a pointer to + * it in optarg and terminate it with a null. + * Then we compare the optptr to our list of + * valid longoptions and pass the information + * to the option parser + *************************************************/ + *optptr = &menuptr[*menu_index]; // ?? + ahead = *optptr; + ahead_index = *menu_index; + while ( (ahead_index < menu_len) && + (strchr(" =#",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + if (memcmp(ahead,"=",1)==0) + { + *ahead = '\0'; + ahead++; + optarg = ahead; + ahead_index++; + while ( (ahead_index < menu_len) && + (strchr(" #",*ahead) == NULL) ) + { + ahead_index++; + ahead++; + } + } + if ((*ahead == '#' ) && ((ahead_index+1) < menu_len)) + ahead[1] = '#'; + *ahead = '\0'; + *long_option_index = 0; + while ( (long_options[*long_option_index].name != 0) && + (strcmp(long_options[*long_option_index].name, *optptr) != 0) ) + *long_option_index = *long_option_index + 1; + if (long_options[*long_option_index].name == 0) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *menu_index = ahead_index; + return long_options[*long_option_index].val; + } + } + else + { + *menu_index = *menu_index + 1; + /************************************************** + * parse a short option from a menu line + *************************************************/ + if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) || + (menuptr[*menu_index] == ':') ) + { + *error_detected = *error_detected + 1; + print_parm_invalid_error(*optptr); + } + else + { + *optptr = &menuptr[*menu_index]; + *long_option_index = -1; + if (strchr("lLz", (int) menuptr[*menu_index]) != NULL) + { + ahead_index = *menu_index+1; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++; + optarg = &menuptr[ahead_index]; + while ( (ahead_index < menu_len) && + (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++; + menuptr[ahead_index] = '\0'; + *menu_index = ahead_index; + } + return **optptr; + } + + } + } + *menu_index = *menu_index + 1; + } + return -1; +} + + +/************************************************** +* prompt user for menu selection +*************************************************/ +int menu_select( char* menu_list[], int max_menu_items ) +{ + int i, j; + + for (i=0; i< max_menu_items; i++) + { + if (menu_list[i] == NULL) break; + if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)")); + printf(" %d: %s\n",i,menu_list[i]); + } + j = i; + if (i == 0) + { + error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file")); + return -1; + } + printf("\n%s: ",N_("enter your selection, or to continue")); + i = getchar() - 48; // effectively converts valid values to integers + if ((i < 0) || (i >= j)) + { + error(0,0,N_("menu selection received was out of bounds")); + return -1; + } + printf("\n"); + return i; +} diff --git a/.pc/time_t.patch/src/hdate_julian.c b/.pc/time_t.patch/src/hdate_julian.c new file mode 100644 index 0000000..1c64799 --- /dev/null +++ b/.pc/time_t.patch/src/hdate_julian.c @@ -0,0 +1,644 @@ +/* libhdate - Hebrew calendar library + * + * Copyright (C) 1984-2003 Amos Shapir, 2004-2007 Yaacov Zamir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include "hdate.h" +#include "support.h" + +#define HOUR 1080 +#define DAY (24*HOUR) +#define WEEK (7*DAY) +#define M(h,p) ((h)*HOUR+p) +#define MONTH (DAY+M(12,793)) /* Tikun for regular month */ + +/** + @brief Days since bet (?) Tishrey 3744 + + @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005 + + @param hebrew_year The Hebrew year + @return Number of days since 3,1,3744 +*/ +int +hdate_days_from_3744 (int hebrew_year) +{ + int years_from_3744; + int molad_3744; + int leap_months; + int leap_left; + int months; + int parts; + int days; + int parts_left_in_week; + int parts_left_in_day; + int week_day; + + /* Start point for calculation is Molad new year 3744 (16BC) */ + years_from_3744 = hebrew_year - 3744; + molad_3744 = M (1 + 6, 779); /* Molad 3744 + 6 hours in parts */ + + /* Time in months */ + leap_months = (years_from_3744 * 7 + 1) / 19; /* Number of leap months */ + leap_left = (years_from_3744 * 7 + 1) % 19; /* Months left of leap cycle */ + months = years_from_3744 * 12 + leap_months; /* Total Number of months */ + + /* Time in parts and days */ + parts = months * MONTH + molad_3744; /* Molad This year + Molad 3744 - corections */ + days = months * 28 + parts / DAY - 2; /* 28 days in month + corections */ + + /* Time left for round date in corections */ + parts_left_in_week = parts % WEEK; /* 28 % 7 = 0 so only corections counts */ + parts_left_in_day = parts % DAY; + week_day = parts_left_in_week / DAY; + + /* Special cases of Molad Zaken */ + if ((leap_left < 12 && week_day == 3 + && parts_left_in_day >= M (9 + 6, 204)) || + (leap_left < 7 && week_day == 2 + && parts_left_in_day >= M (15 + 6, 589))) + { + days++, week_day++; + } + + /* ADU */ + if (week_day == 1 || week_day == 4 || week_day == 6) + { + days++; + } + + return days; +} + +/** + @brief Size of Hebrew year in days + + @param hebrew_year The Hebrew year + @return Size of Hebrew year +*/ +int +hdate_get_size_of_hebrew_year (int hebrew_year) +{ + return hdate_days_from_3744 (hebrew_year + 1) - + hdate_days_from_3744 (hebrew_year); +} + +/** + @brief Return Hebrew year type based on size and first week day of year. + + year type | year length | Tishery 1 day of week + | 1 | 353 | 2 + | 2 | 353 | 7 + | 3 | 354 | 3 + | 4 | 354 | 5 + | 5 | 355 | 2 + | 6 | 355 | 5 + | 7 | 355 | 7 + | 8 | 383 | 2 + | 9 | 383 | 5 + |10 | 383 | 7 + |11 | 384 | 3 + |12 | 385 | 2 + |13 | 385 | 5 + |14 | 385 | 7 + + @param size_of_year Length of year in days + @param new_year_dw First week day of year + @return A number for year type (1..14) +*/ +int +hdate_get_year_type (int size_of_year, int new_year_dw) +{ + /* Only 14 combinations of size and week day are posible */ + static int year_types[24] = + {1, 0, 0, 2, 0, 3, 4, 0, 5, 0, 6, 7, + 8, 0, 9, 10, 0, 11, 0, 0, 12, 0, 13, 14}; + + int offset; + + /* convert size and first day to 1..24 number */ + /* 2,3,5,7 -> 1,2,3,4 */ + /* 353, 354, 355, 383, 384, 385 -> 0, 1, 2, 3, 4, 5 */ + offset = (new_year_dw + 1) / 2; + offset = offset + 4 * ((size_of_year % 10 - 3) + (size_of_year / 10 - 35)); + + /* some combinations are imposible */ + return year_types[offset - 1]; +} + +/** + @brief Compute Julian day from Gregorian day, month and year + Algorithm from the wikipedia's julian_day + + @author Yaacov Zamir + + @param day Day of month 1..31 + @param month Month 1..12 + @param year Year in 4 digits e.g. 2001 + @return The julian day number + */ +int +hdate_gdate_to_jd (int day, int month, int year) +{ + int a; + int y; + int m; + int jdn; + + a = (14 - month) / 12; + y = year + 4800 - a; + m = month + 12 * a - 3; + + jdn = day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045; + + return jdn; +} + +/** + @brief Compute Julian day from Hebrew day, month and year + + @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005 + + @param day Day of month 1..31 + @param month Month 1..14 (13 - Adar 1, 14 - Adar 2) + @param year Hebrew year in 4 digits e.g. 5753 + @return The julian day number + */ +int +hdate_hdate_to_jd (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year) +{ + int length_of_year; + int jd; + int days_from_3744; + + /* Adjust for leap year */ + if (month == 13) + { + month = 6; + } + if (month == 14) + { + month = 6; + day += 30; + } + + /* Calculate days since 1,1,3744 */ + days_from_3744 = hdate_days_from_3744 (year); + day = days_from_3744 + (59 * (month - 1) + 1) / 2 + day; + + /* length of year */ + length_of_year = hdate_days_from_3744 (year + 1) - days_from_3744; + + /* Special cases for this year */ + if (length_of_year % 10 > 4 && month > 2) /* long Heshvan */ + day++; + if (length_of_year % 10 < 4 && month > 3) /* short Kislev */ + day--; + if (length_of_year > 365 && month > 6) /* leap year */ + day += 30; + + /* adjust to julian */ + jd = day + 1715118; + + /* return the 1 of tishrey julians */ + if (jd_tishrey1 && jd_tishrey1_next_year) + { + *jd_tishrey1 = days_from_3744 + 1715119; + *jd_tishrey1_next_year = *jd_tishrey1 + length_of_year; + } + + return jd; +} + +/** + @brief Converting from the Julian day to the Gregorian day + Algorithm from 'Julian and Gregorian Day Numbers' by Peter Meyer + + @author Yaacov Zamir ( Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968) + + @param jd Julian day + @param d Return Day of month 1..31 + @param m Return Month 1..12 + @param y Return Year in 4 digits e.g. 2001 + */ +void +hdate_jd_to_gdate (int jd, int *d, int *m, int *y) +{ + int l, n, i, j; + l = jd + 68569; + n = (4 * l) / 146097; + l = l - (146097 * n + 3) / 4; + i = (4000 * (l + 1)) / 1461001; /* that's 1,461,001 */ + l = l - (1461 * i) / 4 + 31; + j = (80 * l) / 2447; + *d = l - (2447 * j) / 80; + l = j / 11; + *m = j + 2 - (12 * l); + *y = 100 * (n - 49) + i + l; /* that's a lower-case L */ + + return; +} + +/** + @brief Converting from the Julian day to the Hebrew day + + @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2008 + + @param jd Julian day + @param day Return Day of month 1..31 + @param month Return Month 1..14 (13 - Adar 1, 14 - Adar 2) + @param 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) +{ + int days; + int size_of_year; + int internal_jd_tishrey1, internal_jd_tishrey1_next_year; + + /* calculate Gregorian date */ + hdate_jd_to_gdate (jd, day, month, year); + + /* Guess Hebrew year is Gregorian year + 3760 */ + *year = *year + 3760; + + internal_jd_tishrey1 = hdate_days_from_3744 (*year) + 1715119; + internal_jd_tishrey1_next_year = hdate_days_from_3744 (*year + 1) + 1715119; + + /* Check if computed year was underestimated */ + if (internal_jd_tishrey1_next_year <= jd) + { + *year = *year + 1; + internal_jd_tishrey1 = internal_jd_tishrey1_next_year; + internal_jd_tishrey1_next_year = hdate_days_from_3744 (*year + 1) + 1715119; + } + + size_of_year = internal_jd_tishrey1_next_year - internal_jd_tishrey1; + + /* days into this year, first month 0..29 */ + days = jd - internal_jd_tishrey1; + + /* last 8 months allways have 236 days */ + if (days >= (size_of_year - 236)) /* in last 8 months */ + { + days = days - (size_of_year - 236); + *month = days * 2 / 59; + *day = days - (*month * 59 + 1) / 2 + 1; + + *month = *month + 4 + 1; + + /* if leap */ + if (size_of_year > 355 && *month <=6) + *month = *month + 8; + } + else /* in 4-5 first months */ + { + /* Special cases for this year */ + if (size_of_year % 10 > 4 && days == 59) /* long Heshvan (day 30 of Heshvan) */ + { + *month = 1; + *day = 30; + } + else if (size_of_year % 10 > 4 && days > 59) /* long Heshvan */ + { + *month = (days - 1) * 2 / 59; + *day = days - (*month * 59 + 1) / 2; + } + else if (size_of_year % 10 < 4 && days > 87) /* short kislev */ + { + *month = (days + 1) * 2 / 59; + *day = days - (*month * 59 + 1) / 2 + 2; + } + else /* regular months */ + { + *month = days * 2 / 59; + *day = days - (*month * 59 + 1) / 2 + 1; + } + + *month = *month + 1; + } + + /* return the 1 of tishrey julians */ + if (jd_tishrey1 && jd_tishrey1_next_year) + { + *jd_tishrey1 = internal_jd_tishrey1; + *jd_tishrey1_next_year = internal_jd_tishrey1_next_year; + } + + return; +} + +/********************************************************************************/ +/********************************************************************************/ + +/** + @brief compute date structure from the Gregorian date + + @param d Day of month 1..31 + @param m Month 1..12 , if m or d is 0 return current date. + @param y Year in 4 digits e.g. 2001 + */ +hdate_struct * +hdate_set_gdate (hdate_struct * h, int d, int m, int y) +{ + int jd; + int jd_tishrey1, jd_tishrey1_next_year; + + if (!h) return NULL; + + /* check for null dates (kobi) */ + if ((d == 0) || (m == 0)) + { + struct tm *tm; + long t; + /* FIXME: day start at 6:00 or 12:00 like in Gregorian cal. ? */ + t = time (0); + tm = localtime (&t); + d = tm->tm_mday; + m = tm->tm_mon + 1; + y = tm->tm_year + 1900; + } + + h->gd_day = d; + h->gd_mon = m; + h->gd_year = y; + + jd = hdate_gdate_to_jd (d, m, y); + hdate_jd_to_hdate (jd, &(h->hd_day), &(h->hd_mon), &(h->hd_year), &jd_tishrey1, &jd_tishrey1_next_year); + + h->hd_dw = (jd + 1) % 7 + 1; + h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1; + h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1; + h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw); + h->hd_jd = jd; + h->hd_days = jd - jd_tishrey1 + 1; + h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1; + + return (h); +} + +/** + @brief compute date structure from the Hebrew date + + @param d Day of month 1..31 + @param m Month 1..14 , if m or d is 0 return current date. + @param y Year in 4 digits e.g. 5731 + */ +hdate_struct * +hdate_set_hdate (hdate_struct * h, int d, int m, int y) +{ + int jd; + int jd_tishrey1, jd_tishrey1_next_year; + + if (!h) return NULL; + + h->hd_day = d; + h->hd_mon = m; + h->hd_year = y; + + jd = hdate_hdate_to_jd (d, m, y, &jd_tishrey1, &jd_tishrey1_next_year); + hdate_jd_to_gdate (jd, &(h->gd_day), &(h->gd_mon), &(h->gd_year)); + + h->hd_dw = (jd + 1) % 7 + 1; + h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1; + h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1; + h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw); + h->hd_jd = jd; + h->hd_days = jd - jd_tishrey1 + 1; + h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1; + + return (h); +} + +/** + @brief compute date structure from julian day + + @param jd the julian day number. + */ +hdate_struct * +hdate_set_jd (hdate_struct * h, int jd) +{ + int jd_tishrey1, jd_tishrey1_next_year; + + if (!h) return NULL; + + hdate_jd_to_gdate (jd, &(h->gd_day), &(h->gd_mon), &(h->gd_year)); + hdate_jd_to_hdate (jd, &(h->hd_day), &(h->hd_mon), &(h->hd_year), &jd_tishrey1, &jd_tishrey1_next_year); + + h->hd_dw = (jd + 1) % 7 + 1; + h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1; + h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1; + h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw); + h->hd_jd = jd; + h->hd_days = jd - jd_tishrey1 + 1; + h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1; + + return (h); +} + +/********************************************************************************/ +/********************************************************************************/ + +/** + @brief get the Gregorian day of the month + + @param h pointer this hdate struct. + @return the Gregorian day of the month, 1..31. + */ +int +hdate_get_gday (hdate_struct const * h) +{ + return h->gd_day; +} + +/** + @brief get the Gregorian month + + @param h pointer this hdate struct. + @return the Gregorian month, jan = 1. + */ +int +hdate_get_gmonth (hdate_struct const * h) +{ + return h->gd_mon; +} + +/** + @brief get the Gregorian year + + @param h pointer this hdate struct. + @return the Gregorian year. + */ +int +hdate_get_gyear (hdate_struct const * h) +{ + return h->gd_year; +} + +/** + @brief get the Hebrew day of the month + + @param h pointer this hdate struct. + @return the Hebrew day of the month, 1..30. + */ +int +hdate_get_hday (hdate_struct const * h) +{ + return h->hd_day; +} + +/** + @brief get the Hebrew month + + @param h pointer this hdate struct. + @return the Hebrew month, Tishery = 1 .. Adar I =13, Adar II = 14. + */ +int +hdate_get_hmonth (hdate_struct const * h) +{ + return h->hd_mon; +} + +/** + @brief get the Hebrew year + + @param h pointer this hdate struct. + @return the Hebrew year. + */ +int +hdate_get_hyear (hdate_struct const * h) +{ + return h->hd_year; +} + +/** + @brief get the day of the week + + @param h pointer this hdate struct. + @return the the day of the week. + */ +int +hdate_get_day_of_the_week (hdate_struct const * h) +{ + return h->hd_dw; +} + +/** + @brief get the size of the hebrew year + + @param h pointer this hdate struct. + @return the the size of the hebrew year. + */ +int +hdate_get_size_of_year (hdate_struct const * h) +{ + return h->hd_size_of_year; +} + +/** + @brief get the new year day of the week + + @param h pointer this hdate struct. + @return the the new year day of the week. + */ +int +hdate_get_new_year_day_of_the_week (hdate_struct const * h) +{ + return h->hd_new_year_dw; +} + +/** + @brief get the Julian day number + + @param h pointer this hdate struct. + @return the Julian day number. + */ +int +hdate_get_julian (hdate_struct const * h) +{ + return h->hd_jd; +} + +/** + @brief get the number of days passed since 1 tishrey + + @param h pointer this hdate struct. + @return the number of days passed since 1 tishrey. + */ +int +hdate_get_days (hdate_struct const * h) +{ + return h->hd_days; +} + +/** + @brief get the number of weeks passed since 1 tishrey + + @param h pointer this hdate struct. + @return the number of weeks passed since 1 tishrey. + */ +int +hdate_get_weeks (hdate_struct const * h) +{ + return h->hd_weeks; +} + +/********************************************************************************/ +/********************************************************************************/ + +/** + @brief creat a new hdate struct object, must be deleted using delete_hdate. + + @return a new hdate object + */ +hdate_struct * +new_hdate () +{ + /* allocate memory for a new hdate object */ + hdate_struct *h = (hdate_struct *) malloc (sizeof (hdate_struct)); + + /* check for out of memory */ + if (!h) + return NULL; + + /* get todays date */ + hdate_set_gdate (h, 0, 0, 0); + + return h; +} + +/** + @brief delete an hdate struct object. + + @param h pointer this hdate struct. + */ +hdate_struct * +delete_hdate (hdate_struct *h) +{ + /* if h exist delete it */ + if (h) + { + free (h); + h = NULL; + } + + return h; +} + diff --git a/.pc/typos.patch/docs/man/man3/hdate.h.3 b/.pc/typos.patch/docs/man/man3/hdate.h.3 new file mode 100644 index 0000000..554bb36 --- /dev/null +++ b/.pc/typos.patch/docs/man/man3/hdate.h.3 @@ -0,0 +1,1027 @@ +.TH "src/hdate.h" 3 "Sun Jan 8 2012" "Version 1.4" "libhdate C language" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/hdate.h \- +.PP +libhdate C language header\&. + +.SH SYNOPSIS +.br +.PP +.SS "Data Structures" + +.in +1c +.ti -1c +.RI "struct \fBhdate_struct\fP" +.br +.RI "\fIlibhdate Hebrew date struct \fP" +.in -1c +.SS "Defines" + +.in +1c +.ti -1c +.RI "#define \fBHDATE_DIASPORA_FLAG\fP -1" +.br +.RI "\fIuse diaspora dates and holydays flag \fP" +.ti -1c +.RI "#define \fBHDATE_ISRAEL_FLAG\fP 0" +.br +.RI "\fIuse israel dates and holydays flag \fP" +.ti -1c +.RI "#define \fBHDATE_SHORT_FLAG\fP -1" +.br +.RI "\fIuse short strings flag \fP" +.ti -1c +.RI "#define \fBHDATE_LONG_FLAG\fP 0" +.br +.RI "\fIuse long strings flag \fP" +.ti -1c +.RI "#define \fBHEBREW_NUMBER_BUFFER_SIZE\fP 17" +.br +.RI "\fIfor hdate_get_int_string_ and hdate_get_int_wstring \fP" +.ti -1c +.RI "#define \fBHEBREW_WNUMBER_BUFFER_SIZE\fP 9" +.br +.ti -1c +.RI "#define \fBHDATE_STRING_INT\fP 0" +.br +.RI "\fIfor function hdate_string: identifies string type: integer \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_DOW\fP 1" +.br +.RI "\fIfor function hdate_string: identifies string type: day of week \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_PARASHA\fP 2" +.br +.RI "\fIfor function hdate_string: identifies string type: parasha \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_HMONTH\fP 3" +.br +.RI "\fIfor function hdate_string: identifies string type: hebrew_month \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_GMONTH\fP 4" +.br +.RI "\fIfor function hdate_string: identifies string type: gregorian_month \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_HOLIDAY\fP 5" +.br +.RI "\fIfor function hdate_string: identifies string type: holiday \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_OMER\fP 6" +.br +.ti -1c +.RI "#define \fBHDATE_STRING_SHORT\fP 1" +.br +.RI "\fIfor function hdate_string: use short form, if one exists \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_LONG\fP 0" +.br +.RI "\fIfor function hdate_string: use long form \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_HEBREW\fP 1" +.br +.RI "\fIfor function hdate_string: use embedded hebrew string \fP" +.ti -1c +.RI "#define \fBHDATE_STRING_LOCAL\fP 0" +.br +.RI "\fIfor function hdate_string: use local locale string \fP" +.in -1c +.SS "Functions" + +.in +1c +.ti -1c +.RI "\fBhdate_struct\fP * \fBhdate_set_gdate\fP (\fBhdate_struct\fP *h, int d, int m, int y)" +.br +.RI "\fIcompute date structure from the Gregorian date \fP" +.ti -1c +.RI "\fBhdate_struct\fP * \fBhdate_set_hdate\fP (\fBhdate_struct\fP *h, int d, int m, int y)" +.br +.RI "\fIcompute date structure from the Hebrew date \fP" +.ti -1c +.RI "\fBhdate_struct\fP * \fBhdate_set_jd\fP (\fBhdate_struct\fP *h, int jd)" +.br +.RI "\fIcompute date structure from the Julian day \fP" +.ti -1c +.RI "char * \fBhdate_get_format_date\fP (\fBhdate_struct\fP const *h, int diaspora, int s)" +.br +.RI "\fIReturn a string, with the hebrew date\&. \fP" +.ti -1c +.RI "int \fBhdate_get_parasha\fP (\fBhdate_struct\fP const *h, int diaspora)" +.br +.RI "\fIget the number of hebrew parasha\&. \fP" +.ti -1c +.RI "int \fBhdate_get_holyday\fP (\fBhdate_struct\fP const *h, int diaspora)" +.br +.RI "\fIget the number of hebrew holiday\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_int_string\fP (int n)" +.br +.RI "\fIconvert an integer to hebrew string\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_day_string\fP (int day, int s)" +.br +.RI "\fIReturn a static string, with name of week day\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_month_string\fP (int month, int s)" +.br +.RI "\fIReturn a static string, with name of month\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_hebrew_month_string\fP (int month, int s)" +.br +.RI "\fIReturn a static string, with name of hebrew month\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_holyday_string\fP (int holyday, int s)" +.br +.RI "\fIName of hebrew holiday\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_parasha_string\fP (int parasha, int s)" +.br +.RI "\fIName of Parasha\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_omer_string\fP (int omer_day)" +.br +.RI "\fIReturn a static string, with the day in the omer\&. \fP" +.ti -1c +.RI "int \fBhdate_get_omer_day\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIReturn the day in the omer of the given date\&. \fP" +.ti -1c +.RI "int \fBhdate_get_holyday_type\fP (int holyday)" +.br +.RI "\fIReturn number of hebrew holyday type\&. \fP" +.ti -1c +.RI "int \fBhdate_get_size_of_hebrew_year\fP (int hebrew_year)" +.br +.RI "\fIsize of hebrew year in days\&. \fP" +.ti -1c +.RI "int \fBhdate_days_from_3744\fP (int hebrew_year)" +.br +.RI "\fIDays since Tishrey 3744\&. \fP" +.ti -1c +.RI "int \fBhdate_get_year_type\fP (int size_of_year, int new_year_dw)" +.br +.RI "\fIReturn Hebrew year type based on size and first week day of year\&. \fP" +.ti -1c +.RI "int \fBhdate_gdate_to_jd\fP (int day, int month, int year)" +.br +.RI "\fICompute Julian day from Gregorian date\&. \fP" +.ti -1c +.RI "int \fBhdate_hdate_to_jd\fP (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year)" +.br +.RI "\fICompute Julian day from Hebrew day, month and year\&. \fP" +.ti -1c +.RI "void \fBhdate_jd_to_gdate\fP (int jd, int *day, int *month, int *year)" +.br +.RI "\fIConverting from the Julian day to the Gregorian date\&. \fP" +.ti -1c +.RI "void \fBhdate_jd_to_hdate\fP (int jd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)" +.br +.RI "\fIConverting from the Julian day to the Hebrew day\&. \fP" +.ti -1c +.RI "int \fBhdate_get_day_of_year\fP (int day, int month, int year)" +.br +.RI "\fIdays from 1 january \fP" +.ti -1c +.RI "void \fBhdate_get_utc_sun_time_deg\fP (int day, int month, int year, double latitude, double longitude, double deg, int *sunrise, int *sunset)" +.br +.RI "\fIutc sun times for altitude at a gregorian date \fP" +.ti -1c +.RI "void \fBhdate_get_utc_sun_time\fP (int day, int month, int year, double latitude, double longitude, int *sunrise, int *sunset)" +.br +.RI "\fIutc sunrise/set time for a gregorian date \fP" +.ti -1c +.RI "void \fBhdate_get_utc_sun_time_full\fP (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)" +.br +.RI "\fIutc sunrise/set time for a gregorian date \fP" +.ti -1c +.RI "int \fBhdate_get_gday\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Gregorian day of the month \fP" +.ti -1c +.RI "int \fBhdate_get_gmonth\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Gregorian month \fP" +.ti -1c +.RI "int \fBhdate_get_gyear\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Gregorian year \fP" +.ti -1c +.RI "int \fBhdate_get_hday\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Hebrew day of the month \fP" +.ti -1c +.RI "int \fBhdate_get_hmonth\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Hebrew month \fP" +.ti -1c +.RI "int \fBhdate_get_hyear\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Hebrew year \fP" +.ti -1c +.RI "int \fBhdate_get_day_of_the_week\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the day of the week \fP" +.ti -1c +.RI "int \fBhdate_get_size_of_year\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the size of the hebrew year \fP" +.ti -1c +.RI "int \fBhdate_get_new_year_day_of_the_week\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the new year day of the week \fP" +.ti -1c +.RI "int \fBhdate_get_julian\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the Julian day number \fP" +.ti -1c +.RI "int \fBhdate_get_days\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the number of days passed since 1 tishrey \fP" +.ti -1c +.RI "int \fBhdate_get_weeks\fP (\fBhdate_struct\fP const *h)" +.br +.RI "\fIget the number of weeks passed since 1 tishrey \fP" +.ti -1c +.RI "\fBhdate_struct\fP * \fBnew_hdate\fP ()" +.br +.RI "\fIcreat a new hdate struct object, must be deleted using delete_hdate\&. \fP" +.ti -1c +.RI "\fBhdate_struct\fP * \fBdelete_hdate\fP (\fBhdate_struct\fP *h)" +.br +.RI "\fIdelete an hdate struct object\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_version_string\fP ()" +.br +.RI "\fIReturn a static string, with the package name and version\&. \fP" +.ti -1c +.RI "char * \fBhdate_get_translator_string\fP ()" +.br +.RI "\fIname of translator \fP" +.ti -1c +.RI "int \fBhdate_is_hebrew_locale\fP ()" +.br +.RI "\fIhelper function to find hebrew locale \fP" +.ti -1c +.RI "char * \fBhdate_string\fP (int type_of_string, int index, int short_form, int hebrew_form)" +.br +.RI "\fIReturn string values for hdate information\&. \fP" +.in -1c +.SH "Detailed Description" +.PP +libhdate C language header\&. + +libhdate - Hebrew calendar library, the C language header file\&. +.SH "Define Documentation" +.PP +.SS "#define \fBHDATE_DIASPORA_FLAG\fP -1" +.PP +use diaspora dates and holydays flag +.SS "#define \fBHDATE_ISRAEL_FLAG\fP 0" +.PP +use israel dates and holydays flag +.SS "#define \fBHDATE_SHORT_FLAG\fP -1" +.PP +use short strings flag +.SS "#define \fBHDATE_LONG_FLAG\fP 0" +.PP +use long strings flag +.SS "#define \fBHEBREW_NUMBER_BUFFER_SIZE\fP 17" +.PP +for hdate_get_int_string_ and hdate_get_int_wstring \fBNote:\fP +.RS 4 +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 millenium and the century\&.\&.\&. +.RE +.PP + +.SS "#define \fBHEBREW_WNUMBER_BUFFER_SIZE\fP 9" +.SS "#define \fBHDATE_STRING_INT\fP 0" +.PP +for function hdate_string: identifies string type: integer +.SS "#define \fBHDATE_STRING_DOW\fP 1" +.PP +for function hdate_string: identifies string type: day of week +.SS "#define \fBHDATE_STRING_PARASHA\fP 2" +.PP +for function hdate_string: identifies string type: parasha +.SS "#define \fBHDATE_STRING_HMONTH\fP 3" +.PP +for function hdate_string: identifies string type: hebrew_month +.SS "#define \fBHDATE_STRING_GMONTH\fP 4" +.PP +for function hdate_string: identifies string type: gregorian_month +.SS "#define \fBHDATE_STRING_HOLIDAY\fP 5" +.PP +for function hdate_string: identifies string type: holiday +.SS "#define \fBHDATE_STRING_OMER\fP 6" +.SS "#define \fBHDATE_STRING_SHORT\fP 1" +.PP +for function hdate_string: use short form, if one exists +.SS "#define \fBHDATE_STRING_LONG\fP 0" +.PP +for function hdate_string: use long form +.SS "#define \fBHDATE_STRING_HEBREW\fP 1" +.PP +for function hdate_string: use embedded hebrew string +.SS "#define \fBHDATE_STRING_LOCAL\fP 0" +.PP +for function hdate_string: use local locale string +.SH "Function Documentation" +.PP +.SS "\fBhdate_struct\fP* \fBhdate_set_gdate\fP (\fBhdate_struct\fP *h, intd, intm, inty)" +.PP +compute date structure from the Gregorian date \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.br +\fId\fP Day of month 1\&.\&.31 +.br +\fIm\fP Month 1\&.\&.12 if m or d is 0 return current date\&. +.br +\fIy\fP Year in 4 digits e\&.g\&. 2001 +.RE +.PP +\fBReturns:\fP +.RS 4 +pointer to this hdate struct +.RE +.PP + +.SS "\fBhdate_struct\fP* \fBhdate_set_hdate\fP (\fBhdate_struct\fP *h, intd, intm, inty)" +.PP +compute date structure from the Hebrew date \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.br +\fId\fP Day of month 1\&.\&.31 +.br +\fIm\fP Month 1\&.\&.14 ,(13 - Adar 1, 14 - Adar 2) if m or d is 0 return current date\&. +.br +\fIy\fP Year in 4 digits e\&.g\&. 5731 +.RE +.PP +\fBReturns:\fP +.RS 4 +pointer to this hdate struct +.RE +.PP + +.SS "\fBhdate_struct\fP* \fBhdate_set_jd\fP (\fBhdate_struct\fP *h, intjd)" +.PP +compute date structure from the Julian day \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.br +\fIjd\fP the julian day number\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +pointer to this hdate struct +.RE +.PP + +.SS "char* \fBhdate_get_format_date\fP (\fBhdate_struct\fP const *h, intdiaspora, ints)" +.PP +Return a string, with the hebrew date\&. \fBReturns:\fP +.RS 4 +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' ) formated date\&. You must free() the pointer after use\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIh\fP The \fBhdate_struct\fP of the date to print\&. +.br +\fIdiaspora\fP if true give diaspora holydays +.br +\fIshort_format\fP A short flag (true - returns a short string, false returns a long string)\&. +.RE +.PP +\fBWarning:\fP +.RS 4 +This was originally written using a local static string, calling for output to be copied away\&. +.RE +.PP + +.SS "int \fBhdate_get_parasha\fP (\fBhdate_struct\fP const *h, intdiaspora)" +.PP +get the number of hebrew parasha\&. \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.br +\fIdiaspora\fP if true give diaspora readings +.RE +.PP +\fBReturns:\fP +.RS 4 +the number of parasha 1\&. Bereshit etc\&.\&. (55 through 61 are joined strings e\&.g\&. Vayakhel Pekudei) +.RE +.PP + +.SS "int \fBhdate_get_holyday\fP (\fBhdate_struct\fP const *h, intdiaspora)" +.PP +get the number of hebrew holiday\&. \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.br +\fIdiaspora\fP if true give diaspora holidays +.RE +.PP +\fBReturns:\fP +.RS 4 +the number of holiday\&. +.RE +.PP + +.SS "char* \fBhdate_get_int_string\fP (intn)" +.PP +convert an integer to hebrew string\&. \fBParameters:\fP +.RS 4 +\fIn\fP The int to convert ( 0 < n < 11000) +.RE +.PP +\fBReturns:\fP +.RS 4 +a string of the hebrew number UTF-8 (logical) +.RE +.PP +\fBWarning:\fP +.RS 4 +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] +.RE +.PP + +.SS "char* \fBhdate_get_day_string\fP (intday, ints)" +.PP +Return a static string, with name of week day\&. \fBParameters:\fP +.RS 4 +\fIday_of_week\fP The number of the day 1\&.\&.7 (1 - sun)\&. +.br +\fIshort_form\fP A short flag (true - sun; false - sunday)\&. +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28] +.RE +.PP + +.SS "char* \fBhdate_get_month_string\fP (intmonth, ints)" +.PP +Return a static string, with name of month\&. \fBParameters:\fP +.RS 4 +\fImonth\fP The number of the month 1\&.\&.12 (1 - jan)\&. +.br +\fIshort_form\fP A short flag\&. +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28] +.RE +.PP + +.SS "char* \fBhdate_get_hebrew_month_string\fP (intmonth, ints)" +.PP +Return a static string, with name of hebrew month\&. \fBParameters:\fP +.RS 4 +\fImonth\fP The number of the month 1\&.\&.14 (1 - tishre, 13 - adar 1, 14 - adar 2)\&. +.br +\fIshort_form\fP A short flag\&. +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28] +.RE +.PP + +.SS "char* \fBhdate_get_holyday_string\fP (intholyday, ints)" +.PP +Name of hebrew holiday\&. \fBParameters:\fP +.RS 4 +\fIholiday\fP The holiday number\&. +.br +\fIshort_text\fP A short flag\&. 0=true, !0=false +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28] +.RE +.PP + +.SS "char* \fBhdate_get_parasha_string\fP (intparasha, ints)" +.PP +Name of Parasha\&. \fBParameters:\fP +.RS 4 +\fIparasha\fP The Number of Parasha 1-Bereshit (55 through 61 are joined strings e\&.g\&. Vayakhel Pekudei) +.br +\fIshort_form\fP A short flag\&. 0=true, !0 = false +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28] +.RE +.PP + +.SS "char* \fBhdate_get_omer_string\fP (intomer_day)" +.PP +Return a static string, with the day in the omer\&. \fBParameters:\fP +.RS 4 +\fIomer\fP day The day in the omer\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +a pointer to a string with the day in the omer\&. The caller must free() the pointer after use\&. +.RE +.PP +\fBWarning:\fP +.RS 4 +DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. +.RE +.PP +\fBAttention:\fP +.RS 4 +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] +.RE +.PP + +.SS "int \fBhdate_get_omer_day\fP (\fBhdate_struct\fP const *h)" +.PP +Return the day in the omer of the given date\&. \fBParameters:\fP +.RS 4 +\fIh\fP The \fBhdate_struct\fP of the date to use\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +The day in the omer, starting from 1 (or 0 if not in sfirat ha omer) +.RE +.PP + +.SS "int \fBhdate_get_holyday_type\fP (intholyday)" +.PP +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 +.PP +\fBParameters:\fP +.RS 4 +\fIholyday\fP the holyday number +.RE +.PP +\fBReturns:\fP +.RS 4 +the number of holyday type\&. +.RE +.PP + +.SS "int \fBhdate_get_size_of_hebrew_year\fP (inthebrew_year)" +.PP +size of hebrew year in days\&. \fBParameters:\fP +.RS 4 +\fIhebrew_year\fP the hebrew year\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +size of Hebrew year +.RE +.PP + +.SS "int \fBhdate_days_from_3744\fP (inthebrew_year)" +.PP +Days since Tishrey 3744\&. \fBAuthor:\fP +.RS 4 +Amos Shapir 1984 (rev\&. 1985, 1992) Yaacov Zamir 2003-2005 +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIhebrew_year\fP The Hebrew year +.RE +.PP +\fBReturns:\fP +.RS 4 +Number of days since 3,1,3744 +.RE +.PP + +.SS "int \fBhdate_get_year_type\fP (intsize_of_year, intnew_year_dw)" +.PP +Return Hebrew year type based on size and first week day of year\&. \fBParameters:\fP +.RS 4 +\fIsize_of_year\fP Length of year in days +.br +\fInew_year_dw\fP First week day of year +.RE +.PP +\fBReturns:\fP +.RS 4 +the number for year type (1\&.\&.14) +.RE +.PP + +.SS "int \fBhdate_gdate_to_jd\fP (intday, intmonth, intyear)" +.PP +Compute Julian day from Gregorian date\&. \fBAuthor:\fP +.RS 4 +Yaacov Zamir (algorithm from Henry F\&. Fliegel and Thomas C\&. Van Flandern ,1968) +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIday\fP Day of month 1\&.\&.31 +.br +\fImonth\fP Month 1\&.\&.12 +.br +\fIyear\fP Year in 4 digits e\&.g\&. 2001 +.RE +.PP +\fBReturns:\fP +.RS 4 +the julian day number +.RE +.PP + +.SS "int \fBhdate_hdate_to_jd\fP (intday, intmonth, intyear, int *jd_tishrey1, int *jd_tishrey1_next_year)" +.PP +Compute Julian day from Hebrew day, month and year\&. \fBAuthor:\fP +.RS 4 +Amos Shapir 1984 (rev\&. 1985, 1992) Yaacov Zamir 2003-2005 +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIday\fP Day of month 1\&.\&.31 +.br +\fImonth\fP Month 1\&.\&.14 (13 - Adar 1, 14 - Adar 2) +.br +\fIyear\fP Hebrew year in 4 digits e\&.g\&. 5753 +.br +\fIjd_tishrey1\fP return the julian number of 1 Tishrey this year +.br +\fIjd_tishrey1_next_year\fP return the julian number of 1 Tishrey next year +.RE +.PP +\fBReturns:\fP +.RS 4 +the julian day number +.RE +.PP + +.SS "void \fBhdate_jd_to_gdate\fP (intjd, int *day, int *month, int *year)" +.PP +Converting from the Julian day to the Gregorian date\&. \fBAuthor:\fP +.RS 4 +Yaacov Zamir (Algorithm, Henry F\&. Fliegel and Thomas C\&. Van Flandern ,1968) +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIjd\fP Julian day +.br +\fIday\fP return Day of month 1\&.\&.31 +.br +\fImonth\fP return Month 1\&.\&.12 +.br +\fIyear\fP return Year in 4 digits e\&.g\&. 2001 +.RE +.PP + +.SS "void \fBhdate_jd_to_hdate\fP (intjd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)" +.PP +Converting from the Julian day to the Hebrew day\&. \fBAuthor:\fP +.RS 4 +Yaacov Zamir 2005 +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIjd\fP Julian day +.br +\fIday\fP return Day of month 1\&.\&.31 +.br +\fImonth\fP return Month 1\&.\&.14 (13 - Adar 1, 14 - Adar 2) +.br +\fIyear\fP return Year in 4 digits e\&.g\&. 2001 +.br +\fIjd_tishrey1\fP return the julian number of 1 Tishrey this year +.br +\fIjd_tishrey1_next_year\fP return the julian number of 1 Tishrey next year +.RE +.PP + +.SS "int \fBhdate_get_day_of_year\fP (intday, intmonth, intyear)" +.PP +days from 1 january \fBParameters:\fP +.RS 4 +\fIday\fP this day of month +.br +\fImonth\fP this month +.br +\fIyear\fP this year +.RE +.PP +\fBReturns:\fP +.RS 4 +the days from 1 jan +.RE +.PP + +.SS "void \fBhdate_get_utc_sun_time_deg\fP (intday, intmonth, intyear, doublelatitude, doublelongitude, doubledeg, int *sunrise, int *sunset)" +.PP +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\&. +.PP +\fBParameters:\fP +.RS 4 +\fIday\fP this day of month +.br +\fImonth\fP this month +.br +\fIyear\fP this year +.br +\fIlongitude\fP longitude to use in calculations +.br +\fIlatitude\fP latitude to use in calculations +.br +\fIdeg\fP degrees of sun's altitude (0 - Zenith \&.\&. 90 - Horizon) +.br +\fIsunrise\fP return the utc sunrise in minutes +.br +\fIsunset\fP return the utc sunset in minutes +.RE +.PP + +.SS "void \fBhdate_get_utc_sun_time\fP (intday, intmonth, intyear, doublelatitude, doublelongitude, int *sunrise, int *sunset)" +.PP +utc sunrise/set time for a gregorian date \fBParameters:\fP +.RS 4 +\fIday\fP this day of month +.br +\fImonth\fP this month +.br +\fIyear\fP this year +.br +\fIlongitude\fP longitude to use in calculations degrees, negative values are east +.br +\fIlatitude\fP latitude to use in calculations degrees, negative values are south +.br +\fIsunrise\fP return the utc sunrise in minutes after midnight (00:00) +.br +\fIsunset\fP return the utc sunset in minutes after midnight (00:00) +.RE +.PP + +.SS "void \fBhdate_get_utc_sun_time_full\fP (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)" +.PP +utc sunrise/set time for a gregorian date \fBParameters:\fP +.RS 4 +\fIday\fP this day of month +.br +\fImonth\fP this month +.br +\fIyear\fP this year +.br +\fIlongitude\fP longitude to use in calculations +.br +\fIlatitude\fP latitude to use in calculations +.br +\fIsun_hour\fP return the length of shaa zaminit in minutes +.br +\fIfirst_light\fP return the utc alut ha-shachar in minutes +.br +\fItalit\fP return the utc tphilin and talit in minutes +.br +\fIsunrise\fP return the utc sunrise in minutes +.br +\fImidday\fP return the utc midday in minutes +.br +\fIsunset\fP return the utc sunset in minutes +.br +\fIfirst_stars\fP return the utc tzeit hacochavim in minutes +.br +\fIthree_stars\fP return the utc shlosha cochavim in minutes +.RE +.PP + +.SS "int \fBhdate_get_gday\fP (\fBhdate_struct\fP const *h)" +.PP +get the Gregorian day of the month \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Gregorian day of the month, 1\&.\&.31\&. +.RE +.PP + +.SS "int \fBhdate_get_gmonth\fP (\fBhdate_struct\fP const *h)" +.PP +get the Gregorian month \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Gregorian month, jan = 1\&. +.RE +.PP + +.SS "int \fBhdate_get_gyear\fP (\fBhdate_struct\fP const *h)" +.PP +get the Gregorian year \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Gregorian year\&. +.RE +.PP + +.SS "int \fBhdate_get_hday\fP (\fBhdate_struct\fP const *h)" +.PP +get the Hebrew day of the month \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Hebrew day of the month, 1\&.\&.30\&. +.RE +.PP + +.SS "int \fBhdate_get_hmonth\fP (\fBhdate_struct\fP const *h)" +.PP +get the Hebrew month \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Hebrew month, Tishery = 1 \&.\&. Adar I =13, Adar II = 14\&. +.RE +.PP + +.SS "int \fBhdate_get_hyear\fP (\fBhdate_struct\fP const *h)" +.PP +get the Hebrew year \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Hebrew year\&. +.RE +.PP + +.SS "int \fBhdate_get_day_of_the_week\fP (\fBhdate_struct\fP const *h)" +.PP +get the day of the week \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the the day of the week\&. +.RE +.PP + +.SS "int \fBhdate_get_size_of_year\fP (\fBhdate_struct\fP const *h)" +.PP +get the size of the hebrew year \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the the size of the hebrew year\&. +.RE +.PP + +.SS "int \fBhdate_get_new_year_day_of_the_week\fP (\fBhdate_struct\fP const *h)" +.PP +get the new year day of the week \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the the new year day of the week\&. +.RE +.PP + +.SS "int \fBhdate_get_julian\fP (\fBhdate_struct\fP const *h)" +.PP +get the Julian day number \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the Julian day number\&. +.RE +.PP + +.SS "int \fBhdate_get_days\fP (\fBhdate_struct\fP const *h)" +.PP +get the number of days passed since 1 tishrey \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the number of days passed since 1 tishrey\&. +.RE +.PP + +.SS "int \fBhdate_get_weeks\fP (\fBhdate_struct\fP const *h)" +.PP +get the number of weeks passed since 1 tishrey \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +the number of weeks passed since 1 tishrey\&. +.RE +.PP + +.SS "\fBhdate_struct\fP* \fBnew_hdate\fP ()" +.PP +creat a new hdate struct object, must be deleted using delete_hdate\&. \fBReturns:\fP +.RS 4 +a new hdate object +.RE +.PP + +.SS "\fBhdate_struct\fP* \fBdelete_hdate\fP (\fBhdate_struct\fP *h)" +.PP +delete an hdate struct object\&. \fBParameters:\fP +.RS 4 +\fIh\fP pointer this hdate struct\&. +.RE +.PP + +.SS "char* \fBhdate_get_version_string\fP ()" +.PP +Return a static string, with the package name and version\&. \fBReturns:\fP +.RS 4 +a static string, with the package name and version +.RE +.PP + +.SS "char* \fBhdate_get_translator_string\fP ()" +.PP +name of translator \fBReturns:\fP +.RS 4 +a static string with name of translator, or NULL if none\&. +.RE +.PP + +.SS "int \fBhdate_is_hebrew_locale\fP ()" +.PP +helper function to find hebrew locale \fBReturns:\fP +.RS 4 +0 - latin locale, -1 - hebrew locale +.RE +.PP + +.SS "char* \fBhdate_string\fP (inttype_of_string, intindex, intshort_form, inthebrew_form)" +.PP +Return string values for hdate information\&. \fBReturns:\fP +.RS 4 +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\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fItype_of_string\fP 0 = integer, 1 = day of week, 2 = parshaot, 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer +.br +\fIindex\fP 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 ) +.br +\fIshort_form\fP 0 = short format +.br +\fIhebrew_form\fP 0 = not hebrew (native/embedded) +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for libhdate C language from the source code\&. diff --git a/.pc/typos.patch/docs/man/man3/hdate_Hdate.3 b/.pc/typos.patch/docs/man/man3/hdate_Hdate.3 new file mode 100644 index 0000000..264cc79 --- /dev/null +++ b/.pc/typos.patch/docs/man/man3/hdate_Hdate.3 @@ -0,0 +1,610 @@ +.TH "hdate::Hdate" 3 "6 Jan 2008" "Version 1.4" "libhdate C++ language" \" -*- nroff -*- +.ad l +.nh +.SH NAME +hdate::Hdate \- \fBHdate\fP class. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBHdate\fP ()" +.br +.RI "\fI\fBHdate\fP constructor. \fP" +.ti -1c +.RI "\fB~Hdate\fP ()" +.br +.RI "\fI\fBHdate\fP destructor. \fP" +.ti -1c +.RI "void \fBset_gdate\fP (int d, int m, int y)" +.br +.RI "\fIcompute date structure from the Gregorian date \fP" +.ti -1c +.RI "void \fBset_hdate\fP (int d, int m, int y)" +.br +.RI "\fIcompute date structure from the Hebrew date \fP" +.ti -1c +.RI "void \fBset_jd\fP (int jd)" +.br +.RI "\fIcompute date structure from the Julian day \fP" +.ti -1c +.RI "char * \fBget_format_date\fP (int s)" +.br +.RI "\fIget formated hebrew date. \fP" +.ti -1c +.RI "char * \fBget_day_of_week_string\fP (int s)" +.br +.RI "\fIget name of week day. \fP" +.ti -1c +.RI "char * \fBget_month_string\fP (int s)" +.br +.RI "\fIget name month. \fP" +.ti -1c +.RI "char * \fBget_hebrew_month_string\fP (int s)" +.br +.RI "\fIget name hebrew month. \fP" +.ti -1c +.RI "char * \fBget_holyday_string\fP (int s)" +.br +.RI "\fIget name hebrew holiday. \fP" +.ti -1c +.RI "int \fBget_holyday_type\fP ()" +.br +.RI "\fIget the hebrew holiday type. \fP" +.ti -1c +.RI "char * \fBget_parasha_string\fP (int s)" +.br +.RI "\fIget name hebrew parasha. \fP" +.ti -1c +.RI "char * \fBget_hebrew_year_string\fP ()" +.br +.RI "\fIget name hebrew year. \fP" +.ti -1c +.RI "char * \fBget_hebrew_day_string\fP ()" +.br +.RI "\fIget name hebrew hebrew day of the month \fP" +.ti -1c +.RI "int \fBget_parasha\fP ()" +.br +.RI "\fIget parash number \fP" +.ti -1c +.RI "int \fBget_holyday\fP ()" +.br +.RI "\fIget holiday number \fP" +.ti -1c +.RI "int \fBget_gday\fP ()" +.br +.RI "\fIget Gregorian day of the month \fP" +.ti -1c +.RI "int \fBget_gmonth\fP ()" +.br +.RI "\fIget Gregorian month \fP" +.ti -1c +.RI "int \fBget_gyear\fP ()" +.br +.RI "\fIget Gregorian year \fP" +.ti -1c +.RI "int \fBget_hday\fP ()" +.br +.RI "\fIget Hebrew day of the month \fP" +.ti -1c +.RI "int \fBget_hmonth\fP ()" +.br +.RI "\fIget Hebrew month \fP" +.ti -1c +.RI "int \fBget_hyear\fP ()" +.br +.RI "\fIget Hebrew year \fP" +.ti -1c +.RI "int \fBget_day_of_the_week\fP ()" +.br +.RI "\fIget the day of the week \fP" +.ti -1c +.RI "int \fBget_size_of_year\fP ()" +.br +.RI "\fIget the size of the Hebrew year in days \fP" +.ti -1c +.RI "int \fBget_new_year_day_of_the_week\fP ()" +.br +.RI "\fIget the day of the week of hebrew new years \fP" +.ti -1c +.RI "int \fBget_julian\fP ()" +.br +.RI "\fIget the Julian day number \fP" +.ti -1c +.RI "int \fBget_days\fP ()" +.br +.RI "\fIget the number of days sice Tishrey I \fP" +.ti -1c +.RI "int \fBget_weeks\fP ()" +.br +.RI "\fIget the number of weeks sice Tishrey I \fP" +.ti -1c +.RI "void \fBset_location\fP (double in_latitude, double in_longitude, int in_tz)" +.br +.RI "\fIset location \fP" +.ti -1c +.RI "int \fBget_sunrise\fP ()" +.br +.RI "\fIsunrise time \fP" +.ti -1c +.RI "int \fBget_sunset\fP ()" +.br +.RI "\fIsunset time \fP" +.ti -1c +.RI "int \fBget_first_light\fP ()" +.br +.RI "\fIfirst light time \fP" +.ti -1c +.RI "int \fBget_talit\fP ()" +.br +.RI "\fItalit time \fP" +.ti -1c +.RI "int \fBget_first_stars\fP ()" +.br +.RI "\fIfirst stars time \fP" +.ti -1c +.RI "int \fBget_three_stars\fP ()" +.br +.RI "\fIthree stars time \fP" +.ti -1c +.RI "int \fBget_sun_hour\fP ()" +.br +.RI "\fIsun light hour time \fP" +.ti -1c +.RI "int \fBget_midday\fP ()" +.br +.RI "\fImidday hour time \fP" +.ti -1c +.RI "char * \fBget_translator_string\fP ()" +.br +.RI "\fIname of translator \fP" +.ti -1c +.RI "void \fBset_diaspora\fP ()" +.br +.RI "\fIset this \fBhdate\fP object to use diaspora holidays and dates \fP" +.ti -1c +.RI "void \fBset_israel\fP ()" +.br +.RI "\fIset this \fBhdate\fP object to use israel holidays and dates \fP" +.in -1c +.SH "Detailed Description" +.PP +\fBHdate\fP class. + +class for Hebrew/Gregorian date conversions +.SH "Constructor & Destructor Documentation" +.PP +.SS "hdate::Hdate::Hdate ()\fC [inline]\fP" +.PP +\fBHdate\fP constructor. +.PP +.SS "hdate::Hdate::~Hdate ()\fC [inline]\fP" +.PP +\fBHdate\fP destructor. +.PP +.SH "Member Function Documentation" +.PP +.SS "void hdate::Hdate::set_gdate (int d, int m, int y)\fC [inline]\fP" +.PP +compute date structure from the Gregorian date +.PP +\fBParameters:\fP +.RS 4 +\fId\fP Day of month 1..31 +.br +\fIm\fP Month 1..12 , if m or d is 0 return current date. +.br +\fIy\fP Year in 4 digits e.g. 2001 +.RE +.PP + +.SS "void hdate::Hdate::set_hdate (int d, int m, int y)\fC [inline]\fP" +.PP +compute date structure from the Hebrew date +.PP +\fBParameters:\fP +.RS 4 +\fId\fP Day of month 1..31 +.br +\fIm\fP Month 1..14 , if m or d is 0 return current date. +.br +\fIy\fP Year in 4 digits e.g. 5731 +.RE +.PP + +.SS "void hdate::Hdate::set_jd (int jd)\fC [inline]\fP" +.PP +compute date structure from the Julian day +.PP +\fBParameters:\fP +.RS 4 +\fIjd\fP the julian day number. +.RE +.PP + +.SS "char* hdate::Hdate::get_format_date (int s)\fC [inline]\fP" +.PP +get formated hebrew date. +.PP +return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formated date. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of foramted date +.RE +.PP + +.SS "char* hdate::Hdate::get_day_of_week_string (int s)\fC [inline]\fP" +.PP +get name of week day. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag true - returns a short string: sun, false returns: sunday. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of the day of the week +.RE +.PP + +.SS "char* hdate::Hdate::get_month_string (int s)\fC [inline]\fP" +.PP +get name month. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag true - returns a short string: Mar, false returns: March. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of month name +.RE +.PP + +.SS "char* hdate::Hdate::get_hebrew_month_string (int s)\fC [inline]\fP" +.PP +get name hebrew month. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag true - returns a short string. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of hebrew month name +.RE +.PP + +.SS "char* hdate::Hdate::get_holyday_string (int s)\fC [inline]\fP" +.PP +get name hebrew holiday. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag true - returns a short string. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of hebrew holiday name +.RE +.PP + +.SS "int hdate::Hdate::get_holyday_type ()\fC [inline]\fP" +.PP +get the hebrew holiday type. +.PP +\fBReturns:\fP +.RS 4 +the holiday type (1- regular holyday, 2- three regels, 3- tzom, 0- no holiday) +.RE +.PP + +.SS "char* hdate::Hdate::get_parasha_string (int s)\fC [inline]\fP" +.PP +get name hebrew parasha. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP short flag true - returns a short string. +.RE +.PP +\fBReturns:\fP +.RS 4 +a static string of hebrew parash name +.RE +.PP + +.SS "char* hdate::Hdate::get_hebrew_year_string ()\fC [inline]\fP" +.PP +get name hebrew year. +.PP +\fBReturns:\fP +.RS 4 +a static string of hebrew year +.RE +.PP + +.SS "char* hdate::Hdate::get_hebrew_day_string ()\fC [inline]\fP" +.PP +get name hebrew hebrew day of the month +.PP +\fBReturns:\fP +.RS 4 +a static string of hebrew day of the month +.RE +.PP + +.SS "int hdate::Hdate::get_parasha ()\fC [inline]\fP" +.PP +get parash number +.PP +\fBReturns:\fP +.RS 4 +the hebrew parasha number +.RE +.PP + +.SS "int hdate::Hdate::get_holyday ()\fC [inline]\fP" +.PP +get holiday number +.PP +\fBReturns:\fP +.RS 4 +the hebrew holiday number +.RE +.PP + +.SS "int hdate::Hdate::get_gday ()\fC [inline]\fP" +.PP +get Gregorian day of the month +.PP +\fBReturns:\fP +.RS 4 +the Gregorian day of the month +.RE +.PP + +.SS "int hdate::Hdate::get_gmonth ()\fC [inline]\fP" +.PP +get Gregorian month +.PP +\fBReturns:\fP +.RS 4 +the Gregorian month +.RE +.PP + +.SS "int hdate::Hdate::get_gyear ()\fC [inline]\fP" +.PP +get Gregorian year +.PP +\fBReturns:\fP +.RS 4 +the Gregorian year +.RE +.PP + +.SS "int hdate::Hdate::get_hday ()\fC [inline]\fP" +.PP +get Hebrew day of the month +.PP +\fBReturns:\fP +.RS 4 +the Hebrew day of the month +.RE +.PP + +.SS "int hdate::Hdate::get_hmonth ()\fC [inline]\fP" +.PP +get Hebrew month +.PP +\fBReturns:\fP +.RS 4 +the Hebrew month +.RE +.PP + +.SS "int hdate::Hdate::get_hyear ()\fC [inline]\fP" +.PP +get Hebrew year +.PP +\fBReturns:\fP +.RS 4 +the Hebrew year +.RE +.PP + +.SS "int hdate::Hdate::get_day_of_the_week ()\fC [inline]\fP" +.PP +get the day of the week +.PP +\fBReturns:\fP +.RS 4 +the day of the week +.RE +.PP + +.SS "int hdate::Hdate::get_size_of_year ()\fC [inline]\fP" +.PP +get the size of the Hebrew year in days +.PP +\fBReturns:\fP +.RS 4 +the size of the Hebrew year in days +.RE +.PP + +.SS "int hdate::Hdate::get_new_year_day_of_the_week ()\fC [inline]\fP" +.PP +get the day of the week of hebrew new years +.PP +\fBReturns:\fP +.RS 4 +the day of the week of hebrew new years +.RE +.PP + +.SS "int hdate::Hdate::get_julian ()\fC [inline]\fP" +.PP +get the Julian day number +.PP +\fBReturns:\fP +.RS 4 +the Julian day number +.RE +.PP + +.SS "int hdate::Hdate::get_days ()\fC [inline]\fP" +.PP +get the number of days sice Tishrey I +.PP +\fBReturns:\fP +.RS 4 +the the number of days sice Tishrey I +.RE +.PP + +.SS "int hdate::Hdate::get_weeks ()\fC [inline]\fP" +.PP +get the number of weeks sice Tishrey I +.PP +\fBReturns:\fP +.RS 4 +the the number of weeks sice Tishrey I +.RE +.PP + +.SS "void hdate::Hdate::set_location (double in_latitude, double in_longitude, int in_tz)\fC [inline]\fP" +.PP +set location +.PP +\fBParameters:\fP +.RS 4 +\fIin_longitude\fP longitude to use in calculations degrees, negative values are east +.br +\fIin_latitude\fP latitude to use in calculations degrees, negative values are south +.br +\fIin_tz\fP time zone +.RE +.PP + +.SS "int hdate::Hdate::get_sunrise ()\fC [inline]\fP" +.PP +sunrise time +.PP +\fBReturns:\fP +.RS 4 +sunrise in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_sunset ()\fC [inline]\fP" +.PP +sunset time +.PP +\fBReturns:\fP +.RS 4 +sunset in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_first_light ()\fC [inline]\fP" +.PP +first light time +.PP +\fBReturns:\fP +.RS 4 +first light in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_talit ()\fC [inline]\fP" +.PP +talit time +.PP +\fBReturns:\fP +.RS 4 +talit time in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_first_stars ()\fC [inline]\fP" +.PP +first stars time +.PP +\fBReturns:\fP +.RS 4 +first stars in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_three_stars ()\fC [inline]\fP" +.PP +three stars time +.PP +\fBReturns:\fP +.RS 4 +three stars in minutes after midnight (00:00) +.RE +.PP + +.SS "int hdate::Hdate::get_sun_hour ()\fC [inline]\fP" +.PP +sun light hour time +.PP +\fBReturns:\fP +.RS 4 +sun light hour in minutes +.RE +.PP + +.SS "int hdate::Hdate::get_midday ()\fC [inline]\fP" +.PP +midday hour time +.PP +\fBReturns:\fP +.RS 4 +midday hour in minutes +.RE +.PP + +.SS "char* hdate::Hdate::get_translator_string ()\fC [inline]\fP" +.PP +name of translator +.PP +\fBReturns:\fP +.RS 4 +a static string with name of translator, or NULL if none +.RE +.PP + +.SS "void hdate::Hdate::set_diaspora ()\fC [inline]\fP" +.PP +set this \fBhdate\fP object to use diaspora holidays and dates +.PP +.SS "void hdate::Hdate::set_israel ()\fC [inline]\fP" +.PP +set this \fBhdate\fP object to use israel holidays and dates +.PP + + +.SH "Author" +.PP +Generated automatically by Doxygen for libhdate C++ language from the source code. diff --git a/.pc/typos.patch/examples/hcal/hcal.c b/.pc/typos.patch/examples/hcal/hcal.c new file mode 100644 index 0000000..4d26472 --- /dev/null +++ b/.pc/typos.patch/examples/hcal/hcal.c @@ -0,0 +1,2021 @@ +/* hcal.c http://libhdate.sourceforge.net + * Hebrew calendar (part of package libhdate) + * + * compile: + * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal + * + * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define _GNU_SOURCE // for mempcpy +#include // For printf +#include // For hebrew date +//#include "../../src/hdate.h" +#include // For atoi, malloc +#include // For setlocale +#include // For getopt_long +#include // For strlen, mempcpy +#include // For time, tzset +//#include // for unicode character operations + +#define FALSE 0 +#define TRUE -1 +#define SHABBAT 7 + +#define HDATE_STRING_SHORT 1 + +// for opt.menu[MAX_MENU_ITEMS] +#define MAX_MENU_ITEMS 10 + + + +// for colorization +#define CODE_REVERSE_VIDEO "%c[7m", 27 +#define CODE_RESTORE_VIDEO "%c[m", 27 +#define CODE_BLACK "%c[30m", 27 +#define CODE_LIGHT_RED "%c[31m", 27 +#define CODE_LIGHT_GREEN "%c[32m", 27 +#define CODE_LIGHT_BROWN "%c[33m", 27 +#define CODE_DARK_BLUE "%c[34m", 27 +#define CODE_LIGHT_PURPLE "%c[35m", 27 +#define CODE_LIGHT_AQUA "%c[36m", 27 +#define CODE_LIGHT_GREY "%c[37m", 27 +#define CODE_BOLD_GREY "%c[1;30m", 27 +#define CODE_BOLD_RED "%c[1;31m", 27 +#define CODE_BOLD_GREEN "%c[1;32m", 27 +#define CODE_BOLD_YELLOW "%c[1;33m", 27 +#define CODE_BOLD_BLUE "%c[1;34m", 27 +#define CODE_BOLD_PURPLE "%c[1;35m", 27 +#define CODE_BOLD_AQUA "%c[1;36m", 27 +#define CODE_BOLD_WHITE "%c[1;37m", 27 +#define ELEMENT_WEEKDAY_G 1 +#define ELEMENT_WEEKDAY_H 2 +#define ELEMENT_SHABBAT_DAY 3 +#define ELEMENT_HOLIDAY_DAY 4 +#define ELEMENT_HOLIDAY_FLAG 5 +#define ELEMENT_SHABBAT_NAME 6 +#define ELEMENT_WEEKDAY_NAMES 7 +#define ELEMENT_MONTH_G 8 +#define ELEMENT_MONTH_H 9 +#define ELEMENT_SHABBAT_TIMES 10 +#define ELEMENT_PARASHA 11 +#define ELEMENT_THIS_SHABBAT_TIMES 12 +#define ELEMENT_THIS_PARASHA 13 +#define ELEMENT_HOLIDAY_NAME 14 +#define ELEMENT_TODAY_HOLIDAY_DAY 15 +#define ELEMENT_TODAY_HOLIDAY_NAME 16 + +/************************************************** +* functions to support hcal and hdate +**************************************************/ +#include "./local_functions.c" + + + +static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' }; +/* Holiday types: (reference hdate_holyday.c) + / - 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 +*/ + + + +typedef struct { + int html; + int external_css; + int diaspora; + int parasha; + int shabbat; + int candles; + int havdalah; + int no_reverse; + int three_month; + int colorize; + int footnote; + int jd_today_g; + int jd_today_h; + int force_hebrew; + int force_israel; + int not_sunset_aware; + int quiet_alerts; + int bidi; + double lat; + double lon; + int tz; + int menu; + char* menu_item[MAX_MENU_ITEMS]; + } option_list; + +typedef struct { + int g_month_1; + int g_year_1; + int g_month_2; + int g_year_2; + int h_month_1; + int h_year_1; + int h_month_2; + int h_year_2; + } header_info; + + +const char* hcal_config_file_text = N_("\ +# configuration file for hcal - Hebrew calendar program\n\ +# part of package libhdate\n\ +#\n# Should you mangle this file and wish to restore its default content,\n\ +# rename or delete this file and run hcal; hcal will automatically\n\ +# regenerate the default content.\n#\n\ +# Your system administrator can set system-wide defaults for hcal by\n\ +# modifying file .\n\ +# You may override all defaults by changing the contents of this file.\n\ +#\n\ +# Version information\n\ +# This may be used by updates to hcal to determine how to parse the file\n\ +# and whether additional information and options should be appended to\n\ +# the end of this file.\n\ +VERSION=2.00\n\ +# Location awareness\n\ +# hcal wants to accurately highlight the current Hebrew day, including\n\ +# during the hours between sunset and secular midnight. If you don't\n\ +# provide it with latitude, longitude, and time zone information, hcal\n\ +# will try to guess the information, based upon your system timezone,\n\ +# and its (limited, and maybe biased) of the dominant Jewish community\n\ +# in that timezone. When hcal is forced to guess, it alerts the user\n\ +# with a message that includes the guessed location.\n\ +# hcal's guesses will also affect its default behaviour for ouput of\n\ +# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\ +#SUNSET_AWARE=TRUE\n\ +# LATITUDE and LONGITUDE may be in decimal format or in the form\n\ +# degrees[:minutes[:seconds]] with the characters :'\" as possible\n\ +# delimiters. Use negative values to indicate South and West, or\n\ +# use the abbreviated compass directions N, S, E, W.\n\ +#LATITUDE=\n\ +#LONGITUDE=\n\ +# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\ +# with the characters :'\" as possible delimiters.\n\ +#TIMEZONE=\n\n\ +# Israel and the diaspora\n\ +# If hcal guesses that you're not in Israel, the DIASPORA option will be\n\ +# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\ +# forces hcal to display calendar information for Israel, using hcal's\n\ +# default coordinates foe Israel, or coordinates that you provide that\n\ +# seem legitmately within Israel.\n\ +# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\ +# Sukkot, set BOTH flags true in order to see holiday information for\n\ +# a non-resident vistor to Israel. The command line options for these\n\ +# features are --israel, -I, --diaspora, -d.\n\ +#FORCE_DIASPORA=FALSE;\n\ +#FORCE_ISRAEL=FALSE;\n\n\ +# Shabbat related\n\ +# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\ +# The command line options for these features are -p (--parasha), and\n\ +# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\ +# before sunset). The HAVDALAH field can accept a value of 20 - 90\n\ +# (minutes after sunset).\n\ +#PARASHA_NAMES=FALSE\n\ +#SHABBAT_INFO=FALSE\n\ +#CANDLE_LIGHTING=FALSE\n\ +#HAVDALAH=FALSE\n\n\ +# Holiday identification\n\ +# hcal flags holidays by replacing the gregorian/Hebrew date separator\n\ +# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\ +# will have hcal output after the month's calendar, a list of the month's\n\ +# holidays along with the days on which they occur.\n\ +#FOOTNOTE=FALSE\n\n\ +# Output in hebrew characters\n\ +# hcal defaults to output all information in your default language, so\n\ +# if your default language is Hebrew, you're all set. Otherwise, you can\n\ +# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\ +# still outputting gregorian information in your default language. To\n\ +# output ALL information in Hebrew, run something like this:\n\ +# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\ +# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\ +# output, you need to install a terminal font that includes the Hebrew\n\ +# character set (hint: unicode).\n\ +# The command line option for FORCE_HEBREW is either --hebrew or -H\n\ +#FORCE_HEBREW=FALSE\n\n\ +# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\ +# Unfortunately, the world can not be depended upon to be either. Most\n\ +# Xwindow applications will display the data fine with FORCE_HEBREW; most\n\ +# xterm implementations will not. (in fact, the only xterm clone I know\n\ +# of that comes close is mlterm). If using FORCE_HEBREW results in\n\ +# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\ +# This will reverse the order of the Hebrew characters, so they will\n\ +# display 'visual'ly correct; however, such output will not be suitable\n\ +# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\ +# automatically forces hebrew.\n\ +# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\ +#OUTPUT_BIDI=FALSE\n\n\ +# Display enhancements\n\ +# hcal defaults to display the current day in reverse video\n\ +# The command line option for this feature is --no-reverse\n\ +#SUPPRESS_REVERSE_VIDEO=FALSE;\n\ +# hcal can display its output \"calming, muted tones\". Note that piping\n\ +# colorized output may yield unexpected results.\n\ +#COLORIZE=FALSE\n\n\ +# HTML OUTPUT\n\ +#OUTPUT_HTML=FALSE\n\ +#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\ +# Suppress alerts and warnings\n\ +# hcal alerts the user via STDERR when it guesses the user's location.\n\ +#QUIET_ALERTS=FALSE\n\n\ +# Three month display\n\ +# hcal can display a previous, current and next month side-by-side. hcal\n\ +# can also display a calendar for an entire year in four rows of three\n\ +# months each. Note that this will display properly only if your console\n\ +# is set for at least 127 columns. Note also that setting this option to\n\ +# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\ +#THREE_MONTH=FALSE\n\n\ +# User-defined menus\n\ +# You may specify here command-line strings to optionally be parsed\n\ +# by hcal at execution time. To do so, use the command line option -m\n\ +# (--menu). hcal will process first the settings of this config file,\n\ +# then the other settings of your command line, and then will prompt\n\ +# you for which menu item you would like to select. hcal will process\n\ +# your menu selection as if it were a new command line, further modifying\n\ +# all the prior settings.\n\ +# Only the first ten \"MENU=\" entries will be read. Each line will be\n\ +# truncated at one hundred characters\n\ +#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\ +#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\ +#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\ +#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\ +"); + + +/************************************************** +* print version +*************************************************/ +int print_version () +{ + printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6")); + return 0; +} + +/************************************************** +* print usage +*************************************************/ +void print_usage_hcal () +{ + printf ("%s\n", +N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\ + coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\ + -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\ + timezone: -z nn[( .nn | :mm )]\n\ +Try \'hcal --help\' for more information")); +} + +/************************************************** +* print help +*************************************************/ +void print_help () +{ + print_usage_hcal(); + printf ("%s\n", +N_("Hebrew calendar\nOPTIONS:\n\ + -1 --one-month over-ride config file setting if you had set\n\ + option --three-month as a default there\n\ + -3 --three-month displays previous/next months\n\ + side by side. requires 127 columns\n\ + -b --bidi prints hebrew in reverse (visual)\n\ + --visual\n\ + --no-bidi over-ride config file setting if you had set\n\ + --no-visual option -bidi as a default there\n\ + -c --colorize displays in calming, muted tones\n\ + --no-color over-ride a --colorize setting in your config file\n\ + -d --diaspora use diaspora reading and holidays.\n\ + -f --footnote print descriptive notes of holidays\n\ + --no-footnote over-ride a footnote setting in your config file\n\ + -h --html output in html format to stdout\n\ + -H --hebrew print hebrew information in Hebrew\n\ + -i use external css file \"./hcal.css\".\n\ + -I --israel override a diaspora default\n\ + --no-reverse do not highlight today's date\n\ + -m --menu prompt user-defined menu from config file\n\ + -p --parasha print week's parasha on each calendar row\n\ + -q --quiet-alerts suppress warning messages\n\ + -s --shabbat print Shabbat times and parshiot\n\ + --candles modify default minhag of 20 minutes. (17\n\ +\n\ +\n\ +\n\ +\n\ +\n"); + + /* some alternative css styles */ + printf ("\n\ +\n\ +\n\ +\n"); + + if ( (force_hebrew) || (hdate_is_hebrew_locale()) ) + printf ("Hebrew Calendar\n\n
\n"); + else + printf ("Hebrew Calendar\n\n
\n"); + + return 0; +} + + + +/************************************************** + * HTML - print footer + *************************************************/ +int print_html_footer () +{ + printf ("\n"); + + printf ("\n"); + + return 0; +} + + +/************************************************** +* Print HTML header - month line +*************************************************/ +void print_header_month_line_html( const header_info header) +{ + + // TODO - fix bug ellul xxxx - tishrei xxxx+1 +// char *h_year_1; +// h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *h_year_1 = NULL; + + /************************************************** + * Print Gregorian month and year + **************************************************/ + printf ("\n", + hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL), + header.g_year_1); + + h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW); + /************************************************** + * Print Hebrew month and year + **************************************************/ + printf ("
%s %d"); + if (header.h_month_1 != header.h_month_2) + { + printf ("%s-", + hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + } + printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL)); + printf ("\n"); + printf ("%s
\n", h_year_1); + + printf ("\n\n"); + + + if (h_year_1 != NULL) free(h_year_1); +} + + +/************************************************** +* HTML - print column headings for days of weeks +**************************************************/ +void print_header_dow_line_html() +{ + int j; + + for (j = 1; j < 8; j++) + printf ("", + hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE)); +} + + + +/************************************************** + * end HTML functions + *************************************************/ + + +/************************************************* +* Display data in a more pleasing visual manner +*************************************************/ +void colorize_element ( const int element ) +{ + switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; + } +/* switch (element) { + case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break; + case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break; + case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break; + case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break; + case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break; + case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break; + case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break; +*/ +} + + + +/************************************************** + * print header - month line to stdout + *************************************************/ +void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi ) +{ + char *g_month, *h1_month, *h2_month; + char *h1_year = NULL; + char *h2_year = NULL; + size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len; + + + char *hebrew_buffer, *hebrew_buffer_next; + size_t hebrew_buffer_len, literals_len; + + int j; + size_t padding = 0; + + + /************************************************** + * Print Gregorian month and year + *************************************************/ + g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL); + if (colorize) colorize_element(ELEMENT_MONTH_G); + printf ("%s %d", g_month, header.g_year_1); + if (colorize) printf(CODE_RESTORE_VIDEO); + + /************************************************** + * Print Hebrew month and year + * + * because we want this printed right-justified on + * the same line, we need to calculate how many + * spaces to pad. + * + * because of the possible user option --bidi, we + * need to buffer the entire Hebrew text in order + * reverse its sequence for 'visual' display. + * + * This all requires collecting the data first + * and determining each's length. + *************************************************/ + + #define CALENDAR_WIDTH 41 + #define DASH_WIDTH 3 // includes surrounding spaces + #define SPACE_WIDTH 1 + + + /************************************************* + * padding info for gregorian date + *************************************************/ + g_month_len = strlen(g_month); + g_year_len = 4; + switch (header.g_year_1) + { + case 1-9: g_year_len = 1; break; + case 10-99: g_year_len = 2; break; + case 100-999: g_year_len = 3; break; + } + + + /************************************************** + * collect padding info for Hebrew date + *************************************************/ + h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew); + h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew); +//printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0); + + h1_month_len = strlen(h1_month); + h1_year_len = strlen(h1_year); +// DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len); +// DEBUG - int ii; for (ii=0; ii\n"); + else printf ("\n"); + + + /************************************************** + * print column headings for days of weeks + **************************************************/ + if (opt.html) print_header_dow_line_html(); + else + { + if (opt.three_month) + { + print_header_dow_line_stdout(opt.colorize); + printf(" "); + } + print_header_dow_line_stdout(opt.colorize); + if (opt.three_month) + { + printf(" "); + print_header_dow_line_stdout(opt.colorize); + } + } + + /************************************************** + * terminate line + **************************************************/ + if (opt.html) printf ("\n"); + else printf ("\n"); + + return 0; +} + + +/************************************************** +* print HTML calendar entry (ie. a single day) +*************************************************/ +void print_day_html ( const hdate_struct h, const int month, const option_list opt) +{ + + int holiday_type; +// char *hd_day; +// hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE); +// char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + char *hd_day_str = NULL; + + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + + if (h.gd_mon != month) printf ("\n"); + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print stdout calendar entry (ie. a single day) +*************************************************/ +void print_day ( const hdate_struct h, const int month, const option_list opt) +{ + + // for forcing Hebrew printing of Hebrew data + //char *language; + + // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1]; + // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1); + char *hd_day_str = NULL; + + size_t hd_day_buffer_str_len; + + int holiday_type; + holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora)); + + /************************************************** + * out of month - needs padding + *************************************************/ + if (h.gd_mon != month) printf(" "); + + + /************************************************** + * in month - print the data + *************************************************/ + else + { + /************************************************* + * Gregorian date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_g) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_G); + } + + /************************************************* + * Gregorian date entry - the day of the month + *************************************************/ + // this next line is necessary to align numbers + // correctly with bidi (tested using mlterm) + if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) ) + printf ("%d ", h.gd_day); + else printf ("%2d", h.gd_day); + + /************************************************* + * Gregorian date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_g) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + + /************************************************* + * holiday flag + *************************************************/ + printf ("%c", holiday_flag[holiday_type]); + + + /************************************************* + * Hebrew date entry - color prefix + *************************************************/ + if (h.hd_jd == opt.jd_today_h) + printf (CODE_REVERSE_VIDEO); + else if (opt.colorize) + { + if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY); + else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY); + else colorize_element(ELEMENT_WEEKDAY_H); + } + + + /************************************************* + * Hebrew date entry - day of the month + *************************************************/ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew); + if (opt.bidi) + { + hd_day_buffer_str_len = (size_t) strlen(hd_day_str); + if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE) + hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1; + revstr(hd_day_str, hd_day_buffer_str_len); + } + if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) && + ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) ) + { // need to pad Hebrew dates 1-10, 20, 30 + printf ("%s%s"," ",hd_day_str); + } + else printf ("%2s", hd_day_str); + + /************************************************* + * Hebrew date entry - color cleanup + *************************************************/ + if ((h.hd_jd == opt.jd_today_h) || (opt.colorize)) + printf (CODE_RESTORE_VIDEO); + + } + + if (hd_day_str != NULL) free(hd_day_str); +} + + +/************************************************* +* print a calendar week's entry (ie. seven columns) +*************************************************/ +void print_week( int jd, const int month, const option_list opt) +{ +#define long_parasha_name 0 + + hdate_struct h; + + int calendar_column; + + // for opt.shabbat + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + int this_week; + hdate_struct yom_shishi; + + // for opt.parasha + int shabbat_name; + char *shabbat_name_str, *shabbat_name_buffer; + size_t shabbat_name_str_len; + + + // for forcing Hebrew printing of Hebrew data + //char *language; + + + /************************************************** + * for each column of calendar + *************************************************/ + for (calendar_column = 0; calendar_column < 7; calendar_column++) + { + + /************************************************** + * Get this day's information + *************************************************/ + hdate_set_jd (&h, jd); + if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) ) + yom_shishi = h; + + + /************************************************** + * HTML calendar option + *************************************************/ + if (opt.html) print_day_html ( h, month, opt ); + + + + /************************************************** + * non-HTML calendar option + *************************************************/ + else print_day ( h, month, opt); + + + /************************************************** + * space between days of week + *************************************************/ + if (calendar_column != 6) printf (" "); + + /************************************************** + * advance to next day of week + *************************************************/ + jd++; + } + + /************************************************** + * print end of calendar line + *************************************************/ + if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) ) + { + + /******************************************************** + * determine whether this line gets special highlighting + ********************************************************/ + if ((opt.colorize) + && ((opt.shabbat) || (opt.parasha)) + && ((jd - 1) > opt.jd_today_h) + && (((jd - 1) - opt.jd_today_h) < 7) ) + this_week = TRUE; + else this_week = FALSE; + + /************************************************* + * print shabbat times + *************************************************/ + if (opt.shabbat) + { + // candlelighting times + /// note: compiler incorrectly issued warnings: + /// "may be used uninitialized in this function [-Wmaybe-uninitialized]" + /// The initialization occurs above (~line 1005) "yom_shishi = h" + hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year, + opt.lat, opt.lon, &sunrise, &sunset); + + // FIXME - allow for further minhag variation + if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz; + else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf (" %02d:%02d", sunset / 60, sunset % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + + printf(" - "); + + // motzay shabat time + hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat, + opt.lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + + // FIXME - allow for further minhag variation + if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz; + else three_stars = three_stars + opt.tz; + + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES); + else colorize_element(ELEMENT_SHABBAT_TIMES); + } + printf ("%02d:%02d", three_stars / 60, three_stars % 60); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + + + /************************************************* + * print shabbat name + *************************************************/ + if (opt.parasha) + { + + /************************************************* + * print shabbat name - force-hebrew setup + *************************************************/ + // BUG - this isn't thread-safe + /*if (opt.force_hebrew) + { + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + + + shabbat_name = hdate_get_parasha (&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_PARASHA, shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + else + { + shabbat_name = hdate_get_holyday(&h, opt.diaspora); + if (shabbat_name) shabbat_name_str = + hdate_string( HDATE_STRING_HOLIDAY, + shabbat_name, + HDATE_STRING_SHORT, opt.force_hebrew); + } + if (shabbat_name) + { + if (opt.colorize) + { + if (this_week) colorize_element(ELEMENT_THIS_PARASHA); + else colorize_element(ELEMENT_PARASHA); + } + if (opt.bidi) + { + shabbat_name_str_len = strlen(shabbat_name_str); + shabbat_name_buffer = malloc(shabbat_name_str_len+1); + memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len); + shabbat_name_buffer[shabbat_name_str_len] = '\0'; + revstr(shabbat_name_buffer, shabbat_name_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 15; + printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer); + + free(shabbat_name_buffer); + } + else printf(" %s", shabbat_name_str); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + } + } + } +} + + + + +/************************************************** +* print month table +*************************************************/ +int print_calendar ( const int current_month, const int current_year, const option_list opt) +{ + hdate_struct h; + int calendar_line; + int max_calendar_lines = 4; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int previous_month = 1, next_month = 1; + int previous_year, next_year; + /// the initializations on next line aren't truly necessary, but they do + /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" + int jd_current_month, jd_previous_month = 1, jd_next_month = 1; + + void how_many_calendar_lines( int month, int start_dow ) + { + switch (month) + { + case 4: + case 6: + case 9: + case 11: if (start_dow == 7) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: if (start_dow > 5) max_calendar_lines = 6; + else if (max_calendar_lines == 4) max_calendar_lines = 5; + break; + case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5; + break; + } + } + + /********************************************************* + * Preliminaries: + * - Find the first sunday(s) of each calendar + * - Find number of calendar lines + *********************************************************/ + hdate_set_gdate (&h, 1, current_month, current_year); + jd_current_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * three months, side-by-side + *********************************************************/ + if (opt.three_month) + { + /********************************************************* + * previous month + *********************************************************/ + if (current_month == 1) + { + previous_month = 12; + previous_year = current_year - 1; + } + else + { + previous_month = current_month - 1; + previous_year = current_year; + } + hdate_set_gdate (&h, 1, previous_month, previous_year); + jd_previous_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + + /********************************************************* + * next month + *********************************************************/ + if (current_month == 12) + { + next_month = 1; + next_year = current_year + 1; + } + else + { + next_month = current_month + 1; + next_year = current_year; + } + hdate_set_gdate (&h, 1, next_month, next_year); + jd_next_month = h.hd_jd - h.hd_dw + 1; + how_many_calendar_lines( h.gd_mon, h.hd_dw ); + } + + + + /************************************************** + * maximum six lines of calendar + **************************************************/ + for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++) + { + if (opt.html) printf ("\n"); + + if (opt.three_month) + { + print_week(jd_previous_month, previous_month, opt); + jd_previous_month = jd_previous_month + 7; + printf(" "); + } + + print_week(jd_current_month, current_month, opt); + jd_current_month = jd_current_month + 7; + + + if (opt.three_month) + { + printf(" "); + print_week(jd_next_month, next_month, opt); + jd_next_month = jd_next_month + 7; + } + + if (opt.html) printf ("\n"); + else printf ("\n"); + } + + + /************************************************** + * print end of calendar + *************************************************/ + if (opt.html) printf ("
%3s
"); + else if (h.hd_dw == SHABBAT) printf (""); + else if (holiday_type) printf (""); + else printf (""); + + /* Print a day */ + hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew); + printf ("\n\ +", + h.gd_day, + hd_day_str, + hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew)); + if (holiday_type) printf ("", + hdate_string( HDATE_STRING_HOLIDAY, + hdate_get_holyday (&h, opt.diaspora), + HDATE_STRING_SHORT, HDATE_STRING_LOCAL) + ); + else printf (""); + + printf ("
%2d%3s %s
 
%s
 
\n
"); + + return 0; +} + + + + + + +/**************************************************** +* print month header, month table, month footnotes +****************************************************/ +int print_month ( const int month, const int year, const option_list opt) +{ + hdate_struct h; + + // following are for opt.footnote + int jd_counter, holiday; + //char *language; // for forcing Hebrew printing of footnote + + + /* check if hebrew year (year > 3000) */ + if (year > 3000) hdate_set_hdate (&h, 1, month, year); + else hdate_set_gdate (&h, 1, month, year); + + + print_header (h.gd_mon, h.gd_year, opt); + print_calendar (h.gd_mon, h.gd_year, opt); + printf("\n"); + + + /**************************************************** + * print footnotes + ****************************************************/ + if (opt.footnote) + { + jd_counter = h.hd_jd; + while ( month == h.gd_mon ) + { + holiday = hdate_get_holyday(&h, opt.diaspora); + if (holiday) + { + print_day ( h, month, opt); + /*if (opt.force_hebrew) + { + // BUG - this isn't thread-safe + // --- and it may no longer be nexessary anywhere + // in the code now that I've embedded Hebrew + language=getenv("LANGUAGE"); + setenv("LANGUAGE", "he_IL.UTF-8", 1); + }*/ + if (opt.colorize) + { + if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME); + else colorize_element(ELEMENT_HOLIDAY_NAME); + } + + if (opt.bidi) + { + char *holiday_str, *holiday_buffer; + size_t holiday_str_len; + holiday_str = hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew); + + holiday_str_len = strlen(holiday_str); + holiday_buffer = malloc(holiday_str_len+1); + memcpy(holiday_buffer, holiday_str, holiday_str_len); + holiday_buffer[holiday_str_len] = '\0'; + revstr(holiday_buffer, holiday_str_len); + + // padding - FIXME - spaces are single-byte, while + // the Hebrew characters are two bytes + const int margin_max = 16; // 15 fails because of jabotinsky in july + printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer); + + free(holiday_buffer); + } + else printf (" %s\n", + hdate_string( HDATE_STRING_HOLIDAY, + holiday, + HDATE_STRING_LONG, + opt.force_hebrew)); + + if (opt.colorize) printf (CODE_RESTORE_VIDEO); + //if (opt.force_hebrew) setenv("LANGUAGE", language, 1); + } + jd_counter++; + hdate_set_jd (&h, jd_counter); + } + } + return 0; +} + + +/**************************************************** +* read and parse config file +****************************************************/ +void read_config_file( FILE *config_file, + option_list *opt, + double* latitude, + int* opt_latitude, + double* longitude, + int* opt_longitude, + int* tz ) + +{ + char *input_string; + size_t input_str_len = 100; // WARNING: if you change this value + // you will still have to also + // change a matching value below + // in the statement that includes: + // match_count = sscanf(input_string + char *input_key = ""; + char *input_value = ""; + int line_count = 0; + int menu_item = 0; + size_t menu_len = 0; + int match_count; + int end_of_input_file = FALSE; + int i; + const int num_of_keys = 20; + const char* key_list[] = { "SUNSET_AWARE", // 0 + "LATITUDE", + "LONGITUDE", // 2 + "TIMEZONE", + "DIASPORA", // 4 + "FORCE_ISRAEL", + "PARASHA_NAMES", // 6 + "SHABBAT_INFO", + "FOOTNOTES", // 8 + "FORCE_HEBREW", + "OUTPUT_BIDI", //10 + "SUPPRESS_REVERSE_VIDEO", + "COLORIZE", //12 + "OUTPUT_HTML", + "USE_EXTERNAL_CSS_FILE", + "QUIET_ALERTS", + "THREE_MONTH", //16 + "MENU", + "CANDLE_LIGHTING", //18 + "HAVDALAH" + }; + + input_string = malloc(input_str_len+1); + input_key = malloc(input_str_len+1); + input_value = malloc(input_str_len+1); + while ( end_of_input_file!=TRUE ) + { + end_of_input_file = getline(&input_string, &input_str_len, config_file); + if ( end_of_input_file!=TRUE ) + { + errno = 0; + // The '100' in the next statement is inelegant; it is meant to + // be the value of input_str_len. Alternatively, don't malloc + // input_value above, use the 'a' specifier here, and free(input_value) + // at the end of every successful read and evaluation + match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value); + line_count++; + if (errno != 0) error(0,errno,"scan error at line %d", line_count); +// DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s", +// line_count, match_count, input_key, input_value, input_string); + if (match_count ==2) + { + for (i=0; inot_sunset_aware = 1; + else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0; + break; + case 1: + parse_coordinate(1, input_value, latitude, opt_latitude); + break; + case 2: + parse_coordinate(2, input_value, longitude, opt_longitude); + break; + case 3: + parse_timezone(input_value, tz); + break; + case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1; + break; + case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1; + break; + case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1; + break; + case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->shabbat = 1; + opt->parasha = 1; + } + break; + case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1; + break; + case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1; + break; + case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->bidi = 1; + opt->force_hebrew = 1; + } + break; + case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1; + break; + case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1; + break; + case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->html = 1; + break; + case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1; + break; + case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1; + break; + case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1; + break; + +// MENU + case 17:if (menu_item < MAX_MENU_ITEMS) + { + menu_len = strlen(input_value); + opt->menu_item[menu_item] = malloc(menu_len+1); + memcpy(opt->menu_item[menu_item], input_value,menu_len); + menu_item++; + } + break; +// CANDLE_LIGHTING + case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(input_value); + if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES; + else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES; + } + break; + +// HAVDALAH + case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(input_value); + if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES; + else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES; + } + break; + + } // end of switch(i) + break; // if found a match don't continue for loop + } + } + } + } + } + free(input_string); + free(input_key); + free(input_value); + return; +} + + +/**************************************************** +* exit elegantly +****************************************************/ +void exit_main( option_list *opt, const int exit_code) +{ + int i; + for (i=0; imenu_item[i] == NULL) break; + free(opt->menu_item[i]); + } + exit (exit_code); +} + + +/**************************************************** +* parse a command-line or a config-file menu line +* +* It was appropriate to make this a function, outside +* of main, because of its dual use and dual reference +****************************************************/ +int hcal_parser( const int switch_arg, option_list *opt, + double *lat, int *opt_latitude, + double *lon, int *opt_Longitude, + int *tz, int long_option_index) + +{ + int error_detected = 0; + + switch (switch_arg) + { + + case 0: /* long options */ + switch (long_option_index) + { +/* --version */ case 0: print_version (); exit_main(opt, 0); break; +/* --help */ case 1: print_help (); exit_main(opt, 0); break; +/* --no-reverse */ case 2: opt->no_reverse = 1; break; +/* --html */ case 3: break; +/* --parasha */ case 4: break; +/* --shabbat */ case 5: break; +/* --three-month*/ case 6: break; +/* --colorize */ case 7: break; +/* --footnote */ case 8: break; +/* --hebrew */ case 9: break; +/* --israel */ case 10:break; +/* --latitude */ case 11:break; +/* --longitude */ case 12:break; +/* --timezone */ case 13:break; +/* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break; +/* --quiet-alerts*/ case 15: break; +/* --visual */ case 16: +/* --bidi */ case 17: break; +/* --one-month */ case 18: break; +/* --no-visual */ case 19: +/* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break; +/* --no-color */ case 21: opt->colorize = 0; break; +/* --no-footnote*/ case 22: opt->footnote = 0; break; +/* --menu */ case 23: break; +/* --candles */ case 24: + if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(optarg); + if ( (opt->candles >= MIN_CANDLES_MINUTES) && + (opt->candles <= MAX_CANDLES_MINUTES) ) break; + } + print_parm_error("--candles"); + error_detected++; + } + break; +/* --havdalah */ case 25: + if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(optarg); + if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) && + (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break; + } + print_parm_error("--havdalah"); + error_detected++; + } + break; + + } // end switch for long_options + break; + + + case '1': opt->three_month = 0; break; + case '3': opt->three_month = 1; break; + case 'b': opt->bidi = 1; opt->force_hebrew = 1; break; + case 'c': opt->colorize = 1; break; + case 'd': opt->diaspora = 1; break; + case 'f': opt->footnote = 1; break; + case 'h': opt->html = 1; break; + case 'H': opt->force_hebrew = 1; break; + case 'I': opt->force_israel = 1; break; + case 'i': opt->external_css = 1; break; + case 'm': opt->menu = 1; break; + case 'p': opt->parasha = 1; break; + case 'q': opt->quiet_alerts = 1; break; + case 'l': + error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude); + break; + case 'L': + error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude); + break; + case 's': + opt->shabbat = 1; + opt->parasha = 1; + if (opt->candles == 0) opt->candles = 1; + if (opt->havdalah == 0) opt->havdalah = 1; + break; + case 'z': + error_detected = error_detected + parse_timezone(optarg, tz); + break; + case '?': + // FIXME if (strchr(short_options,optopt)!=NULL) + print_parm_missing_error((char*) &optopt); + error_detected = TRUE; + break; + default: print_usage_hcal (); exit_main(opt, 0); break; + } + return error_detected; +} + +/************************************************** +*************************************************** +*************************************************** +* main +*************************************************** +*************************************************** +**************************************************/ +int main (int argc, char *argv[]) +{ + + /* date */ + int month, year; + + double lat = BAD_COORDINATE; /* set to this value for error handling */ + double lon = BAD_COORDINATE; /* set to this value for error handling */ + int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */ + + int opt_latitude = 0; /* -l option latitude */ + int opt_Longitude = 0; /* -L option longitude */ + + int error_detected = FALSE; /* exit after reporting ALL bad parms */ + + + option_list opt; + opt.bidi = 0; // visual bidi, implies --force-hebrew + opt.html = 0; // -h html format flag + opt.diaspora = 0; // -d Diaspora holidays + opt.external_css = 0; // -i External css file + opt.parasha = 0; // -p print parasha alongside calendar + opt.shabbat = 0; // -c print candle-lighting alongside calendar + opt.candles = 0; + opt.havdalah = 0; + opt.no_reverse = 0; // don't highlight today in reverse video + opt.three_month = 0; // print previous and next months also + opt.colorize = 0; // display calendar in muted, more pleasing tones + opt.footnote = 0; // display description of month's holidays + opt.force_hebrew = 0; // force display of Hebrew data in Hebrew + opt.force_israel = 0; // override diaspora-awareness + opt.not_sunset_aware = 0; // override sunset-awareness + opt.quiet_alerts = 0; + + opt.lat = BAD_COORDINATE; + opt.lon = BAD_COORDINATE; + opt.tz = BAD_TIMEZONE; + + opt.menu = 0; // -m print menus for user-selection + int i; + for (i=0; i. + */ + +#define _GNU_SOURCE // For mempcpy, asprintf +#include // For hebrew date +//#include "../../src/hdate.h" +#include // For atoi, getenv, setenv +#include // For setlocale +#include // For getopt_long +#include // For strchr, mempcpy, asprintf + +#include "./local_functions.c" + +#define DATA_WAS_NOT_PRINTED 0 +#define DATA_WAS_PRINTED 1 + +// for opt.menu[MAX_MENU_ITEMS] +#define MAX_MENU_ITEMS 10 + + +char *debug_var; // system environment variable + +static char * sunrise_text = N_("sunrise"); +static char * sunset_text = N_("sunset"); +static char * first_light_text = N_("first_light"); +static char * talit_text = N_("talit"); +static char * midday_text = N_("midday"); +static char * first_stars_text = N_("first_stars"); +static char * three_stars_text = N_("three_stars"); +static char * sun_hour_text = N_("sun_hour"); +static char * candles_text = N_("candle-lighting"); +static char * havdalah_text = N_("havdalah"); + +typedef struct { + int hebrew; + int bidi; + int yom; + int leShabbat; + int leSeder; + int tablular_output; + int not_sunset_aware; + int print_tomorrow; + int quiet_alerts; + int sun; + int candles; + int havdalah; + int times; + int short_format; + int only_if_holiday; + int holidays; + int omer; + int only_if_parasha; + int parasha; + int julian; + int diaspora; + int iCal; + int menu; + char* menu_item[MAX_MENU_ITEMS]; + } option_list; + + +const char* hdate_config_file_text = N_("\ +# configuration file for hdate - Hebrew date information program\n\ +# part of package libhdate\n\ +#\n# Should you mangle this file and wish to restore its default content,\n\ +# rename or delete this file and run hdate; hdate will automatically\n\ +# regenerate the default content.\n#\n\ +# Your system administrator can set system-wide defaults for hcal by\n\ +# modifying file .\n\ +# You may override all defaults by changing the contents of this file.\n\ +#\n\ +# Version information\n\ +# This may be used by updates to hcal to determine how to parse the file\n\ +# and whether additional information and options should be appended to\n\ +# the end of this file.\n\ +VERSION=2.00\n\ +#\n\ +# Location awareness\n\ +# hdate wants to accurately highlight the current Hebrew day, including\n\ +# during the hours between sunset and secular midnight. If you don't\n\ +# provide it with latitude, longitude, and time zone information, hdate\n\ +# will try to guess the information, based upon your system timezone,\n\ +# and its (limited, and maybe biased) of the dominant Jewish community\n\ +# in that timezone. When hdate is forced to guess, it alerts the user\n\ +# with a message that includes the guessed location.\n\ +# hdate's guesses will also affect its default behaviour for ouput of\n\ +# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\ +#SUNSET_AWARE=TRUE\n\ +# LATITUDE and LONGITUDE may be in decimal format or in the form\n\ +# degrees[:minutes[:seconds]] with the characters :'\" as possible\n\ +# delimiters. Use negative values to indicate South and West, or\n\ +# use the abbreviated compass directions N, S, E, W.\n\ +#LATITUDE=\n\ +#LONGITUDE=\n\ +# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\ +# with the characters :'\" as possible delimiters.\n\ +#TIMEZONE=\n\n\ +# Output in hebrew characters\n\ +# hdate defaults to output all information in your default language, so\n\ +# if your default language is Hebrew, you're all set. Otherwise, you can\n\ +# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\ +# still outputting gregorian information in your default language. To\n\ +# output ALL information in Hebrew, run something like this:\n\ +# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n\ +# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\ +# output, you need to install a terminal font that includes the Hebrew\n\ +# character set (hint: unicode).\n\ +#FORCE_HEBREW=FALSE\n\n\ +# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\ +# Unfortunately, the world can not be depended upon to be either. Most\n\ +# Xwindow applications will display the data fine with FORCE_HEBREW; most\n\ +# xterm implementations will not. (in fact, the only xterm clone I know\n\ +# of that comes close is mlterm). If using FORCE_HEBREW results in\n\ +# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\ +# This will reverse the order of the Hebrew characters, so they will\n\ +# display 'visual'ly correct; however, such output will not be suitable\n\ +# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\ +# automatically forces hebrew.\n\ +#OUTPUT_BIDI=FALSE\n\n\ +# The Hebrew language output of Hebrew information can also be 'styled'\n\ +# in the following ways:\n\ +# option YOM ~> yom shishi, aleph tishrei ...\n\ +# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n\ +# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n\ +#YOM=FALSE\n\ +#LESHABBAT=FALSE\n\ +#LESEDER=FALSE\n\ +\n\ +#SUN_RISE_SET=FALSE\n\ +#TIMES_OF_DAY=FALSE\n\ +#SHORT_FORMAT=FALSE\n\ +#SEFIRAT_HAOMER=FALSE\n\ +#DIASPORA=FALSE\n\ +\n\ +\n\ +# Shabbat related\n\ +# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\ +# The command line options for these features are -r (--parasha), and\n\ +# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\ +# before sunset). The HAVDALAH field can accept a value of 20 - 90\n\ +# (minutes after sunset).\n\ +#PARASHA_NAMES=FALSE\n\ +#ONLY_IF_PARASHA_IS_READ=FALSE\n\ +#SHABBAT_INFO=FALSE\n\n\ +#CANDLE_LIGHTING=FALSE\n\ +#HAVDALAH=FALSE\n\n\ +# Holiday related\n\ +#HOLIDAYS=FALSE\n\ +#ONLY_IF_HOLIDAY=FALSE\n\n\ +# Tabular output\n\ +# This option has hdate output the information you request in a single\n\ +# comma-delimited line per day, suitable for piping or import to\n\ +# spreadsheet formatting applications, etc. To belabor the obvious,\n\ +# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n\ +# The command line option for this feature is, um, --table\n\ +#TABULAR=FALSE\n\n\ +# iCal format\n\ +# hdate can output its information in iCal-compatable format\n\ +# ICAL=FALSE\n\ +# Suppress alerts and warnings\n\ +# hdate alerts the user via STDERR when it guesses the user's location.\n\ +#QUIET_ALERTS=FALSE\n\n\ +# Julian day number\n\ +# The Julian day number is a .... See ... for more details.\n\ +# setting the option JULIAN_DAY will have hdate output that number in\n\ +# the format JDN-nnnnnnn at the beginning of its first line of output.\n\ +#JULIAN_DAY=FALSE\n\n\ +# User-defined menus\n\ +# You may specify here command-line strings to optionally be parsed\n\ +# by hcal at execution time. To do so, use the command line option -m\n\ +# (--menu). hcal will process first the settings of this config file,\n\ +# then the other settings of your command line, and then will prompt\n\ +# you for which menu item you would like to select. hcal will process\n\ +# your menu selection as if it were a new command line, further modifying\n\ +# all the prior settings.\n\ +# Only the first ten \"MENU=\" entries will be read. Each line will be\n\ +# truncated at one hundred characters\n\ +#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\ +#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n\ +#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n\ +#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\ +"); + + +/************************************************************ +* print version information +************************************************************/ +int print_version () +{ + printf ("%s\n" ,N_("hdate - display Hebrew date information\nversion 1.6")); + return 0; +} + +/************************************************************ +* print usage information +************************************************************/ +void print_usage_hdate () +{ + printf ("%s\n", +N_("Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n\ + hdate [options] [coordinates timezone] [julian_day]\n\n\ + coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n\ + -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\ + timezone: -z nn[( .nn | :mm )]\n\ +Try \'hdate --help\' for more information")); +} + + +/************************************************************ +* print help information +************************************************************/ +void print_help () +{ + print_usage_hdate(); + + printf ("%s\n", N_("hdate - display Hebrew date information\nOPTIONS:\n\ + -b --bidi prints hebrew in reverse (visual)\n\ + --visual\n\ + -c print Shabbat start/end times.\n\ + --candles modify default minhag of 20 minutes. (17hd_jd+(7-h->hd_dw)); + /* this return value is the reading number, + used to print parshiot */ + return hdate_get_parasha (&coming_Shabbat, opt_d); + } + + + +/************************************************************ +* print one date - both Gregorian and Hebrew +************************************************************/ +int print_date (hdate_struct * h, hdate_struct * tomorrow, option_list opt, double lat, double lon) +{ + char *motzash = ""; // prefix for Saturday night + char *eve_before = ""; // prefix if after sunset + char *for_day_of_g = ""; // Hebrew prefix for day of week + char *apostrophe = ""; // Hebrew suffix for day of week + char *bet_g = ""; // Hebrew prefix for Gregorian month + char *bet_h = ""; // Hebrew prefix for Hebrew month + char *psik_mark = ""; // --force-yom + char *for_day_of_h = ""; // --force-yom + char *for_week_of = ""; // --force-leshabbat --force-leseder + int is_parasha_read; + int h_dow_form = HDATE_STRING_SHORT; + + char *hday_int_str, *hyear_int_str; + hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + +/* +#ifdef ENABLE_NLS + locale = setlocale (LC_MESSAGES, NULL); + language = getenv ("LANGUAGE"); +#else + locale = NULL; + language = NULL; +#endif +*/ + + /************************************************************ + * preliminary - if it's after sunset, it's tomorrow already + * but we will only acknowledge this if printing in the long + * format (which is the default) + ************************************************************/ + if (opt.print_tomorrow) + { + if (opt.hebrew) + { + if (h->hd_dw==7) motzash = "מוצ\"ש, "; + if (h->hd_dw==6) eve_before = "ליל"; + else eve_before = "אור ל"; + if (!opt.yom) for_day_of_h="-"; + } + else eve_before = N_("eve of "); + } + + + /************************************************************ + * preliminary - prepare Hebrew prefixes if forcing any Hebrew + ************************************************************/ + if (opt.hebrew) + { + bet_h="ב"; + /* preliminary - prepare Yom prefix */ + if (opt.yom) + { + if ( !((opt.print_tomorrow) && (h->hd_dw==6))) for_day_of_h="יום"; + if ( ((h->hd_dw!=7) || ((h->hd_dw==7) && (opt.print_tomorrow))) && + ( !((opt.print_tomorrow) && (h->hd_dw==6))) ) apostrophe = "'"; + if ((h->hd_dw==6) && (opt.print_tomorrow)) h_dow_form = HDATE_STRING_LONG; + psik_mark=","; + + if (opt.leShabbat) + { + if (h->hd_dw==7) for_week_of="פרשת"; + else for_week_of="לשבת"; + } + else if (opt.leSeder) for_week_of="לסדר"; + } + } + + /************************************************************ + * preliminary - prepare the Hebrew prefixes + * for the Gregorian month and day of week + ************************************************************/ + if (hdate_is_hebrew_locale()) + { bet_g="ב"; for_day_of_g="יום ";} + + + + /************************************************************ + * Three major print formats: iCal, short, long + ************************************************************/ + + + /************************************************************ + * iCal format + ************************************************************/ + if (opt.iCal) + { + printf ("%s%s %s%s ", for_day_of_g, hday_int_str, bet_h, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew)); + + printf ("%s", hyear_int_str); + } + + + /************************************************************ + * short format + ************************************************************/ + else if (opt.short_format) + { + printf ("%d.%d.%d ", h->gd_day, h->gd_mon, h->gd_year); + + + if (!hdate_is_hebrew_locale() && (!opt.hebrew)) + { + printf ("%d", h->hd_day); + } + else + { + printf ("%s", hday_int_str); + } + + printf (" %s %s\n", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_int_str); + } + + + /************************************************************ + * long (normal) format + ************************************************************/ + else + { + /************************************************************ + * Gregorian date - the easy part + ************************************************************/ + printf ("%s%s, %d %s%s %d, ", + for_day_of_g, + hdate_string( HDATE_STRING_DOW, h->hd_dw, opt.short_format, HDATE_STRING_LOCAL), + h->gd_day, + bet_g, + hdate_string( HDATE_STRING_GMONTH, h->gd_mon, opt.short_format, HDATE_STRING_LOCAL), + h->gd_year); + + + /************************************************************ + * Start of the Hebrew date + ************************************************************/ + if (opt.print_tomorrow) *h = *tomorrow; + + + /************************************************************ + * All these definitions were backports to enable bidi + ************************************************************/ + char *hebrew_buffer, *hebrew_buffer1, *hebrew_buffer2, *hebrew_buffer3, *hebrew_buffer4, *hebrew_buffer_next; + size_t hebrew_buffer_len = 0; + size_t hebrew_buffer1_len = 0; + size_t hebrew_buffer2_len = 0; + size_t hebrew_buffer3_len = 0; + size_t hebrew_buffer4_len = 0; + + + /************************************************************ + * prepare buffers with Hebrew day of week, including + * possibly Shabbat name + ************************************************************/ + if (opt.hebrew) + { + if (opt.yom) + { + hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s%s%s %s%s", motzash, eve_before, for_day_of_h, + hdate_string( HDATE_STRING_DOW, h->hd_dw, h_dow_form, opt.hebrew), apostrophe); + if ((opt.leShabbat) || (opt.leSeder)) + { + is_parasha_read = find_shabbat(h, opt.diaspora); + if (is_parasha_read) + hebrew_buffer2_len = asprintf(&hebrew_buffer2, " %s %s", for_week_of, + hdate_string( HDATE_STRING_PARASHA, is_parasha_read, opt.short_format, opt.hebrew) + ); + } + hebrew_buffer3_len = asprintf (&hebrew_buffer3, "%s ", psik_mark); + } + } + else hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s", eve_before); + + + hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + /************************************************************ + * prepare buffers with Hebrew dd mmmm yyyy + ************************************************************/ + hebrew_buffer4_len = + asprintf (&hebrew_buffer4, "%s %s%s %s", + hday_int_str, + bet_h, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_int_str); + + /************************************************************ + * prepare another GrUB - grand unified buffer + ************************************************************/ + hebrew_buffer_len = hebrew_buffer1_len + hebrew_buffer2_len + hebrew_buffer3_len + hebrew_buffer4_len; + hebrew_buffer = malloc(hebrew_buffer_len+1); + + hebrew_buffer_next = mempcpy(hebrew_buffer, hebrew_buffer1, hebrew_buffer1_len); + if (hebrew_buffer2_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer2, hebrew_buffer2_len); + if (hebrew_buffer3_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer3, hebrew_buffer3_len); + hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer4, hebrew_buffer4_len); + hebrew_buffer[hebrew_buffer_len]='\0'; + /************************************************************ + * bidi support (what all the buffering was for) + ************************************************************/ + if (opt.bidi) revstr(hebrew_buffer, hebrew_buffer_len); + + /************************************************************ + * Finally. print the information + ************************************************************/ + printf ("%s\n", hebrew_buffer); + + /************************************************************ + * CLEANUP - free allocated memory + ************************************************************/ + if (hebrew_buffer1_len > 0) free(hebrew_buffer1); + if (hebrew_buffer2_len > 0) free(hebrew_buffer2); + if (hebrew_buffer3_len > 0) free(hebrew_buffer3); + free(hebrew_buffer4); + free(hebrew_buffer); + } + + + /************************************************************ + * CLEANUP - free allocated memory + ************************************************************/ + if (hday_int_str != NULL) free(hday_int_str); + if (hyear_int_str != NULL) free(hyear_int_str); + + return 0; +} + + + +/************************************************************ +* option 's' - sunrise/set times +************************************************************/ +int +print_sunrise (hdate_struct * h, double lat, double lon, int tz, int opt_i) +{ + int sunrise, sunset; + + /* get times */ + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + print_astronomical_time( sunrise_text, sunrise, tz); + print_astronomical_time( sunset_text, sunset, tz); + + return DATA_WAS_PRINTED; +} + + + +/************************************************************ +* option 't' - day times +************************************************************/ +int print_times (hdate_struct * h, double lat, double lon, int tz, int opt_i) +{ + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + + /* get times */ + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sun_hour, &first_light, &talit, &sunrise, + &midday, &sunset, &first_stars, &three_stars); + + print_astronomical_time( first_light_text, first_light, tz); + print_astronomical_time( talit_text, talit, tz); + print_astronomical_time( sunrise_text, sunrise, tz); + print_astronomical_time( midday_text, midday, tz); + print_astronomical_time( sunset_text, sunset, tz); + print_astronomical_time( first_stars_text, first_stars, tz); + print_astronomical_time( three_stars_text, three_stars, tz); + printf("%s: %02d:%02d\n",N_("sun_hour"), sun_hour/60, sun_hour%60); + + return DATA_WAS_PRINTED; +} + + + +/************************************************************ +* option 'h' - holiday identification +************************************************************/ +/* int print_holiday (hdate_struct * h, int opt.diaspora, int short_format, int opt_i) +{ + int holiday; + + holiday = hdate_get_holyday (h, opt.diaspora); + if (holiday) + { + printf ("%s\n", hdate_string (holiday, short_format)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} +*/ + +/************************************************************ +* option 'o' - sefirat ha'omer +************************************************************/ +int print_omer (hdate_struct * h, int const short_form, int const hebrew_form) +{ + int omer_day; + + omer_day = hdate_get_omer_day(h); + if (omer_day != 0) + { + printf ("%s %s \n", N_("today is day"), hdate_string(HDATE_STRING_OMER, omer_day, short_form, hebrew_form)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} + + + +/************************************************************ +* option 'r' - parashat hashavua +************************************************************/ +/* int print_reading (hdate_struct * h, int opt.diaspora, int short_format, int opt_i) +{ + int reading; + + reading = hdate_get_parasha (h, opt.diaspora); + if (reading) + { + printf ("%s %s\n", N_("Parashat"), hdate_string (reading, short_format)); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} +*/ + + +/************************************************************ +* option 'c' - candle-lighting time; tzeit Shabbat +************************************************************/ +int print_candles (hdate_struct * h, double lat, double lon, int tz, option_list opt) +{ + int sun_hour, first_light, talit, sunrise; + int midday, sunset, first_stars, three_stars; + + // check for friday - print knisat shabat + if ( (h->hd_dw == 6) && (opt.candles) ) + { + // get times + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + + // FIXME - allow for further minhag variation + if (opt.candles != 1) sunset = sunset - opt.candles; + else sunset = sunset - DEFAULT_CANDLES_MINUTES; + + // print candlelighting times + print_astronomical_time( candles_text, sunset, tz); + return DATA_WAS_PRINTED; + } + + // check for saturday - print motzay shabat + else if ( (h->hd_dw == 7) && (opt.havdalah) ) + { + // get times + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, + lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + + // FIXME - allow for further minhag variation + if (opt.havdalah != 1) three_stars = sunset + opt.havdalah; + + // print motzay shabat + print_astronomical_time( havdalah_text, three_stars, tz); + return DATA_WAS_PRINTED; + } + else return DATA_WAS_NOT_PRINTED; +} + +/************************************************************ +* print tabular header +************************************************************/ +void print_tabular_header( option_list opt) +{ + printf("%s,%s",N_("Gregorian date"), N_("Hebrew Date")); + if (opt.times) printf(",%s,%s,%s,%s,%s,%s,%s,%s",first_light_text,talit_text,sunrise_text,midday_text,sunset_text,first_stars_text,three_stars_text,sun_hour_text ); + else if (opt.sun) printf(",%s,%s",sunrise_text,sunset_text); + if (opt.candles) printf(",%s", candles_text); + if (opt.havdalah) printf(",%s", havdalah_text); + if (opt.holidays) printf(",%s",N_("holiday")); + if (opt.omer) printf(",%s",N_("omer count")); + if (opt.parasha) printf(",%s",N_("parashat")); + printf("\n"); +return; +} + +/************************************************************ +* print one day - tabular output * +************************************************************/ +int print_tabular_day (hdate_struct * h, option_list opt, + double lat, double lon, int tz) +{ + int sun_hour = -1; + int first_light = -1; + int talit = -1; + int sunrise = -1; + int midday = -1; + int sunset = -1; + int first_stars = -1; + int three_stars = -1; + + hdate_struct tomorrow; + int data_printed = 0; + + int parasha = 0; + int holiday = 0; + int omer_day = 0; + + char *hday_str = NULL; + char *hyear_str = NULL; + + // for bidi (revstr) + char *hebrew_buffer = NULL; + size_t hebrew_buffer_len = 0; + + /************************************************************ + * options -R, -H are restrictive filters, so if there is no + * parasha reading / holiday, print nothing. + ************************************************************/ + parasha = hdate_get_parasha (h, opt.diaspora); + holiday = hdate_get_holyday (h, opt.diaspora); + if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday) + return 0; + if (opt.only_if_parasha && !opt.only_if_holiday && !parasha) + return 0; + if (opt.only_if_holiday && !opt.only_if_parasha && !holiday) + return 0; + + + + /************************************************************ + * print Gregorian date + ************************************************************/ + printf ("%d.%d.%d,", h->gd_day, h->gd_mon, h->gd_year); + + + /************************************************************ + * begin - print Hebrew date + ************************************************************/ + + // BUG - looks like a bug - why sunset awareness in tabular output? + if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1); + + if (opt.bidi) + { + hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew); + hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew); + hebrew_buffer_len = + asprintf (&hebrew_buffer, "%s %s %s", + hday_str, + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew), + hyear_str); + revstr(hebrew_buffer, hebrew_buffer_len); + printf ("%s", hebrew_buffer); + if (hebrew_buffer != NULL) free(hebrew_buffer); + } + else + { + // review sometime whether both checks are still necessary (see below for hyear) + //if ((!hdate_is_hebrew_locale()) && (!opt.hebrew)) + //{ /* non hebrew numbers */ + // printf ("%d", h->hd_day); + //} + //else /* Hebrew */ + //{ + hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,opt.hebrew); + printf ("%s", hday_str); + //} + + printf (" %s ", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, opt.hebrew)); + + hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,opt.hebrew); + printf ("%s", hyear_str); + } + if (hday_str != NULL) free(hday_str); + if (hyear_str != NULL) free(hyear_str); + /************************************************************ + * end - print Hebrew date + ************************************************************/ + + + if (opt.times) + { + /* get astronomical times */ + hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sun_hour, &first_light, &talit, &sunrise, + &midday, &sunset, &first_stars, &three_stars); + /* print astronomical times */ + print_astronomical_time_tabular( first_light, tz); + print_astronomical_time_tabular( talit, tz); + print_astronomical_time_tabular( sunrise, tz); + print_astronomical_time_tabular( midday, tz); + print_astronomical_time_tabular( sunset, tz); + print_astronomical_time_tabular( first_stars, tz); + print_astronomical_time_tabular( three_stars, tz); + printf(",%02d:%02d",sun_hour/60, sun_hour%60); + } + else if (opt.sun) + { + hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon, + &sunrise, &sunset); + print_astronomical_time_tabular( sunrise, tz); + print_astronomical_time_tabular( sunset, tz); + } + + if (opt.candles) + { + if ( (h->hd_dw != 6) && (!opt.only_if_parasha) ) sunset = -1; //printf(","); + else + { + if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon, + h->gd_year, lat, lon, &sunrise, &sunset); + if (opt.candles != 1) sunset = sunset - opt.candles; + else sunset = sunset- DEFAULT_CANDLES_MINUTES; + } + print_astronomical_time_tabular( sunset, tz); + } + + if (opt.havdalah) + { + if ( (h->hd_dw != 7) && (!opt.only_if_parasha) ) three_stars = -1; //printf(","); + else + { + if (opt.havdalah != 1) + { + if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon, + h->gd_year, lat, lon, &sunrise, &sunset); + three_stars = sunset + opt.havdalah; + } + else + { + if(three_stars == -1) hdate_get_utc_sun_time_full ( + h->gd_day, h->gd_mon, h->gd_year, lat, + lon, &sun_hour, &first_light, &talit, + &sunrise, &midday, &sunset, + &first_stars, &three_stars); + } + } + print_astronomical_time_tabular( three_stars, tz); + } + + if (opt.holidays && holiday) + printf (",%s", + hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew)); + + if (opt.omer) + { + omer_day = hdate_get_omer_day(h); + if (omer_day != 0) printf (",%d", omer_day); + } + + if (opt.parasha && parasha) + { + if (!opt.bidi) printf (",%s", + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + else + { + hebrew_buffer_len = asprintf (&hebrew_buffer, "%s", + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + revstr(hebrew_buffer, hebrew_buffer_len); + printf (",%s", hebrew_buffer); + if (hebrew_buffer != NULL) free(hebrew_buffer); + } + } + printf("\n"); + + if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset(); + + return 0; +} + + + + +/************************************************************ +* print one day - regular output +************************************************************/ +int print_day (hdate_struct * h, option_list opt, + double lat, double lon, int tz) +{ + + time_t t; + hdate_struct tomorrow; + + int iCal_uid_counter = 0; + int data_printed = 0; + int parasha = 0; + int holiday = 0; + + + /************************************************************ + * options -R, -H are restrictive filters, so if there is no + * parasha reading / holiday, print nothing. + ************************************************************/ + parasha = hdate_get_parasha (h, opt.diaspora); + holiday = hdate_get_holyday (h, opt.diaspora); + if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday) + return 0; + if (opt.only_if_parasha && !opt.only_if_holiday && !parasha) + return 0; + if (opt.only_if_holiday && !opt.only_if_parasha && !holiday) + return 0; + + + /************************************************************ + * print the iCal event header + ************************************************************/ + if (opt.iCal) + { + printf ("BEGIN:VEVENT\n"); + printf ("UID:hdate-%ld-%d\n", time(&t), ++iCal_uid_counter); + printf ("DTSTART;VALUE=DATE:%04d%02d%02d\n", h->gd_year, + h->gd_mon, h->gd_day); + printf ("SUMMARY:"); + } + + + /************************************************************ + * print the Julian Day Number + ************************************************************/ + if (opt.julian) printf ("JDN-%d ", h->hd_jd); + + + /************************************************************ + * print the date + ************************************************************/ + if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1); + print_date (h, &tomorrow, opt, lat, lon); + + + + /************************************************************ + * begin - print additional information for day + ************************************************************/ + if (opt.print_tomorrow) *h = tomorrow; + if (opt.sun) data_printed = data_printed | print_sunrise (h, lat, lon, tz, opt.iCal); + if (opt.times) data_printed = data_printed | print_times (h, lat, lon, tz, opt.iCal); + if (opt.holidays && holiday) + { + printf ("%s\n", + hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew)); + data_printed = DATA_WAS_PRINTED; + } + if (opt.omer) data_printed = data_printed | print_omer (h, opt.short_format, opt.hebrew); + if (opt.parasha && parasha) + { + printf ("%s %s\n", N_("Parashat"), + hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew)); + data_printed = DATA_WAS_PRINTED; + } + if (opt.candles || opt.havdalah) data_printed = data_printed | print_candles (h, lat, lon, tz, opt); + if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset(); + /************************************************************ + * end - print additional information for day + ************************************************************/ + + + + + /************************************************************ + * print the iCal event footer + ************************************************************/ + if (opt.iCal) + { + printf ("\nCLASS:PUBLIC\n"); + printf ("DTEND;VALUE=DATE:%04d%02d%02d\n", h->gd_year, + h->gd_mon, h->gd_day); + printf ("CATEGORIES:Holidays\n"); + printf ("END:VEVENT\n"); + } + + return 0; +} + + + +/************************************************************ +* print one Gregorian month - tabular output +************************************************************/ +int print_tabular_gmonth( option_list opt, + double lat, double lon, int tz, int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_gdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month days */ + while (h.gd_mon == month) + { + print_tabular_day (&h, opt, lat, lon, tz); + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + + +/************************************************************ +* print one Gregorian month - regular output +************************************************************/ +int print_gmonth (option_list opt, double lat, double lon, int tz, + int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_gdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month header */ + if (!opt.iCal && !opt.short_format) + printf ("\n%s:\n", + hdate_string( HDATE_STRING_GMONTH, h.gd_mon, opt.short_format, HDATE_STRING_LOCAL)); + + /* print month days */ + while (h.gd_mon == month) + { + print_day (&h, opt, lat, lon, tz); + + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + + +/************************************************************ +* print one Hebrew month - tabular output * +************************************************************/ +int print_tabular_hmonth + ( option_list opt, double lat, double lon, int tz, + int month, int year) +{ + hdate_struct h; + int jd; + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + jd = h.hd_jd; + + /* print month days */ + while (h.gd_mon == month) + { + print_tabular_header( opt ); + print_tabular_day (&h, opt, lat, lon, tz); + jd++; + hdate_set_jd (&h, jd); + } + + return 0; +} + + +/************************************************************ +* print one Hebrew month - regular output +************************************************************/ +int print_hmonth (hdate_struct * h, option_list opt, + double lat, double lon, int tz, int month, int year) +{ + int jd; + + /* get date of month start */ + jd = h->hd_jd; + + /* print month header */ + if (!opt.iCal && !opt.short_format) + printf ("\n%s:\n", + hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew)); + + /* print month days */ + while (h->hd_mon == month) + { + print_day (h, opt, lat, lon, tz); + + jd++; + hdate_set_jd (h, jd); + } + return 0; +} + + + +/************************************************************ +* print one Gregorian year - tabular output * +************************************************************/ +int print_tabular_gyear + ( option_list opt, double lat, double lon, int tz, int year) +{ + int month = 1; + while (month < 13) + { + print_tabular_gmonth(opt, lat, lon, tz, month, year); + month++; + } + return 0; +} + + +/************************************************************ +* print one Hebrew year - tabular output * +************************************************************/ +int print_tabular_hyear + ( option_list opt, double lat, double lon, int tz, int year) +{ + hdate_struct h; + int month = 1; + + /* print year months */ + while (month < 13) + { + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_tabular_hmonth(opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_tabular_hmonth(opt, lat, lon, tz, 14, year); + } + else + { + print_tabular_hmonth(opt, lat, lon, tz, month, year); + } + month++; + } + return 0; +} + + + +/************************************************************ +* print one Gregorian year - regular output +************************************************************/ +int print_gyear (option_list opt, double lat, double lon, int tz, int year) +{ + + int month = 1; + + /* print year header */ + if (!opt.iCal && !opt.short_format) + printf ("%d:\n", year); + + /* print year months */ + while (month < 13) + { + print_gmonth ( opt, lat, lon, tz, month, year); + month++; + } + + return 0; +} + + + +/************************************************************ +* print one hebrew year - regular output +************************************************************/ +int print_hyear (option_list opt, double lat, double lon, int tz, int year) +{ + hdate_struct h; + int month = 1; + + char *h_int_str; + h_int_str = hdate_string(HDATE_STRING_INT, year,HDATE_STRING_LONG,opt.hebrew); + // FIXME - error check for NULL return value + + /* print year header */ + if (!opt.iCal && !opt.short_format) printf ("%s:\n", h_int_str); + + /* print year months */ + while (month < 13) + { + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_hmonth (&h, opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_hmonth (&h, opt, lat, lon, tz, 14, year); + } + else + { + print_hmonth (&h, opt, lat, lon, tz, month, year); + } + month++; + } + + return 0; +} + + + +/**************************************************** +* read and parse config file +****************************************************/ +void read_config_file( FILE *config_file, + option_list *opt, + double* latitude, + int* opt_latitude, + double* longitude, + int* opt_longitude, + int* tz ) +{ + char *input_string; + size_t input_str_len = 100; // WARNING: if you change this value + // you will still have to also + // change a matching value below + // in the statement that includes: + // match_count = sscanf(input_string + char *input_key = ""; + char *input_value = ""; + int menu_item = 0; + size_t menu_len = 0; + int line_count = 0; + int match_count; + int end_of_input_file = FALSE; + int i; + const int num_of_keys = 26; + const char* key_list[] = { "SUNSET_AWARE", // 0 + "LATITUDE", + "LONGITUDE", // 2 + "TIMEZONE", + "DIASPORA", // 4 + "FORCE_ISRAEL", + "PARASHA_NAMES", // 6 + "SHABBAT_INFO", + "FORCE_HEBREW", // 8 + "OUTPUT_BIDI", + "QUIET_ALERTS", //10 + "YOM", + "LESHABBAT", //12 + "LESEDER", + "TABULAR", //14 + "ICAL", + "SEFIRAT_HAOMER", //16 + "SHORT_FORMAT", + "TIMES_OF_DAY", //18 + "SUN_RISE_SET", + "ONLY_IF_PARASHA_IS_READ", + "ONLY_IF_HOLIDAY", + "JULIAN_DAY", //22 + "CANDLE_LIGHTING", + "HAVDALAH", //24 + "MENU" + }; + + input_string = malloc(input_str_len+1); + input_key = malloc(input_str_len+1); + input_value = malloc(input_str_len+1); + + while ( end_of_input_file != TRUE ) + { + end_of_input_file = getline(&input_string, &input_str_len, config_file); + if ( end_of_input_file != TRUE ) + { + errno = 0; + // The '100' in the next statement is inelegant; it is meant to + // be the value of input_str_len. Alternatively, don't malloc + // input_value above, use the 'a' specifier here, and free(input_value) + // at the end of every successful read and evaluation + match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value); + line_count++; + if (errno != 0) error(0,errno,"scan error at line %d", line_count); + if (match_count ==2) + { + for (i=0; inot_sunset_aware = 1; + else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0; + break; + +// LATITUDE + case 1: + parse_coordinate(1, input_value, latitude, opt_latitude); + break; + +// LONGITUDE + case 2: + parse_coordinate(2, input_value, longitude, opt_longitude); + break; + +// TIMEZONE + case 3: + parse_timezone(input_value, tz); + break; + +// DIASPORA + case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1; + break; + + +// case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0; +// else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1; + break; + +// PARASHA_NAMES + case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1; + break; + +// SHABBAT_INFO + case 7:if (strcmp(input_value,"FALSE") == 0) + { + // maybe not do anything if set FALSE + opt->candles = 0; + opt->havdalah = 0; + opt->parasha = 0; + } + else if (strcmp(input_value,"TRUE") == 0) + { + opt->candles = 1; + opt->havdalah = 1; + opt->parasha = 1; + } + break; + +// FORCE_HEBREW + case 8:if (strcmp(input_value,"FALSE") == 0) opt->hebrew = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->hebrew = 1; + break; + +// OUTPUT_BIDI + case 9:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->bidi = 1; + opt->hebrew = 1; + } + break; + +// QUIET_ALERTS + case 10:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1; + break; + +// YOM + case 11:if (strcmp(input_value,"FALSE") == 0) opt->yom = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// LESHABBAT + case 12:if (strcmp(input_value,"FALSE") == 0) opt->leShabbat = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->leShabbat = 1; + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// LESEDER + case 13:if (strcmp(input_value,"FALSE") == 0) opt->leSeder = 0; + else if (strcmp(input_value,"TRUE") == 0) + { + opt->leSeder = 1; + opt->yom = 1; + opt->hebrew = 1; + } + break; + +// TABULAR + case 14:if (strcmp(input_value,"FALSE") == 0) opt->tablular_output = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->tablular_output = 1; + break; + +// ICAL + case 15:if (strcmp(input_value,"FALSE") == 0) opt->iCal = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->iCal = 1; + break; + +// SEFIRAT_HAOMER + case 16:if (strcmp(input_value,"FALSE") == 0) opt->omer = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->omer = 1; + break; + +// SHORT_FORMAT + case 17:if (strcmp(input_value,"FALSE") == 0) opt->short_format = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->short_format = 1; + break; + +// TIMES_OF_DAY + case 18:if (strcmp(input_value,"FALSE") == 0) opt->times = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->times = 1; + break; + +// SUN_RISE_SET + case 19:if (strcmp(input_value,"FALSE") == 0) opt->sun = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->sun = 1; + break; + +// ONLY_IF_PARASHA_IS_READ + case 20:if (strcmp(input_value,"FALSE") == 0) opt->only_if_parasha = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->only_if_parasha = 1; + break; + +// ONLY_IF_HOLIDAY + case 21:if (strcmp(input_value,"FALSE") == 0) opt->only_if_holiday = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->only_if_holiday = 1; + break; + +// JULIAN_DAY + case 22:if (strcmp(input_value,"FALSE") == 0) opt->julian = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->julian = 1; + break; + +// CANDLE_LIGHTING + case 23:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(input_value); + if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES; + else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES; + } + break; + +// HAVDALAH + case 24:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0; + else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1; + else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(input_value); + if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES; + else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES; + } + break; + +// MENU + case 25:if (menu_item < MAX_MENU_ITEMS) + { + menu_len = strlen(input_value); + opt->menu_item[menu_item] = malloc(menu_len+1); + memcpy(opt->menu_item[menu_item], input_value,menu_len); + menu_item++; + } + break; + + } // end of switch(i) + break; // if found a match don't continue for loop + } + } + } + } + } + free(input_string); + free(input_key); + free(input_value); + return; +} + + +/**************************************************** +* exit elegantly +****************************************************/ +void exit_main( option_list *opt, int exit_code) +{ + int i; + for (i=0; imenu_item[i] == NULL) break; + free(opt->menu_item[i]); + } + exit (exit_code); +} + + + +/**************************************************** +* parse a command-line or a config-file menu line +* +* It was appropriate to make this a function, outside +* of main, because of its dual use and dual reference +****************************************************/ +int hdate_parser( int switch_arg, option_list *opt, + double *lat, int *opt_latitude, + double *lon, int *opt_Longitude, + int *tz, int long_option_index) +{ + int error_detected = 0; + + switch (switch_arg) + { + + case 0: /* long options */ + switch (long_option_index) + { +/* --version */ case 0: print_version (); exit_main(opt,0); break; +/* --help */ case 1: print_help (); exit_main(opt,0); break; +/* --hebrew */ case 2: opt->hebrew = 1; break; +/* --yom */ case 3: + opt->yom = 1; + opt->hebrew = 1; + break; +/* --leshabbat */ case 4: + opt->leShabbat = 1; + opt->yom = 1; + opt->hebrew = 1; + break; +/* --leseder */ case 5: + opt->leSeder = 1; + opt->yom = 1; + opt->hebrew = 1; + break; +/* --table */ case 6: break; +/* --not-sunset-aware */case 7: opt->not_sunset_aware = 1; break; +/* --quiet-alerts */ case 8: break; +/* --short-format */ case 9: break; +/* --parasha */ case 10:break; +/* --holidays */ case 11:break; +/* --shabbat-times */ case 12:break; +/* --sun */ case 13: +/* --sunset */ case 14: +/* --sunrise */ case 15:break; +/* --candle-lighting */ case 16: +/* --candles */ case 17: + if (optarg == NULL) opt->candles = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->candles = atoi(optarg); + if ( (opt->candles >= MIN_CANDLES_MINUTES) && + (opt->candles <= MAX_CANDLES_MINUTES) ) break; + } + print_parm_error("--candles"); // do not gettext! + error_detected++; + } + break; + +/* --havdalah */ case 18: + if (optarg == NULL) opt->havdalah = 1; + else + { + if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0) + { + opt->havdalah = atoi(optarg); + if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) && + (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break; + } + print_parm_error("--havdalah"); // do not gettext! + error_detected++; + } + break; + +/* --latitude */ case 19:break; +/* --longitude */ case 20:break; +/* --timezone */ case 21:break; +/* --bidi */ case 22: +/* --visual */ case 23:break; +/* --omer */ case 24:break; +/* --ical */ case 25:break; +/* --julian */ case 26:break; +/* --diaspora */ case 27:break; +/* --menu */ case 28:break; + + } // end switch for long_options + break; + + + case 'b': opt->bidi = 1; opt->hebrew = 1; break; + case 'c': if (opt->candles == 0) opt->candles = 1; + if (opt->havdalah == 0) opt->havdalah = 1; + break; + case 'd': opt->diaspora = 1; break; + case 'H': opt->only_if_holiday = 1; /* why no break? */ + /* it seems ok 'H' is used only to abort + a print, so it always needs 'h' set */ + case 'h': opt->holidays = 1; break; + case 'i': opt->iCal = 1; break; + case 'j': opt->julian = 1; break; + case 'q': opt->quiet_alerts = 1; break; + case 'm': opt->menu = 1; break; + case 'o': opt->omer = 1; break; + case 'R': opt->only_if_parasha = 1; + case 'r': opt->parasha = 1; break; + case 'S': opt->short_format = 1; break; + case 's': opt->sun = 1; break; + case 't': opt->times = 1; break; + case 'T': opt->tablular_output = 1; break; + case 'l': + error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude); + break; + case 'L': + error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude); + break; + case 'z': + error_detected = error_detected + parse_timezone(optarg, tz); + break; + case '?': +// if (strchr(short_options,optopt)==NULL) +// error(0,0,"option %c unknown",optopt); + print_parm_missing_error((char*) &optopt); + error_detected = TRUE; + break; + default: + print_usage_hdate (); exit_main(opt,0); break; + } + + return error_detected; +} + + + + + +/************************************************************ +************************************************************* +************************************************************* +* main function +************************************************************* +************************************************************* +************************************************************/ +int main (int argc, char *argv[]) +{ + + hdate_struct h; /* The Hebrew date */ + int c; + + int day; /* The Gregorian date */ + int month; + int year; + + double lat = BAD_COORDINATE; /* set to this value for error handling */ + double lon = BAD_COORDINATE; /* set to this value for error handling */ + int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */ + + int opt_latitude = 0; /* -l option latitude */ + int opt_Longitude = 0; /* -L option longitude */ + + int error_detected = FALSE; /* exit after reporting ALL bad parms */ + + + option_list opt; + opt.hebrew = 0; + opt.bidi = 0; + opt.yom = 0; + opt.leShabbat = 0; + opt.leSeder = 0; + opt.tablular_output = 0; + opt.not_sunset_aware = 0; + opt.quiet_alerts = 0; + opt.print_tomorrow = 0; /* This isn't a command line option; + It here to restrict sunset_aware to + single-day outputs */ + opt.sun = 0; /* -s option sunrise/set times */ + opt.candles = 0; + opt.havdalah = 0; + opt.times = 0; /* -t option print times of day */ + opt.short_format = 0; /* -S Short format flag */ + opt.holidays = 0; /* -h option holidays */ + opt.only_if_holiday = 0; /* -H option just holidays */ + opt.parasha = 0; /* -r option reading */ + opt.only_if_parasha = 0; /* -R option just reading */ + opt.julian = 0; /* -j option Julian day number */ + opt.diaspora = 0; /* -d option diaspora */ + opt.iCal = 0; /* -i option iCal */ + opt.omer = 0; /* -o option Sfirat Haomer */ + + opt.menu = 0; // -m print menus for user-selection + int i; + for (i=0; i 348021) + { + hdate_set_jd (&h, year); + + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_day(&h, opt, lat, lon, tz); + } + else + { + if (opt.iCal) print_ical_header (); + print_day (&h, opt, lat, lon, tz); + if (opt.iCal) print_ical_footer (); + } + } + + + /************************************************************ + * process entire Hebrew year + ************************************************************/ + else if (year > 3000) + { + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_hyear( opt, lat, lon, tz, year); + } + else + { + if (opt.iCal) print_ical_header (); + print_hyear ( opt, lat, lon, tz, year); + if (opt.iCal) print_ical_footer (); + } + } + /************************************************************ + * process entire Gregorian year + ************************************************************/ + else + { + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_gyear( opt, lat, lon, tz, year); + } + else + { + if (opt.iCal) print_ical_header (); + + print_gyear ( opt, lat, lon, tz, year); + + if (opt.iCal) print_ical_footer (); + } + + } + } + + + /************************************************************ + * parse input date - only month and year entered + ************************************************************/ + else if (argc == (optind + 2)) + { + + year = atoi (argv[optind + 1]); + month = atoi (argv[optind]); + + /* handle errors */ + if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); } + + + /************************************************************ + * process entire Hebrew month + ************************************************************/ + if (year > 3000) + { + /* begin bounds check for month */ + if ((month <= 0) || (month > 14)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + /* end bounds check for month */ + + + if (opt.tablular_output) + { + print_tabular_header( opt ); + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_tabular_hmonth ( opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_tabular_hmonth ( opt, lat, lon, tz, 14, year); + } + else + { + print_tabular_hmonth ( opt, lat, lon, tz, month, year); + } + } + else + { + if (opt.iCal) print_ical_header (); + + /* get date of month start */ + hdate_set_hdate (&h, 1, month, year); + + /* if leap year, print both Adar months */ + if (h.hd_size_of_year > 365 && month == 6) + { + hdate_set_hdate (&h, 1, 13, year); + print_hmonth (&h, opt, lat, lon, tz, 13, year); + hdate_set_hdate (&h, 1, 14, year); + print_hmonth (&h, opt, lat, lon, tz, 14, year); + } + else + { + print_hmonth (&h, opt, lat, lon, tz, month, year); + } + if (opt.iCal) + print_ical_footer (); + } + } + + /************************************************************ + * process entire Gregorian month + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_gmonth(opt, lat, lon, tz, month, year); + } + + else + { + if (opt.iCal)print_ical_header (); + + print_gmonth (opt, lat, lon, tz, month, year); + + if (opt.iCal) print_ical_footer (); + } + } + } + + + /************************************************************ + * parse input date - day, month and year entered + ************************************************************/ + else if (argc == (optind + 3)) + { + year = atoi (argv[optind + 2]); + month = atoi (argv[optind + 1]); + day = atoi (argv[optind]); + + /* handle error */ + if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); } + + + /************************************************************ + * get Hebrew date + ************************************************************/ + if (year > 3000) + { + /* begin bounds check for month */ + if ((month <= 0) || (month > 14)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + hdate_set_hdate (&h, 1, 1, year); + if ((h.hd_size_of_year <365) && (month >12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + /* end bounds check for month */ + + if ((day <= 0) || (day > 30) || + ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) || + (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) || + (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) ) + { print_parm_error(N_("day")); exit_main(&opt,0); } + + + hdate_set_hdate (&h, day, month, year); + } + + /************************************************************ + * get Gregorian date + ************************************************************/ + else + { + if ((month <= 0) || (month > 12)) + { print_parm_error(N_("month")); exit_main(&opt,0); } + if ((day <= 0) || + ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) || + ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) || + ((day > 29) && (month==2) && ((year%4)==0)) || + ((day > 28) && (month==2) && ((year%4)!=0)) + ) + { print_parm_error(N_("day")); exit_main(&opt,0); } + + hdate_set_gdate (&h, day, month, year); + } + + /************************************************************ + * process a single date + ************************************************************/ + if (opt.tablular_output) + { + print_tabular_header( opt ); + print_tabular_day(&h, opt, lat, lon, tz); + } + + else + { + if (opt.iCal) print_ical_header (); + print_day (&h, opt, lat, lon, tz); + + if (opt.iCal) print_ical_footer (); + } + } + + + /************************************************************ + * parse input date - too many fields were received + ************************************************************/ + else + { + error(0,0,"%s", N_("too many arguments; after options max is dd mm yyyy")); + exit_main(&opt,0); + } + + return 0; +} diff --git a/.pc/typos.patch/po/es_MX.po b/.pc/typos.patch/po/es_MX.po new file mode 100644 index 0000000..76e5107 --- /dev/null +++ b/.pc/typos.patch/po/es_MX.po @@ -0,0 +1,1311 @@ +# translation of libhdate.po to Spanish +# This file is distributed under the same license as the libhdate package. +# Copyright (C) 2005 Yaacov Zamir, Peled Esti +# Peled Esti , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: es_MX\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: 2005-03-07 12:44+0200\n" +"Last-Translator: Peled Esti \n" +"Language-Team: Spanish\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "Esther Peled " + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "Domingo" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "Lunes" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "Martes" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "Miercoles" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "Jueves" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "Viernes" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "Sabado" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "Dom" + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "Lun" + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "Mar" + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "Mier" + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "Jue" + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "Vier" + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "Sab" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "ninguno" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "Bereshit" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "Noaj" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "Lej-Lejá" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "Vaira" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "Jayei Sará" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +#, fuzzy +msgid "Toldot" +msgstr "Toldot" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +#, fuzzy +msgid "Vayetzei" +msgstr "Vayetzei" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +#, fuzzy +msgid "Vayishlach" +msgstr "Vayishalaj" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +#, fuzzy +msgid "Vayeshev" +msgstr "Vayeshev" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +#, fuzzy +msgid "Miketz" +msgstr "Miketz" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +#, fuzzy +msgid "Vayigash" +msgstr "Vayigash" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +#, fuzzy +msgid "Vayechi" +msgstr "Vayejí" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "Shemot" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "Vaerá" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "Bo" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "Beshalaj" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "Yitro" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "Mishpatim" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "Terumá" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "Tetzavé" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "Ki Tisá" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "Vayajel" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "Pekudei" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "Vayikrá" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "Tzav" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "Shemini" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "Tazría" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "Metzorá" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "Ajrei Mot" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "Kedoshim" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "Emor" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "Bejar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "Bejukotai" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "Bamidbar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +#, fuzzy +msgid "Nasso" +msgstr "Nasso" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "Beha'alotja" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "Shalaj" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "Koraj" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "Jukat" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "Balak" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "Pinjas" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "Matot" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "Masei" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "Devarim" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "Vaetjanan" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "Eikev" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "Re'é" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "Shoftim" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "Ki Teitzei" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "Ki Tavó" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "Nitzavim" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "Vayeilej" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "Ha'Azinu" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "Vezot Haberaja" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +#, fuzzy +msgid "Vayakhel-Pekudei" +msgstr "Vayakhel-Pekudei" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "Tazría-Metzora" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "Ajrei Mot-Kedoshim" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "Bejar-Bejukotai" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "Jukat-Balak" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "Matot-Masei" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +#, fuzzy +msgid "Nitzavim-Vayeilech" +msgstr "Nitzavim-Vayeilej" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "Tishrei" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "Jeshván" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "Kislev" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "Tevet" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +#, fuzzy +msgid "Sh'vat" +msgstr "Sh'vat" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "Adar" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "Nisan" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +#, fuzzy +msgid "Iyyar" +msgstr "Iyyar" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "Siván" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +#, fuzzy +msgid "Tammuz" +msgstr "Ayuno de Tammuz" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "Av" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "Elul" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "Adar I" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "Adar II" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "Enero" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "Febrero" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "Marzo" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "Abril" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "May" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "Junio" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "Julio" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "Agosto" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "Septiembre" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "Octubre" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "Noviembre" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "Diciembre" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "Ene" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "Feb" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "Mar" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "Abr" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "Jun" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "Jul" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "Ago" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "Sep" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "Oct" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "Nov" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "Dic" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "Rosh Hashana I" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "Rosh Hashana II" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "Ayuno de Gedaliah" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "Yom Kippur" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "Sukkot" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "Hol hamoed Sukkot" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "Hoshana raba" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "Simjat Torah" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "Januka" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +#, fuzzy +msgid "Asara B'Tevet" +msgstr "Asara B'Tevet" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "Tu B'Shvat" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +#, fuzzy +msgid "Ta'anit Esther" +msgstr "Ta'anit Esther" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "Purim" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "Shushan Purim" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "Pesaj" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "Jol hamoed Pesaj" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "Yom HaAtzma'ut" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "Lag B'Omer" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "Víspera de Shavuot" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "Shavuot" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "Ayuno de Tammuz" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "Tish'a B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "Tu B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "Día del Holocausto" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "Día del Recuerdo" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +#, fuzzy +msgid "Yom Yerushalayim" +msgstr "Yom Yerushalayim" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "Shemini Atzeret" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "Pesaj VII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "Pesaj VIII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "Shavuot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +#, fuzzy +msgid "Sukkot II" +msgstr "Sukkot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +#, fuzzy +msgid "Pesach II" +msgstr "Pesaj II" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +#, fuzzy +msgid "Erev Yom Kippur" +msgstr "Víspera de Yom Kippur" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" + +#~ msgid "Tamuz" +#~ msgstr "Tamuz" diff --git a/.pc/typos.patch/po/fr.po b/.pc/typos.patch/po/fr.po new file mode 100644 index 0000000..0b04627 --- /dev/null +++ b/.pc/typos.patch/po/fr.po @@ -0,0 +1,1295 @@ +# translation of libhdate.po to French +# This file is distributed under the same license as the libhdate package. +# Copyright (C) 2005 Yaacov Zamir +# Yaacov Zamir, 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: 2005-03-07 12:44+0200\n" +"Last-Translator: Yaacov Zamir\n" +"Language-Team: Franch\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "Yaacov Zamir" + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "Dimanche" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "Lundi" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "Mardi" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "Mercredi" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "Jeudi" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "Vendredi" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "Samedi" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "Dim" + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "Lun" + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "Mar" + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "Mer" + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "Jeu" + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "Ven" + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "Sam" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "nulle" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "Bereshit" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "Noach" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "Lech-Lecha" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "Vaira" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "Chayei Sará" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Toldot" +msgstr "Toldot" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayetzei" +msgstr "Vayetzei" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayishlach" +msgstr "Vayishlach" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayeshev" +msgstr "Vayeshev" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Miketz" +msgstr "Miketz" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayigash" +msgstr "Vayigash" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vayechi" +msgstr "Vayechí" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "Shemot" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "Vaerá" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "Bo" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "Beshalach" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "Yitro" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "Mishpatim" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "Terumá" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "Tetzavé" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "Ki Tisá" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "Vayakhel" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "Pekudei" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "Vayikrá" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "Tzav" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "Shemini" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "Tazría" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "Metzorá" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "Achrei Mot" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "Kedoshim" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "Emor" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "Bechar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "Bechukotai" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "Bamidbar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Nasso" +msgstr "Nasso" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "Beha'alotcha" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "Shalach" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "Korach" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "Chukat" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "Balak" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "Pinchas" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "Matot" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "Masei" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "Devarim" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "Vaetchanan" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "Eikev" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "Re'é" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "Shoftim" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "Ki Teitzei" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "Ki Tavó" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "Nitzavim" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "Vayeilech" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "Ha'Azinu" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "Vezot Haberacha" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Vayakhel-Pekudei" +msgstr "Vayakhel-Pekudei" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "Tazría-Metzora" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "Achrei Mot-Kedoshim" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "Bechar-Bechukotai" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "Chukat-Balak" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "Matot-Masei" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +msgid "Nitzavim-Vayeilech" +msgstr "Nitzavim-Vayeilech" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "Tishrei" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "Cheshván" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "Kislev" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "Tevet" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Sh'vat" +msgstr "Sh'vat" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "Adar" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "Nisan" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Iyyar" +msgstr "Iyyar" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "Siván" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +#, fuzzy +msgid "Tammuz" +msgstr "Tzom Tammuz" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "Av" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "Elul" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "Adar I" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "Adar II" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "Janvier" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "Février" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "Mars" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "Avril" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "mai" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "Juin" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "Juillet" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "Août" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "Septembre" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "Octobre" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "Novembre" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "Décembre" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "Jan" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "Fév" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "Mar" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "Avr" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "Juin" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "Juil" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "Août" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "Sep" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "Oct" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "Nov" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "Déc" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "Rosh Hashana I" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "Rosh Hashana II" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "Tzom Gedaliah" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "Yom Kippur" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "Sukkot" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "Hol hamoed Sukkot" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "Hoshana raba" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "Simchat Torah" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "Chanuka" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Asara B'Tevet" +msgstr "Asara B'Tevet" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "Tu B'Shvat" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Ta'anit Esther" +msgstr "Ta'anit Esther" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "Purim" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "Shushan Purim" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "Pesach" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "Chol hamoed Pesach" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "Yom HaAtzma'ut" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "Lag B'Omer" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "veille de Shavuot" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "Shavuot" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "Tzom Tammuz" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "Tish'a B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "Tu B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "Jour des Holocausto" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "Jour des Recuerdo" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +#, fuzzy +msgid "Yom Yerushalayim" +msgstr "Jour des Yerushalayim" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "Shemini Atzeret" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "Pesach VII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "Pesach VIII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "Shavuot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Sukkot II" +msgstr "Sukkot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Pesach II" +msgstr "Pesach II" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "Jour de famille" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "Jour commémoratif de Yitzhak Rabin" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "Jour commémoratif de Zeev Zhabotinsky" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +#, fuzzy +msgid "Erev Yom Kippur" +msgstr "veille de Yom Kippur" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "Jour commémoratif de Rabin" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "Jour commémoratif de Zhabotinsky" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" + +#~ msgid "Tamuz" +#~ msgstr "Tamuz" diff --git a/.pc/typos.patch/po/he.po b/.pc/typos.patch/po/he.po new file mode 100644 index 0000000..9b9b189 --- /dev/null +++ b/.pc/typos.patch/po/he.po @@ -0,0 +1,1289 @@ +# Hebrew translations for libhdate strings +# Copyright (C) 2011 Boruch baum +# This file is distributed under the same license as the PACKAGE package. +# Koby Zamir , 1994. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: 2010-10-26 16:11+0200\n" +"Last-Translator: Boruch Baum\n" +"Language-Team: LANGUAGE \n" +"Language: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "יעקב זמיר" + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "ראשון" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "שני" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "שלישי" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "רביעי" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "חמישי" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "שישי" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "שבת" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "א" + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "ב" + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "ג" + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "ד" + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "ה" + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "ו" + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "ש" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "חסר" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "בראשית" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "נח" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "לך לך" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "וירא" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "חיי שרה" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Toldot" +msgstr "תולדות" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayetzei" +msgstr "ויצא" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayishlach" +msgstr "וישלח" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayeshev" +msgstr "וישב" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Miketz" +msgstr "מקץ" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayigash" +msgstr "ויגש" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vayechi" +msgstr "ויחי" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "שמות" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "וארא" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "בא" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "בשלח" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "יתרו" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "משפטים" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "תרומה" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "תצווה" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "כי תשא" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "ויקהל" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "פקודי" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "ויקרא" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "צו" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "שמיני" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "תזריע" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "מצורע" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "אחרי מות" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "קדושים" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "אמור" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "בהר" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "בחוקותי" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "במדבר" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Nasso" +msgstr "נשא" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "בהעלותך" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "שלח" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "קרח" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "חוקת" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "בלק" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "פינחס" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "מטות" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "מסעי" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "דברים" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "ואתחנן" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "עקב" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "ראה" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "שופטים" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "כי תצא" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "כי תבוא" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "נצבים" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "וילך" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "האזינו" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "וזאת הברכה" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Vayakhel-Pekudei" +msgstr "ויקהל פקודי" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "תזריע מצורע" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "אחרי מות קדושים" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "בהר בחוקותי" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "חוקת בלק" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "מטות מסעי" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +msgid "Nitzavim-Vayeilech" +msgstr "נצבים וילך" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "תשרי" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "חשון" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "כסלו" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "טבת" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Sh'vat" +msgstr "שבט" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "אדר" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "ניסן" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Iyyar" +msgstr "אייר" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "סיון" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Tammuz" +msgstr "תמוז" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "אב" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "אלול" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "אדר א" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "אדר ב" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "ינואר" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "פברואר" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "מרץ" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "אפריל" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "מאי" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "יוני" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "יולי" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "אוגוסט" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "ספטמבר" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "אוקטובר" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "נובמבר" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "דצמבר" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "ינו" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "פבר" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "מרץ" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "אפר" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "יוני" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "יולי" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "אוג" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "ספט" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "אוקט" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "נוב" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "דצמ" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "א ראש השנה" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "ב ראש השנה" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "צום גדליה" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "יום כיפור" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "סוכות" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "חול המועד סוכות" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "הושענא רבה" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "שמחת תורה" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "חנוכה" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Asara B'Tevet" +msgstr "עשרה בטבת" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "ט\"ו בשבט" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Ta'anit Esther" +msgstr "תענית אסתר" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "פורים" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "שושן פורים" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "פסח" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "חול המועד פסח" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "יום העצמאות" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "ל\"ג בעומר" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "ערב שבועות" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "שבועות" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "י\"ז תמוז" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "תשעה באב" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "ט\"ו באב" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "יום השואה" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "יום הזכרון" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom Yerushalayim" +msgstr "יום ירושלים" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "שמיני עצרת" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "שביעי של פסח" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "אחרון של פסח" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "שני של שבועות" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Sukkot II" +msgstr "סוכות שני" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Pesach II" +msgstr "שני של פסח" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "יום המשפחה" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "יום הזכרון לחללי מלחמות ישראל שמקום קבורתם לא נודע" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "יום הזכרון ליצחק רבין" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "יום זאב זבוטינסקי" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +msgid "Erev Yom Kippur" +msgstr "ערב יום כיפור" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "יום הזכרון ליצחק רבין" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "יום זבוטינסקי" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "לספירת העומר" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" diff --git a/.pc/typos.patch/po/libhdate.pot b/.pc/typos.patch/po/libhdate.pot new file mode 100644 index 0000000..79807a3 --- /dev/null +++ b/.pc/typos.patch/po/libhdate.pot @@ -0,0 +1,1288 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: libhdate 1.6.02\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "" + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "" + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "" + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "" + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "" + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "" + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "" + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Toldot" +msgstr "" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayetzei" +msgstr "" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayishlach" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayeshev" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Miketz" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayigash" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vayechi" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Nasso" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Vayakhel-Pekudei" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +msgid "Nitzavim-Vayeilech" +msgstr "" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Sh'vat" +msgstr "" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Iyyar" +msgstr "" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Tammuz" +msgstr "" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Asara B'Tevet" +msgstr "" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Ta'anit Esther" +msgstr "" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom Yerushalayim" +msgstr "" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Sukkot II" +msgstr "" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Pesach II" +msgstr "" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +msgid "Erev Yom Kippur" +msgstr "" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" diff --git a/.pc/typos.patch/po/ru.po b/.pc/typos.patch/po/ru.po new file mode 100644 index 0000000..a7792e6 --- /dev/null +++ b/.pc/typos.patch/po/ru.po @@ -0,0 +1,1296 @@ +# translation of libhdate.pot to Russian +# This file is distributed under the same license as the libhdate package. +# Copyright (C) 2005 Boris Peterberg. +# Boris Peterberg, 2005. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ru\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: 2005-03-08 22:44-0200\n" +"Last-Translator: Boeis Peterberg\n" +"Language-Team: Russian\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "Борис Петербарг" + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "Воскресенье" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "Понедельник" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "Вторник" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "Среда" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "Четверг" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "Пятница" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "Суботта" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "Вс." + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "Пн." + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "Вт." + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "Ср." + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "Чт." + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "Пт." + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "Сб." + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "Нет" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "Ноах" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "Жизнь Сары" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Toldot" +msgstr "" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayetzei" +msgstr "" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayishlach" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayeshev" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Miketz" +msgstr "" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayigash" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vayechi" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Nasso" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Vayakhel-Pekudei" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +msgid "Nitzavim-Vayeilech" +msgstr "" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "Тишрэй" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "Хешван" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "Кислэв" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "Тэвэт" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Sh'vat" +msgstr "Шват" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "Адар" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "Нисан" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Iyyar" +msgstr "Ийар" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "Сиван" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +#, fuzzy +msgid "Tammuz" +msgstr "17 Тамуза" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "Ав" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "Элул" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "Адар 1" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "Адар 2" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "Январь" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "Февраль" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "Март" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "Апрель" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "Май" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "Июнь" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "Июль" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "Август" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "Сентябрь" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "Октябрь" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "Ноябрь" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "Декабрь" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "Янв" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "Фев" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "Мар" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "Апр" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "Июнь" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "Июль" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "Авг" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "Сен" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "Окт" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "Но" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "Дек" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "Рош-а-Шана I" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "Рош-а-Шана II" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "Цом гдаляа" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "Йом Кипур" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "Суккот I" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "Суккот" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "hoшана Раба" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "Симхат-Тора" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "Ханука" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Asara B'Tevet" +msgstr "Десятое Тевета" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "Ту би-Шват" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Ta'anit Esther" +msgstr "Танйт зстер" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "Пурим" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "Ш. Пурим" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "Пэсах I" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "Песах" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "День Независимости" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "Лаг ба-Омер" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "Шавуот" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "17 Тамуза" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "9 Ава" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "15-ое Ава" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "День Холокоста" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "День Памяти" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom Yerushalayim" +msgstr "День Йерусалима" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "Шмини-Ацерет" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "Песах VII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "Песах VIII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "Шавуот II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +#, fuzzy +msgid "Sukkot II" +msgstr "Суккот II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +#, fuzzy +msgid "Pesach II" +msgstr "Песах II" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +msgid "Erev Yom Kippur" +msgstr "" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" + +#~ msgid "Tamuz" +#~ msgstr "Тамуз" diff --git a/.pc/typos.patch/po/sv.po b/.pc/typos.patch/po/sv.po new file mode 100644 index 0000000..f485ab6 --- /dev/null +++ b/.pc/typos.patch/po/sv.po @@ -0,0 +1,1295 @@ +# Swedish translation of libhdate. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the libhdate package. +# Daniel Nylander , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: libhdate\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-23 07:07-0500\n" +"PO-Revision-Date: 2008-01-10 10:26+0100\n" +"Last-Translator: Patrik Nilsson , Daniel Nylander " +"\n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/hdate_strings.c:186 src/hdate_strings.c:190 +msgid "translator" +msgstr "Daniel Nylander, Patrik Nilsson" + +#: src/hdate_strings.c:248 +msgid "Sunday" +msgstr "Söndag" + +#: src/hdate_strings.c:248 +msgid "Monday" +msgstr "Måndag" + +#: src/hdate_strings.c:248 +msgid "Tuesday" +msgstr "Tisdag" + +#: src/hdate_strings.c:248 +msgid "Wednesday" +msgstr "Onsdag" + +#: src/hdate_strings.c:249 +msgid "Thursday" +msgstr "Torsdag" + +#: src/hdate_strings.c:249 +msgid "Friday" +msgstr "Fredag" + +#: src/hdate_strings.c:249 +msgid "Saturday" +msgstr "Lördag" + +#: src/hdate_strings.c:251 +msgid "Sun" +msgstr "Sön" + +#: src/hdate_strings.c:251 +msgid "Mon" +msgstr "Mån" + +#: src/hdate_strings.c:251 +msgid "Tue" +msgstr "Tis" + +#: src/hdate_strings.c:251 +msgid "Wed" +msgstr "Ons" + +#: src/hdate_strings.c:251 +msgid "Thu" +msgstr "Tor" + +#: src/hdate_strings.c:252 +msgid "Fri" +msgstr "Fre" + +#: src/hdate_strings.c:252 +msgid "Sat" +msgstr "Lör" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "none" +msgstr "ingen" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Bereshit" +msgstr "Bereshit" + +#: src/hdate_strings.c:265 src/hdate_strings.c:288 +msgid "Noach" +msgstr "Noach" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Lech-Lecha" +msgstr "Lech-Lecha" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Vayera" +msgstr "Vayera" + +#: src/hdate_strings.c:266 src/hdate_strings.c:289 +msgid "Chayei Sara" +msgstr "Chayei Sara" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Toldot" +msgstr "Toldot" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayetzei" +msgstr "Vayetzei" + +#: src/hdate_strings.c:267 src/hdate_strings.c:290 +msgid "Vayishlach" +msgstr "Vayishlach" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayeshev" +msgstr "Vayeshev" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Miketz" +msgstr "Miketz" + +#: src/hdate_strings.c:268 src/hdate_strings.c:291 +msgid "Vayigash" +msgstr "Vayigash" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vayechi" +msgstr "Vayechi" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Shemot" +msgstr "Shemot" + +#: src/hdate_strings.c:269 src/hdate_strings.c:292 +msgid "Vaera" +msgstr "Vaera" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Bo" +msgstr "Bo" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Beshalach" +msgstr "Beshalach" + +#: src/hdate_strings.c:270 src/hdate_strings.c:293 +msgid "Yitro" +msgstr "Yitro" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Mishpatim" +msgstr "Mishpatim" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Terumah" +msgstr "Terumah" + +#: src/hdate_strings.c:271 src/hdate_strings.c:294 +msgid "Tetzaveh" +msgstr "Tetzaveh" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Ki Tisa" +msgstr "Ki Tisa" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Vayakhel" +msgstr "Vayakhel" + +#: src/hdate_strings.c:272 src/hdate_strings.c:295 +msgid "Pekudei" +msgstr "Pekudei" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Vayikra" +msgstr "Vayikra" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Tzav" +msgstr "Tzav" + +#: src/hdate_strings.c:273 src/hdate_strings.c:296 +msgid "Shmini" +msgstr "Shmini" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Tazria" +msgstr "Tazria" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Metzora" +msgstr "Metzora" + +#: src/hdate_strings.c:274 src/hdate_strings.c:297 +msgid "Achrei Mot" +msgstr "Achrei Mot" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Kedoshim" +msgstr "Kedoshim" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Emor" +msgstr "Emor" + +#: src/hdate_strings.c:275 src/hdate_strings.c:298 +msgid "Behar" +msgstr "Behar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bechukotai" +msgstr "Bechukotai" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Bamidbar" +msgstr "Bamidbar" + +#: src/hdate_strings.c:276 src/hdate_strings.c:299 +msgid "Nasso" +msgstr "Nasso" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Beha'alotcha" +msgstr "Beha'alotcha" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Sh'lach" +msgstr "Sh'lach" + +#: src/hdate_strings.c:277 src/hdate_strings.c:300 +msgid "Korach" +msgstr "Korach" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Chukat" +msgstr "Chukat" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Balak" +msgstr "Balak" + +#: src/hdate_strings.c:278 src/hdate_strings.c:301 +msgid "Pinchas" +msgstr "Pinchas" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Matot" +msgstr "Matot" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Masei" +msgstr "Masei" + +#: src/hdate_strings.c:279 src/hdate_strings.c:302 +msgid "Devarim" +msgstr "Devarim" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Vaetchanan" +msgstr "Vaetchanan" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Eikev" +msgstr "Eikev" + +#: src/hdate_strings.c:280 src/hdate_strings.c:303 +msgid "Re'eh" +msgstr "Re'eh" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Shoftim" +msgstr "Shoftim" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Teitzei" +msgstr "Ki Teitzei" + +#: src/hdate_strings.c:281 src/hdate_strings.c:304 +msgid "Ki Tavo" +msgstr "Ki Tavo" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Nitzavim" +msgstr "Nitzavim" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Vayeilech" +msgstr "Vayeilech" + +#: src/hdate_strings.c:282 src/hdate_strings.c:305 +msgid "Ha'Azinu" +msgstr "Ha'Azinu" + +#: src/hdate_strings.c:283 src/hdate_strings.c:306 +msgid "Vezot Habracha" +msgstr "Vezot Habracha" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Vayakhel-Pekudei" +msgstr "Vayakhel-Pekudei" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Tazria-Metzora" +msgstr "Tazria-Metzora" + +#: src/hdate_strings.c:284 src/hdate_strings.c:307 +msgid "Achrei Mot-Kedoshim" +msgstr "Achrei Mot-Kedoshim" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Behar-Bechukotai" +msgstr "Behar-Bechukotai" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Chukat-Balak" +msgstr "Chukat-Balak" + +#: src/hdate_strings.c:285 src/hdate_strings.c:308 +msgid "Matot-Masei" +msgstr "Matot-Masei" + +#: src/hdate_strings.c:286 src/hdate_strings.c:309 +msgid "Nitzavim-Vayeilech" +msgstr "Nitzavim-Vayeilech" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tishrei" +msgstr "Tishrei" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Cheshvan" +msgstr "Cheshvan" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Kislev" +msgstr "Kislev" + +#: src/hdate_strings.c:364 src/hdate_strings.c:369 +msgid "Tevet" +msgstr "Tevet" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Sh'vat" +msgstr "Sh'vat" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Adar" +msgstr "Adar" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Nisan" +msgstr "Nisan" + +#: src/hdate_strings.c:365 src/hdate_strings.c:370 +msgid "Iyyar" +msgstr "Iyyar" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Sivan" +msgstr "Sivan" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +#, fuzzy +msgid "Tammuz" +msgstr "Tzom Tammuz" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Av" +msgstr "Av" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Elul" +msgstr "Elul" + +#: src/hdate_strings.c:366 src/hdate_strings.c:371 +msgid "Adar I" +msgstr "Adar I" + +#: src/hdate_strings.c:367 src/hdate_strings.c:372 +msgid "Adar II" +msgstr "Adar II" + +#: src/hdate_strings.c:384 +msgid "January" +msgstr "Januari" + +#: src/hdate_strings.c:384 +msgid "February" +msgstr "Februari" + +#: src/hdate_strings.c:384 +msgid "March" +msgstr "Mars" + +#: src/hdate_strings.c:385 +msgid "April" +msgstr "April" + +#: src/hdate_strings.c:385 src/hdate_strings.c:388 +msgid "May" +msgstr "Maj" + +#: src/hdate_strings.c:385 +msgid "June" +msgstr "Juni" + +#: src/hdate_strings.c:386 +msgid "July" +msgstr "Juli" + +#: src/hdate_strings.c:386 +msgid "August" +msgstr "Augusti" + +#: src/hdate_strings.c:386 +msgid "September" +msgstr "September" + +#: src/hdate_strings.c:387 +msgid "October" +msgstr "Oktober" + +#: src/hdate_strings.c:387 +msgid "November" +msgstr "November" + +#: src/hdate_strings.c:387 +msgid "December" +msgstr "December" + +#: src/hdate_strings.c:388 +msgid "Jan" +msgstr "Jan" + +#: src/hdate_strings.c:388 +msgid "Feb" +msgstr "Feb" + +#: src/hdate_strings.c:388 +msgid "Mar" +msgstr "Mar" + +#: src/hdate_strings.c:388 +msgid "Apr" +msgstr "Apr" + +#: src/hdate_strings.c:389 +msgid "Jun" +msgstr "Jun" + +#: src/hdate_strings.c:389 +msgid "Jul" +msgstr "Jul" + +#: src/hdate_strings.c:389 +msgid "Aug" +msgstr "Aug" + +#: src/hdate_strings.c:389 +msgid "Sep" +msgstr "Sep" + +#: src/hdate_strings.c:389 +msgid "Oct" +msgstr "Okt" + +#: src/hdate_strings.c:390 +msgid "Nov" +msgstr "Nov" + +#: src/hdate_strings.c:390 +msgid "Dec" +msgstr "Dec" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana I" +msgstr "Rosh Hashana I" + +#: src/hdate_strings.c:396 src/hdate_strings.c:416 +msgid "Rosh Hashana II" +msgstr "Rosh Hashana II" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Tzom Gedaliah" +msgstr "Tzom Gedaliah" + +#: src/hdate_strings.c:397 src/hdate_strings.c:417 +msgid "Yom Kippur" +msgstr "Yom Kippur" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Sukkot" +msgstr "Sukkot" + +#: src/hdate_strings.c:398 src/hdate_strings.c:418 +msgid "Hol hamoed Sukkot" +msgstr "Hol hamoed Sukkot" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Hoshana raba" +msgstr "Hoshana raba" + +#: src/hdate_strings.c:399 src/hdate_strings.c:419 +msgid "Simchat Torah" +msgstr "Simchat Torah" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Chanukah" +msgstr "Chanukah" + +#: src/hdate_strings.c:400 src/hdate_strings.c:420 +msgid "Asara B'Tevet" +msgstr "Asara B'Tevet" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Tu B'Shvat" +msgstr "Tu B'Shvat" + +#: src/hdate_strings.c:401 src/hdate_strings.c:421 +msgid "Ta'anit Esther" +msgstr "Ta'anit Esther" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Purim" +msgstr "Purim" + +#: src/hdate_strings.c:402 src/hdate_strings.c:422 +msgid "Shushan Purim" +msgstr "Shushan Purim" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Pesach" +msgstr "Pesach" + +#: src/hdate_strings.c:403 src/hdate_strings.c:423 +msgid "Hol hamoed Pesach" +msgstr "Hol hamoed Pesach" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Yom HaAtzma'ut" +msgstr "Yom HaAtzma'ut" + +#: src/hdate_strings.c:404 src/hdate_strings.c:424 +msgid "Lag B'Omer" +msgstr "Lag B'Omer" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Erev Shavuot" +msgstr "Erev Shavuot" + +#: src/hdate_strings.c:405 src/hdate_strings.c:425 +msgid "Shavuot" +msgstr "Shavuot" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tzom Tammuz" +msgstr "Tzom Tammuz" + +#: src/hdate_strings.c:406 src/hdate_strings.c:426 +msgid "Tish'a B'Av" +msgstr "Tish'a B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Tu B'Av" +msgstr "Tu B'Av" + +#: src/hdate_strings.c:407 src/hdate_strings.c:427 +msgid "Yom HaShoah" +msgstr "Yom HaShoah" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom HaZikaron" +msgstr "Yom HaZikaron" + +#: src/hdate_strings.c:408 src/hdate_strings.c:428 +msgid "Yom Yerushalayim" +msgstr "Yom Yerushalayim" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Shmini Atzeret" +msgstr "Shmini Atzeret" + +#: src/hdate_strings.c:409 src/hdate_strings.c:429 +msgid "Pesach VII" +msgstr "Pesach VII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Pesach VIII" +msgstr "Pesach VIII" + +#: src/hdate_strings.c:410 src/hdate_strings.c:430 +msgid "Shavuot II" +msgstr "Shavuot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Sukkot II" +msgstr "Sukkot II" + +#: src/hdate_strings.c:411 src/hdate_strings.c:431 +msgid "Pesach II" +msgstr "Pesach II" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Family Day" +msgstr "Familjedagen" + +#: src/hdate_strings.c:412 src/hdate_strings.c:432 +msgid "Memorial day for fallen whose place of burial is unknown" +msgstr "Minnesdag för de fallena vars gravplats är okänd" + +#: src/hdate_strings.c:413 +msgid "Yitzhak Rabin memorial day" +msgstr "Minnesdag för Yitzhak Rabin" + +#: src/hdate_strings.c:413 +msgid "Zeev Zhabotinsky day" +msgstr "Zeev Zhabotinksys dag" + +#: src/hdate_strings.c:414 src/hdate_strings.c:434 +#, fuzzy +msgid "Erev Yom Kippur" +msgstr "Erev Yom Kippur" + +#: src/hdate_strings.c:433 +msgid "Rabin memorial day" +msgstr "Minnesdag för Y. Rabin" + +#: src/hdate_strings.c:433 +msgid "Zhabotinsky day" +msgstr "Zhabotinksys dag" + +#: src/hdate_strings.c:514 +msgid "in the Omer" +msgstr "" + +#: examples/hcal/hcal.c:142 +msgid "" +"# configuration file for hcal - Hebrew calendar program\n" +"# part of package libhdate\n" +"#\n" +"# Should you mangle this file and wish to restore its default content,\n" +"# rename or delete this file and run hcal; hcal will automatically\n" +"# regenerate the default content.\n" +"#\n" +"# Your system administrator can set system-wide defaults for hcal by\n" +"# modifying file .\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"# Location awareness\n" +"# hcal wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hcal\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hcal is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Israel and the diaspora\n" +"# If hcal guesses that you're not in Israel, the DIASPORA option will be\n" +"# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n" +"# forces hcal to display calendar information for Israel, using hcal's\n" +"# default coordinates foe Israel, or coordinates that you provide that\n" +"# seem legitmately within Israel.\n" +"# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n" +"# Sukkot, set BOTH flags true in order to see holiday information for\n" +"# a non-resident vistor to Israel. The command line options for these\n" +"# features are --israel, -I, --diaspora, -d.\n" +"#FORCE_DIASPORA=FALSE;\n" +"#FORCE_ISRAEL=FALSE;\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -p (--parasha), and\n" +"# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 " +"(minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday identification\n" +"# hcal flags holidays by replacing the gregorian/Hebrew date separator\n" +"# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n" +"# will have hcal output after the month's calendar, a list of the month's\n" +"# holidays along with the days on which they occur.\n" +"#FOOTNOTE=FALSE\n" +"\n" +"# Output in hebrew characters\n" +"# hcal defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"# The command line option for FORCE_HEBREW is either --hebrew or -H\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# Display enhancements\n" +"# hcal defaults to display the current day in reverse video\n" +"# The command line option for this feature is --no-reverse\n" +"#SUPPRESS_REVERSE_VIDEO=FALSE;\n" +"# hcal can display its output \"calming, muted tones\". Note that piping\n" +"# colorized output may yield unexpected results.\n" +"#COLORIZE=FALSE\n" +"\n" +"# HTML OUTPUT\n" +"#OUTPUT_HTML=FALSE\n" +"#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n" +"\n" +"# Suppress alerts and warnings\n" +"# hcal alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Three month display\n" +"# hcal can display a previous, current and next month side-by-side. hcal\n" +"# can also display a calendar for an entire year in four rows of three\n" +"# months each. Note that this will display properly only if your console\n" +"# is set for at least 127 columns. Note also that setting this option to\n" +"# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n" +"#THREE_MONTH=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hcal.c:271 +msgid "" +"hcal - Hebrew calendar\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hcal.c:281 +msgid "" +"Usage: hcal [options] [coordinates timezone] ] [[month] year]\n" +" coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hcal --help' for more information" +msgstr "" + +#: examples/hcal/hcal.c:295 +msgid "" +"Hebrew calendar\n" +"OPTIONS:\n" +" -1 --one-month over-ride config file setting if you had set\n" +" option --three-month as a default there\n" +" -3 --three-month displays previous/next months\n" +" side by side. requires 127 columns\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" --no-bidi over-ride config file setting if you had set\n" +" --no-visual option -bidi as a default there\n" +" -c --colorize displays in calming, muted tones\n" +" --no-color over-ride a --colorize setting in your config file\n" +" -d --diaspora use diaspora reading and holidays.\n" +" -f --footnote print descriptive notes of holidays\n" +" --no-footnote over-ride a footnote setting in your config file\n" +" -h --html output in html format to stdout\n" +" -H --hebrew print hebrew information in Hebrew\n" +" -i use external css file \"./hcal.css\".\n" +" -I --israel override a diaspora default\n" +" --no-reverse do not highlight today's date\n" +" -m --menu prompt user-defined menu from config file\n" +" -p --parasha print week's parasha on each calendar row\n" +" -q --quiet-alerts suppress warning messages\n" +" -s --shabbat print Shabbat times and parshiot\n" +" --candles modify default minhag of 20 minutes. (17.\n" +"# You may override all defaults by changing the contents of this file.\n" +"#\n" +"# Version information\n" +"# This may be used by updates to hcal to determine how to parse the file\n" +"# and whether additional information and options should be appended to\n" +"# the end of this file.\n" +"VERSION=2.00\n" +"#\n" +"# Location awareness\n" +"# hdate wants to accurately highlight the current Hebrew day, including\n" +"# during the hours between sunset and secular midnight. If you don't\n" +"# provide it with latitude, longitude, and time zone information, hdate\n" +"# will try to guess the information, based upon your system timezone,\n" +"# and its (limited, and maybe biased) of the dominant Jewish community\n" +"# in that timezone. When hdate is forced to guess, it alerts the user\n" +"# with a message that includes the guessed location.\n" +"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" +"#SUNSET_AWARE=TRUE\n" +"# LATITUDE and LONGITUDE may be in decimal format or in the form\n" +"# degrees[:minutes[:seconds]] with the characters :'\" as possible\n" +"# delimiters. Use negative values to indicate South and West, or\n" +"# use the abbreviated compass directions N, S, E, W.\n" +"#LATITUDE=\n" +"#LONGITUDE=\n" +"# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n" +"# with the characters :'\" as possible delimiters.\n" +"#TIMEZONE=\n" +"\n" +"# Output in hebrew characters\n" +"# hdate defaults to output all information in your default language, so\n" +"# if your default language is Hebrew, you're all set. Otherwise, you can\n" +"# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n" +"# still outputting gregorian information in your default language. To\n" +"# output ALL information in Hebrew, run something like this:\n" +"# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n" +"# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n" +"# output, you need to install a terminal font that includes the Hebrew\n" +"# character set (hint: unicode).\n" +"#FORCE_HEBREW=FALSE\n" +"\n" +"# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n" +"# Unfortunately, the world can not be depended upon to be either. Most\n" +"# Xwindow applications will display the data fine with FORCE_HEBREW; most\n" +"# xterm implementations will not. (in fact, the only xterm clone I know\n" +"# of that comes close is mlterm). If using FORCE_HEBREW results in\n" +"# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n" +"# This will reverse the order of the Hebrew characters, so they will\n" +"# display 'visual'ly correct; however, such output will not be suitable\n" +"# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n" +"# automatically forces hebrew.\n" +"#OUTPUT_BIDI=FALSE\n" +"\n" +"# The Hebrew language output of Hebrew information can also be 'styled'\n" +"# in the following ways:\n" +"# option YOM ~> yom shishi, aleph tishrei ...\n" +"# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n" +"# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n" +"#YOM=FALSE\n" +"#LESHABBAT=FALSE\n" +"#LESEDER=FALSE\n" +"\n" +"#SUN_RISE_SET=FALSE\n" +"#TIMES_OF_DAY=FALSE\n" +"#SHORT_FORMAT=FALSE\n" +"#SEFIRAT_HAOMER=FALSE\n" +"#DIASPORA=FALSE\n" +"\n" +"\n" +"# Shabbat related\n" +"# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n" +"# The command line options for these features are -r (--parasha), and\n" +"# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n" +"# before sunset). The HAVDALAH field can accept a value of 20 - 90\n" +"# (minutes after sunset).\n" +"#PARASHA_NAMES=FALSE\n" +"#ONLY_IF_PARASHA_IS_READ=FALSE\n" +"#SHABBAT_INFO=FALSE\n" +"\n" +"#CANDLE_LIGHTING=FALSE\n" +"#HAVDALAH=FALSE\n" +"\n" +"# Holiday related\n" +"#HOLIDAYS=FALSE\n" +"#ONLY_IF_HOLIDAY=FALSE\n" +"\n" +"# Tabular output\n" +"# This option has hdate output the information you request in a single\n" +"# comma-delimited line per day, suitable for piping or import to\n" +"# spreadsheet formatting applications, etc. To belabor the obvious,\n" +"# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n" +"# The command line option for this feature is, um, --table\n" +"#TABULAR=FALSE\n" +"\n" +"# iCal format\n" +"# hdate can output its information in iCal-compatable format\n" +"# ICAL=FALSE\n" +"# Suppress alerts and warnings\n" +"# hdate alerts the user via STDERR when it guesses the user's location.\n" +"#QUIET_ALERTS=FALSE\n" +"\n" +"# Julian day number\n" +"# The Julian day number is a .... See ... for more details.\n" +"# setting the option JULIAN_DAY will have hdate output that number in\n" +"# the format JDN-nnnnnnn at the beginning of its first line of output.\n" +"#JULIAN_DAY=FALSE\n" +"\n" +"# User-defined menus\n" +"# You may specify here command-line strings to optionally be parsed\n" +"# by hcal at execution time. To do so, use the command line option -m\n" +"# (--menu). hcal will process first the settings of this config file,\n" +"# then the other settings of your command line, and then will prompt\n" +"# you for which menu item you would like to select. hcal will process\n" +"# your menu selection as if it were a new command line, further modifying\n" +"# all the prior settings.\n" +"# Only the first ten \"MENU=\" entries will be read. Each line will be\n" +"# truncated at one hundred characters\n" +"#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n" +"#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n" +"#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n" +"#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n" +msgstr "" + +#: examples/hcal/hdate.c:209 +msgid "" +"hdate - display Hebrew date information\n" +"version 1.6" +msgstr "" + +#: examples/hcal/hdate.c:219 +msgid "" +"Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n" +" hdate [options] [coordinates timezone] [julian_day]\n" +"\n" +" coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n" +" -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n" +" timezone: -z nn[( .nn | :mm )]\n" +"Try 'hdate --help' for more information" +msgstr "" + +#: examples/hcal/hdate.c:235 +msgid "" +"hdate - display Hebrew date information\n" +"OPTIONS:\n" +" -b --bidi prints hebrew in reverse (visual)\n" +" --visual\n" +" -c print Shabbat start/end times.\n" +" --candles modify default minhag of 20 minutes. (17 to continue" +msgstr "" + +#: examples/hcal/local_functions.c:928 +msgid "menu selection received was out of bounds" +msgstr "" + +#~ msgid "Tamuz" +#~ msgstr "Tamuz" diff --git a/.pc/typos.patch/src/hdate.h b/.pc/typos.patch/src/hdate.h new file mode 100644 index 0000000..9d2816c --- /dev/null +++ b/.pc/typos.patch/src/hdate.h @@ -0,0 +1,719 @@ +/* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net + * + * Copyright (C) 2011-2012 Boruch Baum + * 2004-2007 Yaacov Zamir + * 1984-2003 Amos Shapir + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** @file hdate.h + @brief libhdate C language header. + + libhdate - Hebrew calendar library, the C language header file. +*/ + +#ifndef __HDATE_H__ +#define __HDATE_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** @def HDATE_DIASPORA_FLAG + @brief use diaspora dates and holydays flag +*/ +#define HDATE_DIASPORA_FLAG -1 + +/** @def HDATE_ISRAEL_FLAG + @brief use israel dates and holydays flag +*/ +#define HDATE_ISRAEL_FLAG 0 + +/** @def HDATE_SHORT_FLAG + @brief use short strings flag +*/ +#define HDATE_SHORT_FLAG -1 + +/** @def HDATE_LONG_FLAG + @brief use long strings flag +*/ +#define HDATE_LONG_FLAG 0 + +/** @def HEBREW_NUMBER_BUFFER_SIZE + @brief 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 millenium and the century... +*/ +#define HEBREW_NUMBER_BUFFER_SIZE 17 +#define HEBREW_WNUMBER_BUFFER_SIZE 9 + + +/** @struct hdate_struct + @brief libhdate Hebrew date struct +*/ +typedef struct +{ + /** The number of day in the hebrew month (1..31). */ + int hd_day; + /** The number of the hebrew month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). */ + int hd_mon; + /** The number of the hebrew year. */ + int hd_year; + /** The number of the day in the month. (1..31) */ + int gd_day; + /** The number of the month 1..12 (1 - jan). */ + int gd_mon; + /** The number of the year. */ + int gd_year; + /** The day of the week 1..7 (1 - sunday). */ + int hd_dw; + /** The length of the year in days. */ + int hd_size_of_year; + /** The week day of Hebrew new year. */ + int hd_new_year_dw; + /** The number type of year. */ + int hd_year_type; + /** The Julian day number */ + int hd_jd; + /** The number of days passed since 1 tishrey */ + int hd_days; + /** The number of weeks passed since 1 tishrey */ + int hd_weeks; +} hdate_struct; + +/*************************************************************/ +/*************************************************************/ + +/** + @brief compute date structure from the Gregorian date + + @param h pointer this hdate struct. + @param d Day of month 1..31 + @param m Month 1..12 + if m or d is 0 return current date. + @param y Year in 4 digits e.g. 2001 + @return pointer to this hdate struct + */ +hdate_struct * +hdate_set_gdate (hdate_struct *h, int d, int m, int y); + +/** + @brief compute date structure from the Hebrew date + + @param h pointer this hdate struct. + @param d Day of month 1..31 + @param m Month 1..14 ,(13 - Adar 1, 14 - Adar 2) + if m or d is 0 return current date. + @param y Year in 4 digits e.g. 5731 + @return pointer to this hdate struct + */ +hdate_struct * +hdate_set_hdate (hdate_struct *h, int d, int m, int y); + +/** + @brief compute date structure from the Julian day + + @param h pointer this hdate struct. + @param jd the julian day number. + @return pointer to this hdate struct + */ +hdate_struct * +hdate_set_jd (hdate_struct *h, int jd); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief Return a string, with the hebrew date. + + @return 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" ) formated date. You must free() the + pointer after use. + + @param h The hdate_struct of the date to print. + @param diaspora if true give diaspora holydays + @param 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. + +*/ +char * +hdate_get_format_date (hdate_struct const * h, int diaspora, int s); + +/** + @brief get the number of hebrew parasha. + + @param h pointer this hdate struct. + @param diaspora if true give diaspora readings + @return the number of parasha 1. Bereshit etc.. + (55 through 61 are joined strings e.g. Vayakhel Pekudei) +*/ +int +hdate_get_parasha (hdate_struct const * h, int diaspora); + +/** + @brief get the number of hebrew holiday. + + @param h pointer this hdate struct. + @param diaspora if true give diaspora holidays + @return the number of holiday. +*/ +int +hdate_get_holyday (hdate_struct const * h, int diaspora); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief convert an integer to hebrew string. + + @param n The int to convert ( 0 < n < 11000) + @return 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_int_string (int n); + + +/** + @brief Return a static string, with name of week day. + + @param day_of_week The number of the day 1..7 (1 - sun). + @param 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_day_string (int day, int s); + +/** + @brief Return a static string, with name of month. + + @param month The number of the month 1..12 (1 - jan). + @param 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_month_string (int month, int s); + +/** + @brief Return a static string, with name of hebrew month. + + @param month The number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). + @param 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 (int month, int s); + +/** + @brief Name of hebrew holiday. + + @param holiday The holiday number. + @param 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_holyday_string (int holyday, int s); + +/** + @brief Name of Parasha + + @param parasha The Number of Parasha 1-Bereshit + (55 through 61 are joined strings e.g. Vayakhel Pekudei) + @param 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_parasha_string (int parasha, int s); + +/** + @brief Return a static string, with the day in the omer + + @param omer day The day in the omer. + @return 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] +*/ +char * +hdate_get_omer_string (int omer_day); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief Return the day in the omer of the given date + + @param h The hdate_struct of the date to use. + @return The day in the omer, starting from 1 (or 0 if not in sfirat ha omer) +*/ +int +hdate_get_omer_day(hdate_struct const * h); + +/** + @brief 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 + + @param holyday the holyday number + @return the number of holyday type. +*/ +int +hdate_get_holyday_type (int holyday); + +/** + @brief size of hebrew year in days. + + @param hebrew_year the hebrew year. + @return size of Hebrew year +*/ +int +hdate_get_size_of_hebrew_year (int hebrew_year); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief Days since Tishrey 3744 + + @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005 + + @param hebrew_year The Hebrew year + @return Number of days since 3,1,3744 +*/ +int +hdate_days_from_3744 (int hebrew_year); + +/** + @brief Return Hebrew year type based on size and first week day of year. + + @param size_of_year Length of year in days + @param new_year_dw First week day of year + @return the number for year type (1..14) +*/ +int +hdate_get_year_type (int size_of_year, int new_year_dw); + +/** + @brief Compute Julian day from Gregorian date + + @author Yaacov Zamir (algorithm from Henry F. Fliegel and Thomas C. Van Flandern ,1968) + + @param day Day of month 1..31 + @param month Month 1..12 + @param year Year in 4 digits e.g. 2001 + @return the julian day number + */ +int +hdate_gdate_to_jd (int day, int month, int year); + +/** + @brief Compute Julian day from Hebrew day, month and year + + @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005 + + @param day Day of month 1..31 + @param month Month 1..14 (13 - Adar 1, 14 - Adar 2) + @param year Hebrew year in 4 digits e.g. 5753 + @param jd_tishrey1 return the julian number of 1 Tishrey this year + @param jd_tishrey1_next_year return the julian number of 1 Tishrey next year + @return the julian day number + */ +int +hdate_hdate_to_jd (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year); + +/** + @brief Converting from the Julian day to the Gregorian date + + @author Yaacov Zamir (Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968) + + @param jd Julian day + @param day return Day of month 1..31 + @param month return Month 1..12 + @param year return Year in 4 digits e.g. 2001 + */ +void +hdate_jd_to_gdate (int jd, int *day, int *month, int *year); + +/** + @brief Converting from the Julian day to the Hebrew day + + @author Yaacov Zamir 2005 + + @param jd Julian day + @param day return Day of month 1..31 + @param month return Month 1..14 (13 - Adar 1, 14 - Adar 2) + @param year return Year in 4 digits e.g. 2001 + @param jd_tishrey1 return the julian number of 1 Tishrey this year + @param jd_tishrey1_next_year return the julian number of 1 Tishrey next year + */ +void +hdate_jd_to_hdate (int jd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief days from 1 january + + @param day this day of month + @param month this month + @param year this year + @return the days from 1 jan +*/ +int +hdate_get_day_of_year (int day, int month, int year); + +/** + @brief 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. + + @param day this day of month + @param month this month + @param year this year + @param longitude longitude to use in calculations + @param latitude latitude to use in calculations + @param deg degrees of sun's altitude (0 - Zenith .. 90 - Horizon) + @param sunrise return the utc sunrise in minutes + @param sunset return the utc sunset in minutes +*/ +void +hdate_get_utc_sun_time_deg (int day, int month, int year, + double latitude, double longitude, double deg, int *sunrise, int *sunset); + +/** + @brief utc sunrise/set time for a gregorian date + + @param day this day of month + @param month this month + @param year this year + @param longitude longitude to use in calculations + degrees, negative values are east + @param latitude latitude to use in calculations + degrees, negative values are south + @param sunrise return the utc sunrise in minutes after midnight (00:00) + @param sunset return the utc sunset in minutes after midnight (00:00) +*/ +void +hdate_get_utc_sun_time (int day, int month, int year, + double latitude, double longitude, int *sunrise, int *sunset); + +/** + @brief utc sunrise/set time for a gregorian date + + @param day this day of month + @param month this month + @param year this year + @param longitude longitude to use in calculations + @param latitude latitude to use in calculations + @param sun_hour return the length of shaa zaminit in minutes + @param first_light return the utc alut ha-shachar in minutes + @param talit return the utc tphilin and talit in minutes + @param sunrise return the utc sunrise in minutes + @param midday return the utc midday in minutes + @param sunset return the utc sunset in minutes + @param first_stars return the utc tzeit hacochavim in minutes + @param three_stars return the utc shlosha cochavim in minutes +*/ +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); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief get the Gregorian day of the month + + @param h pointer this hdate struct. + @return the Gregorian day of the month, 1..31. + */ +int +hdate_get_gday (hdate_struct const * h); + +/** + @brief get the Gregorian month + + @param h pointer this hdate struct. + @return the Gregorian month, jan = 1. + */ +int +hdate_get_gmonth (hdate_struct const * h); + +/** + @brief get the Gregorian year + + @param h pointer this hdate struct. + @return the Gregorian year. + */ +int +hdate_get_gyear (hdate_struct const * h); + +/** + @brief get the Hebrew day of the month + + @param h pointer this hdate struct. + @return the Hebrew day of the month, 1..30. + */ +int +hdate_get_hday (hdate_struct const * h); + +/** + @brief get the Hebrew month + + @param h pointer this hdate struct. + @return the Hebrew month, Tishery = 1 .. Adar I =13, Adar II = 14. + */ +int +hdate_get_hmonth (hdate_struct const * h); + +/** + @brief get the Hebrew year + + @param h pointer this hdate struct. + @return the Hebrew year. + */ +int +hdate_get_hyear (hdate_struct const * h); + +/** + @brief get the day of the week + + @param h pointer this hdate struct. + @return the the day of the week. + */ +int +hdate_get_day_of_the_week (hdate_struct const * h); + +/** + @brief get the size of the hebrew year + + @param h pointer this hdate struct. + @return the the size of the hebrew year. + */ +int +hdate_get_size_of_year (hdate_struct const * h); + +/** + @brief get the new year day of the week + + @param h pointer this hdate struct. + @return the the new year day of the week. + */ +int +hdate_get_new_year_day_of_the_week (hdate_struct const * h); + +/** + @brief get the Julian day number + + @param h pointer this hdate struct. + @return the Julian day number. + */ +int +hdate_get_julian (hdate_struct const * h); + +/** + @brief get the number of days passed since 1 tishrey + + @param h pointer this hdate struct. + @return the number of days passed since 1 tishrey. + */ +int +hdate_get_days (hdate_struct const * h); + +/** + @brief get the number of weeks passed since 1 tishrey + + @param h pointer this hdate struct. + @return the number of weeks passed since 1 tishrey. + */ +int +hdate_get_weeks (hdate_struct const * h); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief creat a new hdate struct object, must be deleted using delete_hdate. + + @return a new hdate object + */ +hdate_struct * +new_hdate (); + +/** + @brief delete an hdate struct object. + + @param h pointer this hdate struct. + */ +hdate_struct * +delete_hdate (hdate_struct *h); + +/*************************************************************/ +/*************************************************************/ + +/** + @brief Return a static string, with the package name and version + + @return a static string, with the package name and version +*/ +char * +hdate_get_version_string (); + +/** + @brief name of translator + + @return a static string with name of translator, or NULL if none. +*/ +char * +hdate_get_translator_string (); + +/** + @brief helper function to find hebrew locale + + @return 0 - latin locale, -1 - hebrew locale +*/ +int +hdate_is_hebrew_locale(); + +/** + @brief Return string values for hdate information + @return 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. + @param type_of_string 0 = integer, 1 = day of week, 2 = parshaot, + 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer + @param 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 ) + @param short_form 0 = short format + @param hebrew_form 0 = not hebrew (native/embedded) +*/ +char* hdate_string( int type_of_string, int index, int short_form, int hebrew_form); + +/** @def HDATE_STRING_INT + @brief for function hdate_string: identifies string type: integer +*/ +#define HDATE_STRING_INT 0 + +/** @def HDATE_STRING_DOW + @brief for function hdate_string: identifies string type: day of week +*/ +#define HDATE_STRING_DOW 1 + +/** @def HDATE_STRING_PARASHA + @brief for function hdate_string: identifies string type: parasha +*/ +#define HDATE_STRING_PARASHA 2 + +/** @def HDATE_STRING_HMONTH + @brief for function hdate_string: identifies string type: hebrew_month +*/ +#define HDATE_STRING_HMONTH 3 + +/** @def HDATE_STRING_GMONTH + @brief for function hdate_string: identifies string type: gregorian_month +*/ +#define HDATE_STRING_GMONTH 4 + +/** @def HDATE_STRING_HOLIDAY + @brief for function hdate_string: identifies string type: holiday +*/ +#define HDATE_STRING_HOLIDAY 5 + +/** @def HDATE_STRING_HOLIDAY + @brief for function hdate_string: identifies string type: holiday +*/ +#define HDATE_STRING_OMER 6 + +/** @def HDATE_STRING_SHORT + @brief for function hdate_string: use short form, if one exists +*/ +#define HDATE_STRING_SHORT 1 + +/** @def HDATE_STRING_LONG + @brief for function hdate_string: use long form +*/ +#define HDATE_STRING_LONG 0 + +/** @def HDATE_STRING_HEBREW + @brief for function hdate_string: use embedded hebrew string +*/ +#define HDATE_STRING_HEBREW 1 + +/** @def HDATE_STRING_LOCAL + @brief for function hdate_string: use local locale string +*/ +#define HDATE_STRING_LOCAL 0 + + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Makefile.am b/Makefile.am index 27a97d1..7ebd06d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ libhdate_LDFLAGS = -z relro -z now -libhdatedocdir = ${prefix}/share/doc/libhdate +libhdatedocdir = ${prefix}/share/doc/libhdate1 libhdatedoc_DATA = \ README\ COPYING\ diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am index 30ae6e8..71b3a6f 100644 --- a/bindings/perl/Makefile.am +++ b/bindings/perl/Makefile.am @@ -11,8 +11,8 @@ hdate.so: hdate_wrap.cxx - g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src - g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so + g++ -fpic -c hdate_wrap.cxx $(CFLAGS) $(CPPFLAGS) $(PE_CFLAGS) -I$(top_srcdir)/src + g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so $(LDFLAGS) hdate_wrap.cxx: hdate.i swig -perl -c++ hdate.i diff --git a/bindings/perl/Makefile.in b/bindings/perl/Makefile.in index 8ef9cf5..bce517d 100644 --- a/bindings/perl/Makefile.in +++ b/bindings/perl/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,7 +88,6 @@ build_triplet = @build@ host_triplet = @host@ subdir = bindings/perl -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ @@ -63,9 +99,22 @@ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -73,9 +122,12 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -123,6 +175,7 @@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -222,6 +275,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -248,7 +302,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/perl/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -272,11 +325,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: distdir: $(DISTFILES) @@ -414,23 +467,26 @@ .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile @WITH_PERL_TRUE@all-am: hdate.so @WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx -@WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src -@WITH_PERL_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so +@WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(CFLAGS) $(CPPFLAGS) $(PE_CFLAGS) -I$(top_srcdir)/src +@WITH_PERL_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so $(LDFLAGS) @WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i @WITH_PERL_TRUE@ swig -perl -c++ hdate.i diff --git a/bindings/php/Makefile.am b/bindings/php/Makefile.am index 6a5363d..ff429f9 100644 --- a/bindings/php/Makefile.am +++ b/bindings/php/Makefile.am @@ -12,7 +12,7 @@ hdate.so: hdate_wrap.cpp g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp - gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so + gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -lstdc++ -o hdate.so hdate_wrap.cpp: hdate.i swig -php5 -c++ hdate.i diff --git a/bindings/php/Makefile.in b/bindings/php/Makefile.in index 10570d3..82c140b 100644 --- a/bindings/php/Makefile.in +++ b/bindings/php/Makefile.in @@ -430,7 +430,7 @@ @WITH_PHP_TRUE@hdate.so: hdate_wrap.cpp @WITH_PHP_TRUE@ g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp -@WITH_PHP_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so +@WITH_PHP_TRUE@ gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -lstdc++ -o hdate.so @WITH_PHP_TRUE@hdate_wrap.cpp: hdate.i @WITH_PHP_TRUE@ swig -php5 -c++ hdate.i diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index a2469e9..69f8a3e 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -11,8 +11,8 @@ _hdate.so: hdate_wrap.cxx - g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src - g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so + g++ -fpic -c hdate_wrap.cxx $(CPPFLAGS) $(CFLAGS) $(PY_CFLAGS) -I$(top_srcdir)/src + g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so $(LDFLAGS) hdate_wrap.cxx: hdate.i swig -python -c++ hdate.i diff --git a/bindings/python/Makefile.in b/bindings/python/Makefile.in index bcf3f49..b1cece6 100644 --- a/bindings/python/Makefile.in +++ b/bindings/python/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,7 +88,6 @@ build_triplet = @build@ host_triplet = @host@ subdir = bindings/python -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ @@ -63,9 +99,22 @@ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -73,9 +122,12 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -123,6 +175,7 @@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -222,6 +275,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -248,7 +302,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/python/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -272,11 +325,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: distdir: $(DISTFILES) @@ -414,23 +467,26 @@ .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile @WITH_PYTHON_TRUE@all-am: _hdate.so @WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx -@WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src -@WITH_PYTHON_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so +@WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(CPPFLAGS) $(CFLAGS) $(PY_CFLAGS) -I$(top_srcdir)/src +@WITH_PYTHON_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so $(LDFLAGS) @WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i @WITH_PYTHON_TRUE@ swig -python -c++ hdate.i diff --git a/bindings/ruby/Makefile.am b/bindings/ruby/Makefile.am index 43c4d5e..47d286b 100644 --- a/bindings/ruby/Makefile.am +++ b/bindings/ruby/Makefile.am @@ -12,7 +12,7 @@ hdate.so: hdate_wrap.cxx g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src - gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so + gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so hdate_wrap.cxx: hdate.i swig -c++ -ruby hdate.i diff --git a/bindings/ruby/Makefile.in b/bindings/ruby/Makefile.in index cd166ac..1088117 100644 --- a/bindings/ruby/Makefile.in +++ b/bindings/ruby/Makefile.in @@ -430,7 +430,7 @@ @WITH_RUBY_TRUE@hdate.so: hdate_wrap.cxx @WITH_RUBY_TRUE@ g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src -@WITH_RUBY_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so +@WITH_RUBY_TRUE@ gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -rdynamic -Wl,-export-dynamic -lruby$(RU_VERSION) -lpthread -ldl -lcrypt -lm -lc -lstdc++ -o hdate.so @WITH_RUBY_TRUE@hdate_wrap.cxx: hdate.i @WITH_RUBY_TRUE@ swig -c++ -ruby hdate.i diff --git a/configure.in b/configure.in index 69b54a0..7b42973 100644 --- a/configure.in +++ b/configure.in @@ -33,7 +33,6 @@ AC_CONFIG_MACRO_DIR([m4]) AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -CFLAGS=" -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie" LIBS=-lm dnl ======================================================================================= diff --git a/debian/changelog b/debian/changelog index 18b6758..32cabae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libhdate (1.6.02-2.1) unstable; urgency=medium + + * Non-maintainer upload. + * Drop python-hdate, there are no remaining rdeps remaining + (Closes: #936873) + + -- Moritz Muehlenhoff Sun, 02 Aug 2020 23:13:33 +0200 + libhdate (1.6.02-2) unstable; urgency=medium * Update maintainer address (Closes: #899576) diff --git a/debian/control b/debian/control index 1641684..81bec6c 100644 --- a/debian/control +++ b/debian/control @@ -7,8 +7,6 @@ Vcs-Git: https://salsa.debian.org/hebrew-team/libhdate.git Build-Depends: debhelper (>= 9), swig, - python-dev (>= 2.6.6-3~), - dh-python, dh-autoreconf, Standards-Version: 3.9.8 Homepage: http://libhdate.sourceforge.net/ @@ -25,20 +23,6 @@ . This package contains headers and support files required to build new applications with libhdate. - -Package: python-hdate -Section: python -Architecture: any -Provides: ${python:Provides} -Depends: libhdate1 (= ${binary:Version}), ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Description: Provides a library that help use Hebrew dates (Python bindings) - LibHdate is a small C,C++ library for Hebrew dates, - holidays, and reading sequence (parasha). It is using - the source code from Amos Shapir's "hdate" package fixed and - patched by Nadav Har'El. The Torah reading sequence - is from tables by Zvi Har'El. - . - This package contains Python bindings to libhdate Package: libhdate-perl Section: perl diff --git a/debian/python-hdate.install b/debian/python-hdate.install deleted file mode 100644 index 970cf80..0000000 --- a/debian/python-hdate.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/python*/* diff --git a/debian/rules b/debian/rules index f957256..bc0a0b3 100755 --- a/debian/rules +++ b/debian/rules @@ -3,10 +3,7 @@ ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}') %: - dh $* --with python2,autoreconf + dh $* --with autoreconf override_dh_auto_configure: dh_auto_configure -- --with-perl-sitelib-dir=$(ARCHLIB) - -override_dh_python2: - dh_python2 -s --no-guessing-versions diff --git a/docs/man/man3/hdate.h.3 b/docs/man/man3/hdate.h.3 index 554bb36..5640fa2 100644 --- a/docs/man/man3/hdate.h.3 +++ b/docs/man/man3/hdate.h.3 @@ -290,7 +290,7 @@ .PP for hdate_get_int_string_ and hdate_get_int_wstring \fBNote:\fP .RS 4 -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 millenium and the century\&.\&.\&. +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\&.\&.\&. .RE .PP @@ -386,7 +386,7 @@ Return a string, with the hebrew date\&. \fBReturns:\fP .RS 4 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' ) formated date\&. You must free() the pointer after use\&. + 18 Tishrey 5763 Hol hamoed Sukot' ) formatted date\&. You must free() the pointer after use\&. .RE .PP \fBParameters:\fP diff --git a/docs/man/man3/hdate_Hdate.3 b/docs/man/man3/hdate_Hdate.3 index 264cc79..6dde977 100644 --- a/docs/man/man3/hdate_Hdate.3 +++ b/docs/man/man3/hdate_Hdate.3 @@ -36,7 +36,7 @@ .ti -1c .RI "char * \fBget_format_date\fP (int s)" .br -.RI "\fIget formated hebrew date. \fP" +.RI "\fIget formatted hebrew date. \fP" .ti -1c .RI "char * \fBget_day_of_week_string\fP (int s)" .br @@ -231,9 +231,9 @@ .SS "char* hdate::Hdate::get_format_date (int s)\fC [inline]\fP" .PP -get formated hebrew date. -.PP -return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formated date. +get formatted hebrew date. +.PP +return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formatted date. .PP \fBParameters:\fP .RS 4 diff --git a/examples/hcal/hcal.c b/examples/hcal/hcal.c index 4d26472..11154dc 100644 --- a/examples/hcal/hcal.c +++ b/examples/hcal/hcal.c @@ -20,7 +20,6 @@ * along with this program. If not, see . */ -#define _GNU_SOURCE // for mempcpy #include // For printf #include // For hebrew date //#include "../../src/hdate.h" @@ -162,7 +161,7 @@ # and its (limited, and maybe biased) of the dominant Jewish community\n\ # in that timezone. When hcal is forced to guess, it alerts the user\n\ # with a message that includes the guessed location.\n\ -# hcal's guesses will also affect its default behaviour for ouput of\n\ +# hcal's guesses will also affect its default behaviour for output of\n\ # Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\ #SUNSET_AWARE=TRUE\n\ # LATITUDE and LONGITUDE may be in decimal format or in the form\n\ @@ -678,13 +677,6 @@ } -/************************************************** -* print column headings for days of weeks -**************************************************/ -void print_header_dow_line_stdout( const int colorize ) -{ - int column; - void print_dow_column( int column ) { if (hdate_is_hebrew_locale()) @@ -701,6 +693,13 @@ if (column != 7) printf (" "); } + +/************************************************** +* print column headings for days of weeks +**************************************************/ +void print_header_dow_line_stdout( const int colorize ) +{ + int column; if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES); for (column = 1; column < 7; column++) print_dow_column(column); @@ -1153,6 +1152,30 @@ +void how_many_calendar_lines( int month, int start_dow, int *max_calendar_lines ) + { + switch (month) + { + case 4: + case 6: + case 9: + case 11: if (start_dow == 7) *max_calendar_lines = 6; + else if (*max_calendar_lines == 4) *max_calendar_lines = 5; + break; + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: if (start_dow > 5) *max_calendar_lines = 6; + else if (*max_calendar_lines == 4) *max_calendar_lines = 5; + break; + case 2: if (start_dow > 1 && *max_calendar_lines == 4) *max_calendar_lines = 5; + break; + } + } + /************************************************** * print month table *************************************************/ @@ -1169,30 +1192,6 @@ /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]" int jd_current_month, jd_previous_month = 1, jd_next_month = 1; - void how_many_calendar_lines( int month, int start_dow ) - { - switch (month) - { - case 4: - case 6: - case 9: - case 11: if (start_dow == 7) max_calendar_lines = 6; - else if (max_calendar_lines == 4) max_calendar_lines = 5; - break; - case 1: - case 3: - case 5: - case 7: - case 8: - case 10: - case 12: if (start_dow > 5) max_calendar_lines = 6; - else if (max_calendar_lines == 4) max_calendar_lines = 5; - break; - case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5; - break; - } - } - /********************************************************* * Preliminaries: * - Find the first sunday(s) of each calendar @@ -1200,7 +1199,7 @@ *********************************************************/ hdate_set_gdate (&h, 1, current_month, current_year); jd_current_month = h.hd_jd - h.hd_dw + 1; - how_many_calendar_lines( h.gd_mon, h.hd_dw ); + how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); /********************************************************* * three months, side-by-side @@ -1222,7 +1221,7 @@ } hdate_set_gdate (&h, 1, previous_month, previous_year); jd_previous_month = h.hd_jd - h.hd_dw + 1; - how_many_calendar_lines( h.gd_mon, h.hd_dw ); + how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); /********************************************************* * next month @@ -1239,7 +1238,7 @@ } hdate_set_gdate (&h, 1, next_month, next_year); jd_next_month = h.hd_jd - h.hd_dw + 1; - how_many_calendar_lines( h.gd_mon, h.hd_dw ); + how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); } diff --git a/examples/hcal/hdate.c b/examples/hcal/hdate.c index fb4b128..d4288f5 100644 --- a/examples/hcal/hdate.c +++ b/examples/hcal/hdate.c @@ -20,7 +20,6 @@ * along with this program. If not, see . */ -#define _GNU_SOURCE // For mempcpy, asprintf #include // For hebrew date //#include "../../src/hdate.h" #include // For atoi, getenv, setenv @@ -102,7 +101,7 @@ # and its (limited, and maybe biased) of the dominant Jewish community\n\ # in that timezone. When hdate is forced to guess, it alerts the user\n\ # with a message that includes the guessed location.\n\ -# hdate's guesses will also affect its default behaviour for ouput of\n\ +# hdate's guesses will also affect its default behaviour for output of\n\ # Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\ #SUNSET_AWARE=TRUE\n\ # LATITUDE and LONGITUDE may be in decimal format or in the form\n\ diff --git a/examples/hcal/local_functions.c b/examples/hcal/local_functions.c index aa001b7..47033fb 100644 --- a/examples/hcal/local_functions.c +++ b/examples/hcal/local_functions.c @@ -25,7 +25,6 @@ /************************************************** * functions to support hcal and hdate **************************************************/ -#define _GNU_SOURCE // For mempcpy, asprintf #include // For hebrew date //include "../../src/hdate.h" @@ -252,11 +251,11 @@ #define DEBUG 0 #if DEBUG -printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source); +printf("\nrevstr: entry: sourcelen = %zd, source = %s\n",source_len, source); #endif if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);}; - if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);}; + if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %zd",source_len); exit(0);}; size_t i,j; char *temp_buff; @@ -277,7 +276,7 @@ memcpy(source, temp_buff, source_len); source[source_len] = '\0'; #if DEBUG -printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source); +printf("\nrevstr: before free(tempbuff): sourcelen = %zd, source = %s\n",source_len, source); #endif free(temp_buff); return; @@ -646,62 +645,50 @@ } -/************************************************************ -* Open config file, or create one -* - returns filepointer or NULL -* - if file does not exist, attempt to create it -************************************************************/ -FILE* get_config_file( const char* config_dir_name, - const char* config_file_name, - const char* default_config_file_text ) -{ - size_t path_len; - - char* config_home_path_name = ""; - char* config_sub_path_name = ""; - - char* config_dir_path; - char* config_file_path; - - FILE* config_file; /************************************************************ * sub-function to get_config_file: create_config_file ************************************************************/ - void create_config_file() - { - config_file = fopen(config_file_path, "a"); - if (config_file == NULL) + void create_config_file(FILE** config_file, char* config_file_path, + const char* default_config_file_text, const char* config_file_name) + { + *config_file = fopen(config_file_path, "a"); + if (*config_file == NULL) { error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path); return; } - fprintf(config_file, "%s", default_config_file_text); + fprintf(*config_file, "%s", default_config_file_text); error(0,0,"%s: %s",N_("config file created"), config_file_path); - if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); + if (fclose(*config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); } /************************************************************ * sub-function to get_config_file: open_config_file ************************************************************/ - int open_config_file() - { - config_file = fopen(config_file_path, "r"); - if (config_file == NULL) + int open_config_file(FILE** config_file, char* config_file_path, + size_t *path_len, const char* config_home_path_name, + const char* config_sub_path_name, const char* config_dir_name, + const char* default_config_file_text, const char* config_file_name) + { + char* config_dir_path; + + *config_file = fopen(config_file_path, "r"); + if (*config_file == NULL) { if (errno != ENOENT) return FALSE; // maybe replace all this with a single line asprintf() - path_len = strlen(config_home_path_name) + *path_len = strlen(config_home_path_name) + strlen(config_sub_path_name) + strlen(config_dir_name) +1; - if (path_len < 1) return FALSE; - config_dir_path = malloc(path_len); + if (*path_len < 1) return FALSE; + config_dir_path = malloc(*path_len); if (config_dir_path == NULL) { error(0,errno,"%s",N_("memory allocation failure")); return FALSE; } - snprintf(config_dir_path, path_len, "%s%s%s", + snprintf(config_dir_path, *path_len, "%s%s%s", config_home_path_name, config_sub_path_name, config_dir_name); @@ -712,13 +699,30 @@ return FALSE; } greetings_to_version_16(); - create_config_file(); + create_config_file(config_file, config_file_path, default_config_file_text, config_file_name); free(config_dir_path); return FALSE; } return TRUE; } +/************************************************************ +* Open config file, or create one +* - returns filepointer or NULL +* - if file does not exist, attempt to create it +************************************************************/ +FILE* get_config_file( const char* config_dir_name, + const char* config_file_name, + const char* default_config_file_text ) +{ + size_t path_len; + + char* config_home_path_name = ""; + char* config_sub_path_name = ""; + + char* config_file_path; + + FILE* config_file; /************************************************************ * main part of function get_config_file @@ -750,7 +754,9 @@ config_home_path_name, config_sub_path_name, config_dir_name, config_file_name); - if (open_config_file() == TRUE) + if (open_config_file(&config_file, config_file_path, &path_len, config_home_path_name, + config_sub_path_name, config_dir_name, + default_config_file_text, config_file_name) == TRUE) { free(config_file_path); return config_file; diff --git a/po/es_MX.po b/po/es_MX.po index 76e5107..e341389 100644 --- a/po/es_MX.po +++ b/po/es_MX.po @@ -677,7 +677,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -934,7 +934,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/po/fr.po b/po/fr.po index 0b04627..485cbc0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -661,7 +661,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -918,7 +918,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/po/he.po b/po/he.po index 9b9b189..3207423 100644 --- a/po/he.po +++ b/po/he.po @@ -658,7 +658,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -915,7 +915,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/po/libhdate.pot b/po/libhdate.pot index 79807a3..affb733 100644 --- a/po/libhdate.pot +++ b/po/libhdate.pot @@ -659,7 +659,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -916,7 +916,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/po/ru.po b/po/ru.po index a7792e6..7e69349 100644 --- a/po/ru.po +++ b/po/ru.po @@ -662,7 +662,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -919,7 +919,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/po/sv.po b/po/sv.po index f485ab6..1e1ad1e 100644 --- a/po/sv.po +++ b/po/sv.po @@ -661,7 +661,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hcal is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hcal's guesses will also affect its default behaviour for ouput of\n" +"# hcal's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" @@ -918,7 +918,7 @@ "# and its (limited, and maybe biased) of the dominant Jewish community\n" "# in that timezone. When hdate is forced to guess, it alerts the user\n" "# with a message that includes the guessed location.\n" -"# hdate's guesses will also affect its default behaviour for ouput of\n" +"# hdate's guesses will also affect its default behaviour for output of\n" "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n" "#SUNSET_AWARE=TRUE\n" "# LATITUDE and LONGITUDE may be in decimal format or in the form\n" diff --git a/src/deprecated.c b/src/deprecated.c index bc62f65..1857b3d 100644 --- a/src/deprecated.c +++ b/src/deprecated.c @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#define _GNU_SOURCE #include #include #include diff --git a/src/hdate.h b/src/hdate.h index 9d2816c..499b9b7 100644 --- a/src/hdate.h +++ b/src/hdate.h @@ -61,7 +61,7 @@ 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 millenium and the century... + point between the millennium and the century... */ #define HEBREW_NUMBER_BUFFER_SIZE 17 #define HEBREW_WNUMBER_BUFFER_SIZE 9 diff --git a/src/hdate_julian.c b/src/hdate_julian.c index 1c64799..08bb7a4 100644 --- a/src/hdate_julian.c +++ b/src/hdate_julian.c @@ -367,7 +367,7 @@ if ((d == 0) || (m == 0)) { struct tm *tm; - long t; + time_t t; /* FIXME: day start at 6:00 or 12:00 like in Gregorian cal. ? */ t = time (0); tm = localtime (&t); diff --git a/src/hdate_strings.c b/src/hdate_strings.c index c970128..6fe1638 100644 --- a/src/hdate_strings.c +++ b/src/hdate_strings.c @@ -18,7 +18,6 @@ * along with this program. If not, see . */ -#define _GNU_SOURCE #include #include #include