Codebase list libhdate / a133f94
* Non-maintainer upload. * Drop python-hdate, there are no remaining rdeps remaining (Closes: #936873) Moritz Muehlenhoff authored 3 years ago Debian Janitor committed 3 years ago
67 changed file(s) with 28237 addition(s) and 203 deletion(s). Raw diff Collapse all Expand all
0 debian/patches
0 docdir.patch
1 ld-as-needed.patch
2 time_t.patch
3 typos.patch
4 cflags.patch
5 duplicate_gnu_source.patch
6 size_t.patch
7 clang.patch
0
1 EXTRA_DIST = hdate.i
2
3 if WITH_PERL
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cxx *.so *wrap* *.pm
8
9 all-am: hdate.so
10
11
12 hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so
15
16 hdate_wrap.cxx: hdate.i
17 swig -perl -c++ hdate.i
18
19 install-data-local: hdate.so
20 $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/
21 $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so
22 $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm
23
24 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/perl
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i
233 @WITH_PERL_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_PERL_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.pm
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/perl/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_PERL_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_PERL_TRUE@all-am: hdate.so
429
430 @WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx
431 @WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PERL_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so
433
434 @WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i
435 @WITH_PERL_TRUE@ swig -perl -c++ hdate.i
436
437 @WITH_PERL_TRUE@install-data-local: hdate.so
438 @WITH_PERL_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/
439 @WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so
440 @WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm
441
442 # Tell versions [3.59,3.63) of GNU make to not export all variables.
443 # Otherwise a system limit (for SysV at least) may be exceeded.
444 .NOEXPORT:
0
1 EXTRA_DIST = hdate.i
2
3 if WITH_PYTHON
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cxx *.so *wrap* *.py
8
9 all-am: _hdate.so
10
11
12 _hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so
15
16 hdate_wrap.cxx: hdate.i
17 swig -python -c++ hdate.i
18
19 install-data-local: _hdate.so
20 $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH)
21 $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so
22 $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py
23
24 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/python
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i
233 @WITH_PYTHON_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_PYTHON_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.py
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/python/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_PYTHON_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_PYTHON_TRUE@all-am: _hdate.so
429
430 @WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx
431 @WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PYTHON_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so
433
434 @WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i
435 @WITH_PYTHON_TRUE@ swig -python -c++ hdate.i
436
437 @WITH_PYTHON_TRUE@install-data-local: _hdate.so
438 @WITH_PYTHON_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH)
439 @WITH_PYTHON_TRUE@ $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so
440 @WITH_PYTHON_TRUE@ $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py
441
442 # Tell versions [3.59,3.63) of GNU make to not export all variables.
443 # Otherwise a system limit (for SysV at least) may be exceeded.
444 .NOEXPORT:
0 AC_INIT(src/hdate.h)
1
2 dnl Set release number
3 PACKAGE=libhdate
4 LIBHDATE_MAJOR_VERSION=1
5 LIBHDATE_MINOR_VERSION=6
6 LIBHDATE_MICRO_VERSION=02
7
8 VERSION=$LIBHDATE_MAJOR_VERSION.$LIBHDATE_MINOR_VERSION.$LIBHDATE_MICRO_VERSION
9
10 dnl libtool library numbering
11 VERSION_INFO=$LIBHDATE_MAJOR_VERSION:$LIBHDATE_MINOR_VERSION:0
12
13 AC_SUBST(VERSION_INFO)
14
15 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
16 AM_MAINTAINER_MODE
17
18 dnl Checks for programs.
19 AC_ISC_POSIX
20 AC_GNU_SOURCE
21 AC_USE_SYSTEM_EXTENSIONS
22 AC_PROG_CC
23 AC_PROG_INSTALL
24 AC_PROG_LN_S
25 AC_PROG_MAKE_SET
26 AC_STDC_HEADERS
27 AM_PROG_LIBTOOL
28
29 AM_MAINTAINER_MODE
30
31 AC_C_CONST
32 AC_CONFIG_MACRO_DIR([m4])
33 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
34
35 CFLAGS=" -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie"
36 LIBS=-lm
37
38 dnl =======================================================================================
39
40 AC_CHECK_PROG(have_swig, "swig", yes, no)
41
42 dnl =======================================================================================
43
44 AC_CHECK_PROG(have_fpc, "fpc", yes, no)
45
46 build_fpc=$have_fpc
47
48 AC_ARG_ENABLE([fpc],
49 [AS_HELP_STRING([--disable-fpc],
50 [do not build free pascal binding])],
51 [build_fpc=no], [build_fpc=$have_fpc])
52
53 if test "$have_fpc" = "yes"; then
54 PA_VERSION=`fpc -iV`
55 PA_TPR=`fpc -iTP`
56 PA_TOS=`fpc -iTO`
57 PA_MODULES_PATH="/usr/lib/fpc/$PA_VERSION/units/$PA_TPR-$PA_TOS"
58 AC_SUBST([PA_VERSION])
59 AC_SUBST([PA_MODULES_PATH])
60 fi
61
62 dnl =======================================================================================
63
64 AC_CHECK_PROG(have_gpc, "gpc", yes, no)
65
66 build_gpc=$have_gpc
67
68 AC_ARG_ENABLE([gpc],
69 [AS_HELP_STRING([--disable-gpc],
70 [do not build gnu pascal binding])],
71 [build_gpc=no], [build_gpc=$have_gpc])
72
73 if test "$have_gpc" = "yes"; then
74 GP_MODULES_PATH=`gpc -print-search-dirs | grep install | cut -d' ' -f 2`
75 AC_SUBST([GP_MODULES_PATH])
76 fi
77
78 dnl =======================================================================================
79
80 AM_CONDITIONAL(WITH_GPC_FPC, [test "$build_fpc" = "yes" -a "$build_gpc" = "yes" ])
81 AM_CONDITIONAL(WITH_GPC, [test "$build_gpc" = "yes" -a "$build_fpc" != "yes" ])
82 AM_CONDITIONAL(WITH_FPC, [test "$build_gpc" != "yes" -a "$build_fpc" = "yes" ])
83
84 dnl =======================================================================================
85
86 AC_CHECK_PROG(have_python, "python", yes, no)
87
88 build_python=$have_python
89
90 AC_ARG_ENABLE([python],
91 [AS_HELP_STRING([--disable-python],
92 [do not build python binding])],
93 [build_python=no], [build_python=$have_python])
94
95 AC_ARG_WITH(python-sitelib-dir,
96 [AS_HELP_STRING([--with-python-sitelib-dir=PATH],
97 [path to python site lib])])
98
99 if test "$have_python" = "yes"; then
100 PY_PREFIX=`python -c 'import sys ; print sys.prefix'`
101 PY_VERSION=`python -c 'import sys ; print sys.version[[0:3]]'`
102 AC_MSG_CHECKING(for $PY_PREFIX/include/python$PY_VERSION/Python.h)
103 if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
104 AC_MSG_RESULT(yes)
105 PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
106
107 if test "$with_python_sitelib_dir" = "" ; then
108 PY_MODULES_PATH="$PY_PREFIX/lib/python$PY_VERSION/dist-packages"
109 else
110 PY_MODULES_PATH=$with_python_sitelib_dir
111 fi
112
113 AC_SUBST([PY_VERSION])
114 AC_SUBST([PY_CFLAGS])
115 AC_SUBST([PY_MODULES_PATH])
116 if test "$have_swig" = "no"; then
117 build_python=no
118 fi
119 else
120 AC_MSG_RESULT(no)
121 build_python=no
122 fi
123 fi
124
125 AM_CONDITIONAL(WITH_PYTHON, test "$build_python" = "yes")
126
127 dnl =======================================================================================
128
129 AC_CHECK_PROG(have_ruby, "ruby", yes, no)
130
131 build_ruby=$have_ruby
132
133 AC_ARG_ENABLE([ruby],
134 [AS_HELP_STRING([--disable-ruby],
135 [do not build ruby binding])],
136 [build_ruby=no], [build_ruby=$have_ruby])
137
138 AC_ARG_WITH(ruby-sitelib-dir,
139 [AS_HELP_STRING([--with-ruby-sitelib-dir=PATH],
140 [path to ruby site lib])])
141
142 if test "$have_ruby" = "yes"; then
143 RU_PREFIX=`ruby -e 'require "mkmf"; puts $topdir'`
144 RU_VERSION=`ruby -e "require 'mkmf'; puts config_string('MAJOR')"`
145 RU_VERSION+=.`ruby -e "require 'mkmf'; puts config_string('MINOR')"`
146 AC_MSG_CHECKING(for $RU_PREFIX/ruby.h)
147 if test -f $RU_PREFIX/ruby.h; then
148 AC_MSG_RESULT(yes)
149 RU_CFLAGS="-I$RU_PREFIX"
150
151 if test "$with_ruby_sitelib_dir" = "" ; then
152 RU_MODULES_PATH="$RU_PREFIX"
153 else
154 RU_MODULES_PATH=$with_ruby_sitelib_dir
155 fi
156
157 AC_SUBST([RU_VERSION])
158 AC_SUBST([RU_CFLAGS])
159 AC_SUBST([RU_MODULES_PATH])
160 if test "$have_swig" = "no"; then
161 build_ruby=no
162 fi
163 else
164 AC_MSG_RESULT(no)
165 build_ruby=no
166 fi
167 fi
168
169 AM_CONDITIONAL(WITH_RUBY, test "$build_ruby" = "yes")
170
171 dnl =======================================================================================
172
173 AC_CHECK_PROG(have_php, "php", yes, no)
174
175 build_php=$have_php
176
177 AC_ARG_ENABLE([php],
178 [AS_HELP_STRING([--disable-php],
179 [do not build php binding])],
180 [build_php=no], [build_php=$have_php])
181
182 AC_ARG_WITH(php-sitelib-dir,
183 [AS_HELP_STRING([--with-php-sitelib-dir=PATH],
184 [path to php site lib])])
185
186 if test "$have_php" = "yes"; then
187 AC_CHECK_PROG(have_php_config, "php-config5", yes, no)
188 if test "$have_php_config" = "yes"; then
189
190 PH_CONFIG_PATH=`php --ini | grep "Scan" | cut -d: -f2 | sed 's/\s//g'`
191 PH_INCLUDE_PATH=`php -r "echo get_include_path();" | cut -f2 -d:`
192 if test "$with_php_sitelib_dir" = "" ; then
193 PH_MODULES_PATH=`php-config5 --extension-dir`
194 else
195 PH_MODULES_PATH=$with_php_sitelib_dir
196 fi
197
198 AC_SUBST([PH_CONFIG_PATH])
199 AC_SUBST([PH_INCLUDE_PATH])
200 AC_SUBST([PH_MODULES_PATH])
201 if test "$have_swig" = "no"; then
202 build_php=no
203 fi
204 else
205 AC_MSG_RESULT(no)
206 build_php=no
207 fi
208 fi
209
210 AM_CONDITIONAL(WITH_PHP, test "$build_php" = "yes")
211
212 dnl =======================================================================================
213
214 AC_CHECK_PROG(have_perl, "perl", yes, no)
215
216 build_perl=$have_perl
217
218 AC_ARG_ENABLE([perl],
219 [AS_HELP_STRING([--disable-perl],
220 [do not build perl binding])],
221 [build_perl=no], [build_perl=$have_perl])
222
223 AC_ARG_WITH(perl-sitelib-dir,
224 [AS_HELP_STRING([--with-perl-sitelib-dir=PATH],
225 [path to perl site lib])])
226
227 if test "$have_perl" = "yes"; then
228 PE_PREFIX=`(perl -e 'use Config; print $Config{archlib};')`
229 AC_MSG_CHECKING(for $PE_PREFIX/CORE/perl.h)
230 if test -f $PE_PREFIX/CORE/perl.h; then
231 AC_MSG_RESULT(yes)
232 PE_CFLAGS="-I$PE_PREFIX/CORE "
233 PE_CFLAGS=$PE_CFLAGS`(perl -e 'use Config; print $Config{cppflags};')`
234
235 if test "$with_perl_sitelib_dir" = "" ; then
236 PE_MODULES_PATH=`(perl -e 'use Config; print $Config{sitelib};')`
237 else
238 PE_MODULES_PATH=$with_perl_sitelib_dir
239 fi
240
241 AC_SUBST([PE_CFLAGS])
242 AC_SUBST([PE_MODULES_PATH])
243 if test "x$have_swig" = "xno"; then
244 build_perl=no
245 fi
246 else
247 AC_MSG_RESULT(no)
248 build_perl=no
249 fi
250 fi
251
252 AM_CONDITIONAL(WITH_PERL, test "$build_perl" = "yes")
253
254 dnl =======================================================================================
255
256 dnl gettext
257
258 dnl Languages which your application supports
259 ALL_LINGUAS="he es_MX ru fr sv"
260 AM_GNU_GETTEXT([external])
261 AM_GNU_GETTEXT_VERSION([0.18.1])
262
263 if test "$DATADIRNAME" = ""; then
264 DATADIRNAME="share"
265 AC_SUBST(DATADIRNAME)
266 fi
267
268 localepath=`eval eval echo ${localedir}`
269
270 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${localepath}")
271
272 dnl =======================================================================================
273
274 build_hcal=yes
275
276 AC_ARG_ENABLE([hcal],
277 [AS_HELP_STRING([--disable-hcal],
278 [do not build hcal/hdate utility programs])],
279 [build_hcal=no], [build_hcal=yes])
280
281 AM_CONDITIONAL(WITH_HCAL, test "$build_hcal" = "yes")
282
283 dnl =======================================================================================
284
285 AC_SUBST(CFLAGS)
286 AC_SUBST(LIBS)
287
288 dnl =======================================================================================
289
290 AC_OUTPUT([
291 Makefile
292 libhdate.pc
293 po/Makefile.in
294 docs/Makefile
295 docs/man/Makefile
296 docs/man/man1/Makefile
297 docs/man/man3/Makefile
298 src/Makefile
299 examples/Makefile
300 examples/hcal/Makefile
301 examples/bindings/Makefile
302 examples/bindings/pascal/Makefile
303 bindings/Makefile
304 bindings/python/Makefile
305 bindings/perl/Makefile
306 bindings/pascal/Makefile
307 bindings/ruby/Makefile
308 bindings/php/Makefile
309 ])
310
311 dnl ===========================================================================================
312
313 echo "
314 $PACKAGE-$VERSION
315
316 prefix: ${prefix}
317 compiler: ${CC}
318 locale-dir: $localepath
319
320 have swig ${have_swig}
321 have free pascal ${have_fpc}
322 have gnu pascal ${have_gpc}
323 have python ${have_python}
324 have perl ${have_perl}
325 have ruby ${have_ruby}
326 have php ${have_php} php-dev,php-cli ${have_php_config}
327
328 build hcal ${build_hcal}
329
330 build python binding ${build_python}
331 build perl binding ${build_perl}
332 puild free pascal binding ${build_fpc}
333 puild ruby binding ${build_ruby}
334 puild php binding ${build_php}
335
336 perl site lib path: $PE_MODULES_PATH
337 python site lib path: $PY_MODULES_PATH
338 free pascal site lib path: $PA_MODULES_PATH
339 gnu pascal site lib path: $GP_MODULES_PATH
340 ruby site lib path: $RU_MODULES_PATH
341 php site lib path: $PH_MODULES_PATH
342 php config path: $PH_CONFIG_PATH
343 php include path: $PH_INCLUDE_PATH
344 "
0 /* hcal.c http://libhdate.sourceforge.net
1 * Hebrew calendar (part of package libhdate)
2 *
3 * compile:
4 * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal
5 *
6 * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #include <stdio.h> // For printf
23 #include <hdate.h> // For hebrew date
24 //#include "../../src/hdate.h"
25 #include <stdlib.h> // For atoi, malloc
26 #include <locale.h> // For setlocale
27 #include <getopt.h> // For getopt_long
28 #include <string.h> // For strlen, mempcpy
29 #include <time.h> // For time, tzset
30 //#include <wchar.h> // for unicode character operations
31
32 #define FALSE 0
33 #define TRUE -1
34 #define SHABBAT 7
35
36 #define HDATE_STRING_SHORT 1
37
38 // for opt.menu[MAX_MENU_ITEMS]
39 #define MAX_MENU_ITEMS 10
40
41
42
43 // for colorization
44 #define CODE_REVERSE_VIDEO "%c[7m", 27
45 #define CODE_RESTORE_VIDEO "%c[m", 27
46 #define CODE_BLACK "%c[30m", 27
47 #define CODE_LIGHT_RED "%c[31m", 27
48 #define CODE_LIGHT_GREEN "%c[32m", 27
49 #define CODE_LIGHT_BROWN "%c[33m", 27
50 #define CODE_DARK_BLUE "%c[34m", 27
51 #define CODE_LIGHT_PURPLE "%c[35m", 27
52 #define CODE_LIGHT_AQUA "%c[36m", 27
53 #define CODE_LIGHT_GREY "%c[37m", 27
54 #define CODE_BOLD_GREY "%c[1;30m", 27
55 #define CODE_BOLD_RED "%c[1;31m", 27
56 #define CODE_BOLD_GREEN "%c[1;32m", 27
57 #define CODE_BOLD_YELLOW "%c[1;33m", 27
58 #define CODE_BOLD_BLUE "%c[1;34m", 27
59 #define CODE_BOLD_PURPLE "%c[1;35m", 27
60 #define CODE_BOLD_AQUA "%c[1;36m", 27
61 #define CODE_BOLD_WHITE "%c[1;37m", 27
62 #define ELEMENT_WEEKDAY_G 1
63 #define ELEMENT_WEEKDAY_H 2
64 #define ELEMENT_SHABBAT_DAY 3
65 #define ELEMENT_HOLIDAY_DAY 4
66 #define ELEMENT_HOLIDAY_FLAG 5
67 #define ELEMENT_SHABBAT_NAME 6
68 #define ELEMENT_WEEKDAY_NAMES 7
69 #define ELEMENT_MONTH_G 8
70 #define ELEMENT_MONTH_H 9
71 #define ELEMENT_SHABBAT_TIMES 10
72 #define ELEMENT_PARASHA 11
73 #define ELEMENT_THIS_SHABBAT_TIMES 12
74 #define ELEMENT_THIS_PARASHA 13
75 #define ELEMENT_HOLIDAY_NAME 14
76 #define ELEMENT_TODAY_HOLIDAY_DAY 15
77 #define ELEMENT_TODAY_HOLIDAY_NAME 16
78
79 /**************************************************
80 * functions to support hcal and hdate
81 **************************************************/
82 #include "./local_functions.c"
83
84
85
86 static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' };
87 /* Holiday types: (reference hdate_holyday.c)
88 / - 0 - Regular day
89 + - 1 - Yom tov (plus yom kippor)
90 * - 2 - Erev yom kippur
91 ~ - 3 - Hol hamoed
92 ! - 4 - Hanuka and purim
93 @ - 5 - Tzomot
94 # - 6 - Independance day and Yom yerushalaim
95 $ - 7 - Lag baomer ,Tu beav, Tu beshvat
96 % - 8 - Tzahal and Holocaust memorial days
97 ^ - 9 - National days
98 */
99
100
101
102 typedef struct {
103 int html;
104 int external_css;
105 int diaspora;
106 int parasha;
107 int shabbat;
108 int candles;
109 int havdalah;
110 int no_reverse;
111 int three_month;
112 int colorize;
113 int footnote;
114 int jd_today_g;
115 int jd_today_h;
116 int force_hebrew;
117 int force_israel;
118 int not_sunset_aware;
119 int quiet_alerts;
120 int bidi;
121 double lat;
122 double lon;
123 int tz;
124 int menu;
125 char* menu_item[MAX_MENU_ITEMS];
126 } option_list;
127
128 typedef struct {
129 int g_month_1;
130 int g_year_1;
131 int g_month_2;
132 int g_year_2;
133 int h_month_1;
134 int h_year_1;
135 int h_month_2;
136 int h_year_2;
137 } header_info;
138
139
140 const char* hcal_config_file_text = N_("\
141 # configuration file for hcal - Hebrew calendar program\n\
142 # part of package libhdate\n\
143 #\n# Should you mangle this file and wish to restore its default content,\n\
144 # rename or delete this file and run hcal; hcal will automatically\n\
145 # regenerate the default content.\n#\n\
146 # Your system administrator can set system-wide defaults for hcal by\n\
147 # modifying file <not yet implemented>.\n\
148 # You may override all defaults by changing the contents of this file.\n\
149 #\n\
150 # Version information\n\
151 # This may be used by updates to hcal to determine how to parse the file\n\
152 # and whether additional information and options should be appended to\n\
153 # the end of this file.\n\
154 VERSION=2.00\n\
155 # Location awareness\n\
156 # hcal wants to accurately highlight the current Hebrew day, including\n\
157 # during the hours between sunset and secular midnight. If you don't\n\
158 # provide it with latitude, longitude, and time zone information, hcal\n\
159 # will try to guess the information, based upon your system timezone,\n\
160 # and its (limited, and maybe biased) of the dominant Jewish community\n\
161 # in that timezone. When hcal is forced to guess, it alerts the user\n\
162 # with a message that includes the guessed location.\n\
163 # hcal's guesses will also affect its default behaviour for output of\n\
164 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\
165 #SUNSET_AWARE=TRUE\n\
166 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
167 # degrees[:minutes[:seconds]] with the characters :'\" as possible\n\
168 # delimiters. Use negative values to indicate South and West, or\n\
169 # use the abbreviated compass directions N, S, E, W.\n\
170 #LATITUDE=\n\
171 #LONGITUDE=\n\
172 # TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\
173 # with the characters :'\" as possible delimiters.\n\
174 #TIMEZONE=\n\n\
175 # Israel and the diaspora\n\
176 # If hcal guesses that you're not in Israel, the DIASPORA option will be\n\
177 # set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\
178 # forces hcal to display calendar information for Israel, using hcal's\n\
179 # default coordinates foe Israel, or coordinates that you provide that\n\
180 # seem legitmately within Israel.\n\
181 # Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\
182 # Sukkot, set BOTH flags true in order to see holiday information for\n\
183 # a non-resident vistor to Israel. The command line options for these\n\
184 # features are --israel, -I, --diaspora, -d.\n\
185 #FORCE_DIASPORA=FALSE;\n\
186 #FORCE_ISRAEL=FALSE;\n\n\
187 # Shabbat related\n\
188 # Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\
189 # The command line options for these features are -p (--parasha), and\n\
190 # -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\
191 # before sunset). The HAVDALAH field can accept a value of 20 - 90\n\
192 # (minutes after sunset).\n\
193 #PARASHA_NAMES=FALSE\n\
194 #SHABBAT_INFO=FALSE\n\
195 #CANDLE_LIGHTING=FALSE\n\
196 #HAVDALAH=FALSE\n\n\
197 # Holiday identification\n\
198 # hcal flags holidays by replacing the gregorian/Hebrew date separator\n\
199 # with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\
200 # will have hcal output after the month's calendar, a list of the month's\n\
201 # holidays along with the days on which they occur.\n\
202 #FOOTNOTE=FALSE\n\n\
203 # Output in hebrew characters\n\
204 # hcal defaults to output all information in your default language, so\n\
205 # if your default language is Hebrew, you're all set. Otherwise, you can\n\
206 # set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\
207 # still outputting gregorian information in your default language. To\n\
208 # output ALL information in Hebrew, run something like this:\n\
209 # LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\
210 # If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\
211 # output, you need to install a terminal font that includes the Hebrew\n\
212 # character set (hint: unicode).\n\
213 # The command line option for FORCE_HEBREW is either --hebrew or -H\n\
214 #FORCE_HEBREW=FALSE\n\n\
215 # The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\
216 # Unfortunately, the world can not be depended upon to be either. Most\n\
217 # Xwindow applications will display the data fine with FORCE_HEBREW; most\n\
218 # xterm implementations will not. (in fact, the only xterm clone I know\n\
219 # of that comes close is mlterm). If using FORCE_HEBREW results in\n\
220 # Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\
221 # This will reverse the order of the Hebrew characters, so they will\n\
222 # display 'visual'ly correct; however, such output will not be suitable\n\
223 # for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\
224 # automatically forces hebrew.\n\
225 # The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\
226 #OUTPUT_BIDI=FALSE\n\n\
227 # Display enhancements\n\
228 # hcal defaults to display the current day in reverse video\n\
229 # The command line option for this feature is --no-reverse\n\
230 #SUPPRESS_REVERSE_VIDEO=FALSE;\n\
231 # hcal can display its output \"calming, muted tones\". Note that piping\n\
232 # colorized output may yield unexpected results.\n\
233 #COLORIZE=FALSE\n\n\
234 # HTML OUTPUT\n\
235 #OUTPUT_HTML=FALSE\n\
236 #USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\
237 # Suppress alerts and warnings\n\
238 # hcal alerts the user via STDERR when it guesses the user's location.\n\
239 #QUIET_ALERTS=FALSE\n\n\
240 # Three month display\n\
241 # hcal can display a previous, current and next month side-by-side. hcal\n\
242 # can also display a calendar for an entire year in four rows of three\n\
243 # months each. Note that this will display properly only if your console\n\
244 # is set for at least 127 columns. Note also that setting this option to\n\
245 # will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\
246 #THREE_MONTH=FALSE\n\n\
247 # User-defined menus\n\
248 # You may specify here command-line strings to optionally be parsed\n\
249 # by hcal at execution time. To do so, use the command line option -m\n\
250 # (--menu). hcal will process first the settings of this config file,\n\
251 # then the other settings of your command line, and then will prompt\n\
252 # you for which menu item you would like to select. hcal will process\n\
253 # your menu selection as if it were a new command line, further modifying\n\
254 # all the prior settings.\n\
255 # Only the first ten \"MENU=\" entries will be read. Each line will be\n\
256 # truncated at one hundred characters\n\
257 #MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\
258 #MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\
259 #MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\
260 #MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\
261 ");
262
263
264 /**************************************************
265 * print version
266 *************************************************/
267 int print_version ()
268 {
269 printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6"));
270 return 0;
271 }
272
273 /**************************************************
274 * print usage
275 *************************************************/
276 void print_usage_hcal ()
277 {
278 printf ("%s\n",
279 N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\
280 coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\
281 -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\
282 timezone: -z nn[( .nn | :mm )]\n\
283 Try \'hcal --help\' for more information"));
284 }
285
286 /**************************************************
287 * print help
288 *************************************************/
289 void print_help ()
290 {
291 print_usage_hcal();
292 printf ("%s\n",
293 N_("Hebrew calendar\nOPTIONS:\n\
294 -1 --one-month over-ride config file setting if you had set\n\
295 option --three-month as a default there\n\
296 -3 --three-month displays previous/next months\n\
297 side by side. requires 127 columns\n\
298 -b --bidi prints hebrew in reverse (visual)\n\
299 --visual\n\
300 --no-bidi over-ride config file setting if you had set\n\
301 --no-visual option -bidi as a default there\n\
302 -c --colorize displays in calming, muted tones\n\
303 --no-color over-ride a --colorize setting in your config file\n\
304 -d --diaspora use diaspora reading and holidays.\n\
305 -f --footnote print descriptive notes of holidays\n\
306 --no-footnote over-ride a footnote setting in your config file\n\
307 -h --html output in html format to stdout\n\
308 -H --hebrew print hebrew information in Hebrew\n\
309 -i use external css file \"./hcal.css\".\n\
310 -I --israel override a diaspora default\n\
311 --no-reverse do not highlight today's date\n\
312 -m --menu prompt user-defined menu from config file\n\
313 -p --parasha print week's parasha on each calendar row\n\
314 -q --quiet-alerts suppress warning messages\n\
315 -s --shabbat print Shabbat times and parshiot\n\
316 --candles modify default minhag of 20 minutes. (17<n<91)\n\
317 --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n\
318 -z --timezone nn timezone, +/-UTC\n\
319 -l --latitude yy latitude yy degrees. Negative values are South\n\
320 -L --longitude xx longitude xx degrees. Negative values are West\n\n\
321 All options can be made default in the config file, or menu-ized for\n\
322 easy selection."));
323 }
324
325
326 /**************************************************
327 * HTML - print css section
328 *************************************************/
329 int print_css (const int external_css)
330 {
331 if (external_css) printf ("\n\t@import \"hcal.css\";\n");
332 else
333 {
334 printf ("\nbody.hebrew { direction: rtl;}\n\
335 img { margin:0; padding: 0; vertical-align: middle; border: 0;}\n\
336 p {}\n\
337 table.main { width: 90%%; table-layout: fixed; font-size: 14pt; border: solid #aaaaaa; }\n\
338 table.day { width: 100%%; height: 100%%; table-layout: fixed; font-size: 14pt; }\n\
339 th.gmonth { font-size: 30pt; font-weight: bold }\n\
340 th.gyear { font-size: 30pt; font-weight: bold}\n\
341 th.hmonth { font-size: 30pt; font-weight: bold}\n\
342 th.hyear {font-size: 30pt; font-weight: bold }\n\
343 th.week { background-color: #aaaaaa; text-align: center; }\n\
344 td.gday { font-size: 30pt; vertical-align: top; }\n\
345 td.hday { font-size: 12pt; vertical-align: top; }\n\
346 td.sat { border: solid #777777; }\n\
347 td.regular { border: solid #aaaaaa; }\n\
348 td.holiday { color: #990000; border: solid #888888; }\n\
349 td.out_of_month { color: #dddddd; border: solid #dddddd; }\n\
350 tr.line1 { height: 30%%; }\n\
351 tr.line2 { height: 50%%; font-size: 30pt; }\n\
352 tr.line3 { height: 20%%; font-size: 12pt; vertical-align: bottom; }\n\
353 span.today { }\n\
354 span.gmonth { font-size: 24pt; }\n\
355 span.gyear { font-size: 24pt; }\n\
356 span.hmonth { font-size: 24pt; }\n\
357 span.hyear { font-size: 24pt; }\n\
358 span.holiday_name { }\n");
359 }
360
361 return 0;
362 }
363
364
365
366 /**************************************************
367 * HTML - print header
368 *************************************************/
369 int print_header_html ( const int external_css, const int force_hebrew)
370 {
371 printf ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\n\
372 <html>\n\
373 <head>\n\
374 <meta name=\"generator\" content=\"hcal (libhdate)\">\n\
375 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\
376 <style title=\"Normal\" type=\"text/css\" media=\"all\">");
377
378 print_css (external_css);
379
380 printf ("</style>\n");
381
382 /* some alternative css styles */
383 printf ("\n\
384 <link rel=\"alternate stylesheet\" title=\"High contrast\" type=\"text/css\" media=\"screen\" href=\"high_contrast.css\">\n\
385 <link rel=\"alternate stylesheet\" title=\"Colorful\" type=\"text/css\" media=\"screen\" href=\"colorful.css\">\n\
386 <link rel=\"alternate stylesheet\" title=\"Print\" type=\"text/css\" media=\"all\" href=\"print.css\">\n");
387
388 if ( (force_hebrew) || (hdate_is_hebrew_locale()) )
389 printf ("<title>Hebrew Calendar</title>\n</head>\n<body class=\"hebrew\"><center>\n");
390 else
391 printf ("<title>Hebrew Calendar</title>\n</head>\n<body><center>\n");
392
393 return 0;
394 }
395
396
397
398 /**************************************************
399 * HTML - print footer
400 *************************************************/
401 int print_html_footer ()
402 {
403 printf ("<!-- <p>\n\
404 <a href=\"http://validator.w3.org/check/referer\">\n<img \
405 src=\"http://www.w3.org/Icons/valid-html401\"\n\
406 alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\" />\n</a>\n");
407 printf ("<a href=\"http://jigsaw.w3.org/css-validator\">\n\
408 <img src=\"http://www.w3.org/Icons/valid-css\" alt=\"Valid CSS!\">\n\
409 </a>\n</p> -->\n");
410
411 printf ("</body></html>\n");
412
413 return 0;
414 }
415
416
417 /**************************************************
418 * Print HTML header - month line
419 *************************************************/
420 void print_header_month_line_html( const header_info header)
421 {
422
423 // TODO - fix bug ellul xxxx - tishrei xxxx+1
424 // char *h_year_1;
425 // h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE);
426 // char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1];
427 char *h_year_1 = NULL;
428
429 /**************************************************
430 * Print Gregorian month and year
431 **************************************************/
432 printf ("<table width=90%%><tr><td align=left><span class=\"gmonth\">%s <span class=\"gyear\">%d</span></td>\n",
433 hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL),
434 header.g_year_1);
435
436 h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW);
437 /**************************************************
438 * Print Hebrew month and year
439 **************************************************/
440 printf ("<td align=right><span class=\"hmonth\">");
441 if (header.h_month_1 != header.h_month_2)
442 {
443 printf ("%s-",
444 hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
445 }
446 printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
447 printf ("</span>\n");
448 printf ("<span class=\"hyear\">%s</span></td></tr></table>\n", h_year_1);
449
450 printf ("<span class=\"month_table\">\n<table class=main>\n");
451
452
453 if (h_year_1 != NULL) free(h_year_1);
454 }
455
456
457 /**************************************************
458 * HTML - print column headings for days of weeks
459 **************************************************/
460 void print_header_dow_line_html()
461 {
462 int j;
463
464 for (j = 1; j < 8; j++)
465 printf ("<th class=\"week\">%3s</th>",
466 hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE));
467 }
468
469
470
471 /**************************************************
472 * end HTML functions
473 *************************************************/
474
475
476 /*************************************************
477 * Display data in a more pleasing visual manner
478 *************************************************/
479 void colorize_element ( const int element )
480 {
481 switch (element) {
482 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
483 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break;
484 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
485 case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break;
486 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
487 case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break;
488 case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break;
489 case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break;
490 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break;
491 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
492 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
493 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
494 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
495 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
496 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
497 }
498 /* switch (element) {
499 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
500 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break;
501 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
502 case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break;
503 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
504 case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break;
505 case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break;
506 case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break;
507 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break;
508 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
509 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
510 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
511 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
512 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
513 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
514 */
515 }
516
517
518
519 /**************************************************
520 * print header - month line to stdout
521 *************************************************/
522 void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi )
523 {
524 char *g_month, *h1_month, *h2_month;
525 char *h1_year = NULL;
526 char *h2_year = NULL;
527 size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len;
528
529
530 char *hebrew_buffer, *hebrew_buffer_next;
531 size_t hebrew_buffer_len, literals_len;
532
533 int j;
534 size_t padding = 0;
535
536
537 /**************************************************
538 * Print Gregorian month and year
539 *************************************************/
540 g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL);
541 if (colorize) colorize_element(ELEMENT_MONTH_G);
542 printf ("%s %d", g_month, header.g_year_1);
543 if (colorize) printf(CODE_RESTORE_VIDEO);
544
545 /**************************************************
546 * Print Hebrew month and year
547 *
548 * because we want this printed right-justified on
549 * the same line, we need to calculate how many
550 * spaces to pad.
551 *
552 * because of the possible user option --bidi, we
553 * need to buffer the entire Hebrew text in order
554 * reverse its sequence for 'visual' display.
555 *
556 * This all requires collecting the data first
557 * and determining each's length.
558 *************************************************/
559
560 #define CALENDAR_WIDTH 41
561 #define DASH_WIDTH 3 // includes surrounding spaces
562 #define SPACE_WIDTH 1
563
564
565 /*************************************************
566 * padding info for gregorian date
567 *************************************************/
568 g_month_len = strlen(g_month);
569 g_year_len = 4;
570 switch (header.g_year_1)
571 {
572 case 1-9: g_year_len = 1; break;
573 case 10-99: g_year_len = 2; break;
574 case 100-999: g_year_len = 3; break;
575 }
576
577
578 /**************************************************
579 * collect padding info for Hebrew date
580 *************************************************/
581 h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew);
582 h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew);
583 //printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0);
584
585 h1_month_len = strlen(h1_month);
586 h1_year_len = strlen(h1_year);
587 // DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len);
588 // DEBUG - int ii; for (ii=0; ii<h1_year_len; ii++) printf("%x ",h1_year[ii]);
589
590 if (header.h_year_1 != header.h_year_2)
591 {
592
593 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
594 h2_year = hdate_string(HDATE_STRING_INT, header.h_year_2, HDATE_STRING_LONG,force_hebrew);
595
596 h2_month_len = strlen(h2_month);
597 h2_year_len = strlen(h2_year);
598 literals_len = SPACE_WIDTH + DASH_WIDTH + SPACE_WIDTH;
599
600 hebrew_buffer_len = h1_month_len + h1_year_len + h2_month_len
601 + h2_year_len + literals_len;
602
603 // printf("\nlength values = %d %d %d %d %d %d\n",h1_month_len , h1_year_len , DASH_WIDTH, h2_month_len, SPACE_WIDTH , h2_year_len);
604 hebrew_buffer = malloc(hebrew_buffer_len+1);
605 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
606 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
607 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
608 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
609 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
610 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
611 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_year, h2_year_len);
612 hebrew_buffer[hebrew_buffer_len]='\0';
613
614 // printf("\nbuffer length = %d\nbuffer contents = %s\n",hebrew_buffer_len, hebrew_buffer); exit(0);
615 // free(hebrew_buffer);
616 }
617 else if (header.h_month_1 != header.h_month_2)
618 {
619 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
620 h2_month_len = strlen(h2_month);
621 literals_len = DASH_WIDTH + SPACE_WIDTH;
622
623 hebrew_buffer_len = h1_month_len + h2_month_len + h1_year_len + literals_len;
624 hebrew_buffer = malloc(hebrew_buffer_len+1);
625 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
626 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
627 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
628 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
629 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
630 hebrew_buffer[hebrew_buffer_len]='\0';
631 }
632 else
633 {
634 h2_month_len = 0;
635 h2_year_len = 0;
636 literals_len = SPACE_WIDTH;
637
638 hebrew_buffer_len = h1_month_len + h1_year_len + literals_len;
639
640 hebrew_buffer = malloc(hebrew_buffer_len+1);
641 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
642 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
643 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
644 hebrew_buffer[hebrew_buffer_len]='\0';
645 }
646
647 if (!force_hebrew)
648 padding = CALENDAR_WIDTH - g_month_len - g_year_len - hebrew_buffer_len ;
649 else
650 padding = CALENDAR_WIDTH - g_month_len - g_year_len - (hebrew_buffer_len/2) - literals_len +1;
651
652
653
654 /**************************************************
655 * print padding
656 *************************************************/
657 for (j = 1; j < (int)padding; j++) printf(" ");
658
659
660 /**************************************************
661 * Print Hebrew month and year
662 *************************************************/
663 if (colorize) colorize_element(ELEMENT_MONTH_H);
664 if (visual_bidi) revstr(hebrew_buffer, hebrew_buffer_len);
665 printf ("%s", hebrew_buffer);
666 if (colorize) printf(CODE_RESTORE_VIDEO);
667
668
669 /**************************************************
670 * free allocated memory
671 *************************************************/
672 if (h1_year != NULL) free(h1_year);
673 // if (header.h_year_1 != header.h_year_2) free(h2_year);
674 if (h2_year != NULL) free(h2_year);
675 free(hebrew_buffer);
676 }
677
678
679 /**************************************************
680 * print column headings for days of weeks
681 **************************************************/
682 void print_header_dow_line_stdout( const int colorize )
683 {
684 int column;
685
686 void print_dow_column( int column )
687 {
688 if (hdate_is_hebrew_locale())
689 { /* Hebrew heading is a single charcter per day */
690 printf ("%s%s%s", " ",
691 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_HEBREW),
692 " ");
693 }
694 else
695 { /* presume three character heading */
696 printf ("%s%3s", " ",
697 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_LOCAL));
698 }
699
700 if (column != 7) printf (" ");
701 }
702
703 if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES);
704 for (column = 1; column < 7; column++) print_dow_column(column);
705 if (colorize) colorize_element(ELEMENT_SHABBAT_NAME);
706 print_dow_column(7);
707 if (colorize) printf(CODE_RESTORE_VIDEO);
708 }
709
710
711
712 /**************************************************
713 * calculate start/end month/year for a calendar
714 **************************************************/
715 header_info calculate_calendar_start_end (const int month, const int year)
716 {
717 hdate_struct h;
718 header_info header;
719
720 hdate_set_gdate (&h, 1, month, year);
721 header.g_month_1 = h.gd_mon;
722 header.g_year_1 = h.gd_year;
723 header.h_month_1 = h.hd_mon;
724 header.h_year_1 = h.hd_year;
725
726
727 hdate_set_jd ( &h, hdate_gdate_to_jd ( 1, month % 12 + 1, ((month==12) ? year+1 : year) ) - 1 );
728 header.g_month_2 = h.gd_mon;
729 header.g_year_2 = h.gd_year;
730 header.h_month_2 = h.hd_mon;
731 header.h_year_2 = h.hd_year;
732
733 return header;
734 }
735
736
737 /**************************************************
738 * print header - year and month
739 *************************************************/
740 int print_header ( const int month, const int year, const option_list opt)
741 {
742 header_info previous_month, current_month, next_month;
743
744
745 /**********************************************************
746 * Preliminary - set dates for begining and end of calendar
747 **********************************************************/
748 current_month = calculate_calendar_start_end(month, year);
749 if (opt.three_month)
750 {
751 previous_month = calculate_calendar_start_end(
752 (month==1 ? 12 : month-1), (month==1 ? year-1 : year) );
753 next_month = calculate_calendar_start_end(
754 (month==12 ? 1 : month+1), (month==12 ? year+1: year) );
755 }
756
757 /**************************************************
758 * HTML output - month header line
759 *************************************************/
760 if (opt.html) print_header_month_line_html(current_month);
761
762
763 /**************************************************
764 * STDOUT output - month header line
765 *************************************************/
766 else
767 {
768 if (opt.three_month)
769 {
770 print_header_month_line_stdout(previous_month, opt.colorize, opt.force_hebrew, opt.bidi);
771 printf(" ");
772 }
773
774 print_header_month_line_stdout(current_month, opt.colorize, opt.force_hebrew, opt.bidi);
775
776 if (opt.three_month)
777 {
778 printf(" ");
779 print_header_month_line_stdout(next_month, opt.colorize, opt.force_hebrew, opt.bidi);
780 }
781 }
782
783 /**************************************************
784 * terminate line
785 **************************************************/
786 if (opt.html) printf ("</tr>\n");
787 else printf ("\n");
788
789
790 /**************************************************
791 * print column headings for days of weeks
792 **************************************************/
793 if (opt.html) print_header_dow_line_html();
794 else
795 {
796 if (opt.three_month)
797 {
798 print_header_dow_line_stdout(opt.colorize);
799 printf(" ");
800 }
801 print_header_dow_line_stdout(opt.colorize);
802 if (opt.three_month)
803 {
804 printf(" ");
805 print_header_dow_line_stdout(opt.colorize);
806 }
807 }
808
809 /**************************************************
810 * terminate line
811 **************************************************/
812 if (opt.html) printf ("</tr>\n");
813 else printf ("\n");
814
815 return 0;
816 }
817
818
819 /**************************************************
820 * print HTML calendar entry (ie. a single day)
821 *************************************************/
822 void print_day_html ( const hdate_struct h, const int month, const option_list opt)
823 {
824
825 int holiday_type;
826 // char *hd_day;
827 // hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE);
828 // char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
829 char *hd_day_str = NULL;
830
831 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
832
833
834 if (h.gd_mon != month) printf ("<td class=\"out_of_month\">");
835 else if (h.hd_dw == SHABBAT) printf ("<td class=\"sat\">");
836 else if (holiday_type) printf ("<td class=\"holiday\">");
837 else printf ("<td class=\"regular\">");
838
839 /* Print a day */
840 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew);
841 printf ("<table class=day><tr class=line1><td class=\"gday\">%2d</td>\n\
842 <td class=\"hday\">%3s&nbsp;%s</td></tr><tr class=line2><td>&nbsp;</td></tr>",
843 h.gd_day,
844 hd_day_str,
845 hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew));
846 if (holiday_type) printf ("<tr class=line3><td class=\"holiday_name\">%s</td></tr>",
847 hdate_string( HDATE_STRING_HOLIDAY,
848 hdate_get_holyday (&h, opt.diaspora),
849 HDATE_STRING_SHORT, HDATE_STRING_LOCAL)
850 );
851 else printf ("<tr class=line3><td class=\"holiday_name\">&nbsp;</td></tr>");
852
853 printf ("</table></td>\n");
854
855 if (hd_day_str != NULL) free(hd_day_str);
856 }
857
858
859 /*************************************************
860 * print stdout calendar entry (ie. a single day)
861 *************************************************/
862 void print_day ( const hdate_struct h, const int month, const option_list opt)
863 {
864
865 // for forcing Hebrew printing of Hebrew data
866 //char *language;
867
868 // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
869 // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1);
870 char *hd_day_str = NULL;
871
872 size_t hd_day_buffer_str_len;
873
874 int holiday_type;
875 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
876
877 /**************************************************
878 * out of month - needs padding
879 *************************************************/
880 if (h.gd_mon != month) printf(" ");
881
882
883 /**************************************************
884 * in month - print the data
885 *************************************************/
886 else
887 {
888 /*************************************************
889 * Gregorian date entry - color prefix
890 *************************************************/
891 if (h.hd_jd == opt.jd_today_g)
892 printf (CODE_REVERSE_VIDEO);
893 else if (opt.colorize)
894 {
895 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
896 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
897 else colorize_element(ELEMENT_WEEKDAY_G);
898 }
899
900 /*************************************************
901 * Gregorian date entry - the day of the month
902 *************************************************/
903 // this next line is necessary to align numbers
904 // correctly with bidi (tested using mlterm)
905 if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) )
906 printf ("%d ", h.gd_day);
907 else printf ("%2d", h.gd_day);
908
909 /*************************************************
910 * Gregorian date entry - color cleanup
911 *************************************************/
912 if ((h.hd_jd == opt.jd_today_g) || (opt.colorize))
913 printf (CODE_RESTORE_VIDEO);
914
915
916 /*************************************************
917 * holiday flag
918 *************************************************/
919 printf ("%c", holiday_flag[holiday_type]);
920
921
922 /*************************************************
923 * Hebrew date entry - color prefix
924 *************************************************/
925 if (h.hd_jd == opt.jd_today_h)
926 printf (CODE_REVERSE_VIDEO);
927 else if (opt.colorize)
928 {
929 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
930 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
931 else colorize_element(ELEMENT_WEEKDAY_H);
932 }
933
934
935 /*************************************************
936 * Hebrew date entry - day of the month
937 *************************************************/
938 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew);
939 if (opt.bidi)
940 {
941 hd_day_buffer_str_len = (size_t) strlen(hd_day_str);
942 if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE)
943 hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1;
944 revstr(hd_day_str, hd_day_buffer_str_len);
945 }
946 if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) &&
947 ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) )
948 { // need to pad Hebrew dates 1-10, 20, 30
949 printf ("%s%s"," ",hd_day_str);
950 }
951 else printf ("%2s", hd_day_str);
952
953 /*************************************************
954 * Hebrew date entry - color cleanup
955 *************************************************/
956 if ((h.hd_jd == opt.jd_today_h) || (opt.colorize))
957 printf (CODE_RESTORE_VIDEO);
958
959 }
960
961 if (hd_day_str != NULL) free(hd_day_str);
962 }
963
964
965 /*************************************************
966 * print a calendar week's entry (ie. seven columns)
967 *************************************************/
968 void print_week( int jd, const int month, const option_list opt)
969 {
970 #define long_parasha_name 0
971
972 hdate_struct h;
973
974 int calendar_column;
975
976 // for opt.shabbat
977 int sun_hour, first_light, talit, sunrise;
978 int midday, sunset, first_stars, three_stars;
979 int this_week;
980 hdate_struct yom_shishi;
981
982 // for opt.parasha
983 int shabbat_name;
984 char *shabbat_name_str, *shabbat_name_buffer;
985 size_t shabbat_name_str_len;
986
987
988 // for forcing Hebrew printing of Hebrew data
989 //char *language;
990
991
992 /**************************************************
993 * for each column of calendar
994 *************************************************/
995 for (calendar_column = 0; calendar_column < 7; calendar_column++)
996 {
997
998 /**************************************************
999 * Get this day's information
1000 *************************************************/
1001 hdate_set_jd (&h, jd);
1002 if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) )
1003 yom_shishi = h;
1004
1005
1006 /**************************************************
1007 * HTML calendar option
1008 *************************************************/
1009 if (opt.html) print_day_html ( h, month, opt );
1010
1011
1012
1013 /**************************************************
1014 * non-HTML calendar option
1015 *************************************************/
1016 else print_day ( h, month, opt);
1017
1018
1019 /**************************************************
1020 * space between days of week
1021 *************************************************/
1022 if (calendar_column != 6) printf (" ");
1023
1024 /**************************************************
1025 * advance to next day of week
1026 *************************************************/
1027 jd++;
1028 }
1029
1030 /**************************************************
1031 * print end of calendar line
1032 *************************************************/
1033 if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) )
1034 {
1035
1036 /********************************************************
1037 * determine whether this line gets special highlighting
1038 ********************************************************/
1039 if ((opt.colorize)
1040 && ((opt.shabbat) || (opt.parasha))
1041 && ((jd - 1) > opt.jd_today_h)
1042 && (((jd - 1) - opt.jd_today_h) < 7) )
1043 this_week = TRUE;
1044 else this_week = FALSE;
1045
1046 /*************************************************
1047 * print shabbat times
1048 *************************************************/
1049 if (opt.shabbat)
1050 {
1051 // candlelighting times
1052 /// note: compiler incorrectly issued warnings:
1053 /// "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1054 /// The initialization occurs above (~line 1005) "yom_shishi = h"
1055 hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year,
1056 opt.lat, opt.lon, &sunrise, &sunset);
1057
1058 // FIXME - allow for further minhag variation
1059 if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz;
1060 else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES;
1061
1062 if (opt.colorize)
1063 {
1064 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1065 else colorize_element(ELEMENT_SHABBAT_TIMES);
1066 }
1067 printf (" %02d:%02d", sunset / 60, sunset % 60);
1068 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1069
1070 printf(" - ");
1071
1072 // motzay shabat time
1073 hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat,
1074 opt.lon, &sun_hour, &first_light, &talit,
1075 &sunrise, &midday, &sunset,
1076 &first_stars, &three_stars);
1077
1078 // FIXME - allow for further minhag variation
1079 if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz;
1080 else three_stars = three_stars + opt.tz;
1081
1082 if (opt.colorize)
1083 {
1084 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1085 else colorize_element(ELEMENT_SHABBAT_TIMES);
1086 }
1087 printf ("%02d:%02d", three_stars / 60, three_stars % 60);
1088 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1089 }
1090
1091
1092 /*************************************************
1093 * print shabbat name
1094 *************************************************/
1095 if (opt.parasha)
1096 {
1097
1098 /*************************************************
1099 * print shabbat name - force-hebrew setup
1100 *************************************************/
1101 // BUG - this isn't thread-safe
1102 /*if (opt.force_hebrew)
1103 {
1104 language=getenv("LANGUAGE");
1105 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1106 }*/
1107
1108
1109 shabbat_name = hdate_get_parasha (&h, opt.diaspora);
1110 if (shabbat_name) shabbat_name_str =
1111 hdate_string( HDATE_STRING_PARASHA, shabbat_name,
1112 HDATE_STRING_SHORT, opt.force_hebrew);
1113 else
1114 {
1115 shabbat_name = hdate_get_holyday(&h, opt.diaspora);
1116 if (shabbat_name) shabbat_name_str =
1117 hdate_string( HDATE_STRING_HOLIDAY,
1118 shabbat_name,
1119 HDATE_STRING_SHORT, opt.force_hebrew);
1120 }
1121 if (shabbat_name)
1122 {
1123 if (opt.colorize)
1124 {
1125 if (this_week) colorize_element(ELEMENT_THIS_PARASHA);
1126 else colorize_element(ELEMENT_PARASHA);
1127 }
1128 if (opt.bidi)
1129 {
1130 shabbat_name_str_len = strlen(shabbat_name_str);
1131 shabbat_name_buffer = malloc(shabbat_name_str_len+1);
1132 memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len);
1133 shabbat_name_buffer[shabbat_name_str_len] = '\0';
1134 revstr(shabbat_name_buffer, shabbat_name_str_len);
1135
1136 // padding - FIXME - spaces are single-byte, while
1137 // the Hebrew characters are two bytes
1138 const int margin_max = 15;
1139 printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer);
1140
1141 free(shabbat_name_buffer);
1142 }
1143 else printf(" %s", shabbat_name_str);
1144 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1145 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1146 }
1147 }
1148 }
1149 }
1150
1151
1152
1153
1154 /**************************************************
1155 * print month table
1156 *************************************************/
1157 int print_calendar ( const int current_month, const int current_year, const option_list opt)
1158 {
1159 hdate_struct h;
1160 int calendar_line;
1161 int max_calendar_lines = 4;
1162 /// the initializations on next line aren't truly necessary, but they do
1163 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1164 int previous_month = 1, next_month = 1;
1165 int previous_year, next_year;
1166 /// the initializations on next line aren't truly necessary, but they do
1167 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1168 int jd_current_month, jd_previous_month = 1, jd_next_month = 1;
1169
1170 void how_many_calendar_lines( int month, int start_dow )
1171 {
1172 switch (month)
1173 {
1174 case 4:
1175 case 6:
1176 case 9:
1177 case 11: if (start_dow == 7) max_calendar_lines = 6;
1178 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1179 break;
1180 case 1:
1181 case 3:
1182 case 5:
1183 case 7:
1184 case 8:
1185 case 10:
1186 case 12: if (start_dow > 5) max_calendar_lines = 6;
1187 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1188 break;
1189 case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5;
1190 break;
1191 }
1192 }
1193
1194 /*********************************************************
1195 * Preliminaries:
1196 * - Find the first sunday(s) of each calendar
1197 * - Find number of calendar lines
1198 *********************************************************/
1199 hdate_set_gdate (&h, 1, current_month, current_year);
1200 jd_current_month = h.hd_jd - h.hd_dw + 1;
1201 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1202
1203 /*********************************************************
1204 * three months, side-by-side
1205 *********************************************************/
1206 if (opt.three_month)
1207 {
1208 /*********************************************************
1209 * previous month
1210 *********************************************************/
1211 if (current_month == 1)
1212 {
1213 previous_month = 12;
1214 previous_year = current_year - 1;
1215 }
1216 else
1217 {
1218 previous_month = current_month - 1;
1219 previous_year = current_year;
1220 }
1221 hdate_set_gdate (&h, 1, previous_month, previous_year);
1222 jd_previous_month = h.hd_jd - h.hd_dw + 1;
1223 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1224
1225 /*********************************************************
1226 * next month
1227 *********************************************************/
1228 if (current_month == 12)
1229 {
1230 next_month = 1;
1231 next_year = current_year + 1;
1232 }
1233 else
1234 {
1235 next_month = current_month + 1;
1236 next_year = current_year;
1237 }
1238 hdate_set_gdate (&h, 1, next_month, next_year);
1239 jd_next_month = h.hd_jd - h.hd_dw + 1;
1240 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1241 }
1242
1243
1244
1245 /**************************************************
1246 * maximum six lines of calendar
1247 **************************************************/
1248 for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++)
1249 {
1250 if (opt.html) printf ("<tr>\n");
1251
1252 if (opt.three_month)
1253 {
1254 print_week(jd_previous_month, previous_month, opt);
1255 jd_previous_month = jd_previous_month + 7;
1256 printf(" ");
1257 }
1258
1259 print_week(jd_current_month, current_month, opt);
1260 jd_current_month = jd_current_month + 7;
1261
1262
1263 if (opt.three_month)
1264 {
1265 printf(" ");
1266 print_week(jd_next_month, next_month, opt);
1267 jd_next_month = jd_next_month + 7;
1268 }
1269
1270 if (opt.html) printf ("</tr>\n");
1271 else printf ("\n");
1272 }
1273
1274
1275 /**************************************************
1276 * print end of calendar
1277 *************************************************/
1278 if (opt.html) printf ("</table>\n</span>");
1279
1280 return 0;
1281 }
1282
1283
1284
1285
1286
1287
1288 /****************************************************
1289 * print month header, month table, month footnotes
1290 ****************************************************/
1291 int print_month ( const int month, const int year, const option_list opt)
1292 {
1293 hdate_struct h;
1294
1295 // following are for opt.footnote
1296 int jd_counter, holiday;
1297 //char *language; // for forcing Hebrew printing of footnote
1298
1299
1300 /* check if hebrew year (year > 3000) */
1301 if (year > 3000) hdate_set_hdate (&h, 1, month, year);
1302 else hdate_set_gdate (&h, 1, month, year);
1303
1304
1305 print_header (h.gd_mon, h.gd_year, opt);
1306 print_calendar (h.gd_mon, h.gd_year, opt);
1307 printf("\n");
1308
1309
1310 /****************************************************
1311 * print footnotes
1312 ****************************************************/
1313 if (opt.footnote)
1314 {
1315 jd_counter = h.hd_jd;
1316 while ( month == h.gd_mon )
1317 {
1318 holiday = hdate_get_holyday(&h, opt.diaspora);
1319 if (holiday)
1320 {
1321 print_day ( h, month, opt);
1322 /*if (opt.force_hebrew)
1323 {
1324 // BUG - this isn't thread-safe
1325 // --- and it may no longer be nexessary anywhere
1326 // in the code now that I've embedded Hebrew
1327 language=getenv("LANGUAGE");
1328 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1329 }*/
1330 if (opt.colorize)
1331 {
1332 if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME);
1333 else colorize_element(ELEMENT_HOLIDAY_NAME);
1334 }
1335
1336 if (opt.bidi)
1337 {
1338 char *holiday_str, *holiday_buffer;
1339 size_t holiday_str_len;
1340 holiday_str = hdate_string( HDATE_STRING_HOLIDAY,
1341 holiday,
1342 HDATE_STRING_LONG,
1343 opt.force_hebrew);
1344
1345 holiday_str_len = strlen(holiday_str);
1346 holiday_buffer = malloc(holiday_str_len+1);
1347 memcpy(holiday_buffer, holiday_str, holiday_str_len);
1348 holiday_buffer[holiday_str_len] = '\0';
1349 revstr(holiday_buffer, holiday_str_len);
1350
1351 // padding - FIXME - spaces are single-byte, while
1352 // the Hebrew characters are two bytes
1353 const int margin_max = 16; // 15 fails because of jabotinsky in july
1354 printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer);
1355
1356 free(holiday_buffer);
1357 }
1358 else printf (" %s\n",
1359 hdate_string( HDATE_STRING_HOLIDAY,
1360 holiday,
1361 HDATE_STRING_LONG,
1362 opt.force_hebrew));
1363
1364 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1365 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1366 }
1367 jd_counter++;
1368 hdate_set_jd (&h, jd_counter);
1369 }
1370 }
1371 return 0;
1372 }
1373
1374
1375 /****************************************************
1376 * read and parse config file
1377 ****************************************************/
1378 void read_config_file( FILE *config_file,
1379 option_list *opt,
1380 double* latitude,
1381 int* opt_latitude,
1382 double* longitude,
1383 int* opt_longitude,
1384 int* tz )
1385
1386 {
1387 char *input_string;
1388 size_t input_str_len = 100; // WARNING: if you change this value
1389 // you will still have to also
1390 // change a matching value below
1391 // in the statement that includes:
1392 // match_count = sscanf(input_string
1393 char *input_key = "";
1394 char *input_value = "";
1395 int line_count = 0;
1396 int menu_item = 0;
1397 size_t menu_len = 0;
1398 int match_count;
1399 int end_of_input_file = FALSE;
1400 int i;
1401 const int num_of_keys = 20;
1402 const char* key_list[] = { "SUNSET_AWARE", // 0
1403 "LATITUDE",
1404 "LONGITUDE", // 2
1405 "TIMEZONE",
1406 "DIASPORA", // 4
1407 "FORCE_ISRAEL",
1408 "PARASHA_NAMES", // 6
1409 "SHABBAT_INFO",
1410 "FOOTNOTES", // 8
1411 "FORCE_HEBREW",
1412 "OUTPUT_BIDI", //10
1413 "SUPPRESS_REVERSE_VIDEO",
1414 "COLORIZE", //12
1415 "OUTPUT_HTML",
1416 "USE_EXTERNAL_CSS_FILE",
1417 "QUIET_ALERTS",
1418 "THREE_MONTH", //16
1419 "MENU",
1420 "CANDLE_LIGHTING", //18
1421 "HAVDALAH"
1422 };
1423
1424 input_string = malloc(input_str_len+1);
1425 input_key = malloc(input_str_len+1);
1426 input_value = malloc(input_str_len+1);
1427 while ( end_of_input_file!=TRUE )
1428 {
1429 end_of_input_file = getline(&input_string, &input_str_len, config_file);
1430 if ( end_of_input_file!=TRUE )
1431 {
1432 errno = 0;
1433 // The '100' in the next statement is inelegant; it is meant to
1434 // be the value of input_str_len. Alternatively, don't malloc
1435 // input_value above, use the 'a' specifier here, and free(input_value)
1436 // at the end of every successful read and evaluation
1437 match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value);
1438 line_count++;
1439 if (errno != 0) error(0,errno,"scan error at line %d", line_count);
1440 // DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s",
1441 // line_count, match_count, input_key, input_value, input_string);
1442 if (match_count ==2)
1443 {
1444 for (i=0; i<num_of_keys; i++)
1445 {
1446 if (strcmp(input_key, key_list[i]) == 0)
1447 {
1448 // DEBUG - printf("match found!, %s = %s, index = %d\n",input_key,key_list[i],i);
1449 switch(i)
1450 {
1451
1452 case 0:if (strcmp(input_value,"FALSE") == 0) opt->not_sunset_aware = 1;
1453 else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0;
1454 break;
1455 case 1:
1456 parse_coordinate(1, input_value, latitude, opt_latitude);
1457 break;
1458 case 2:
1459 parse_coordinate(2, input_value, longitude, opt_longitude);
1460 break;
1461 case 3:
1462 parse_timezone(input_value, tz);
1463 break;
1464 case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0;
1465 else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1;
1466 break;
1467 case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0;
1468 else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1;
1469 break;
1470 case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0;
1471 else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1;
1472 break;
1473 case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0;
1474 else if (strcmp(input_value,"TRUE") == 0)
1475 {
1476 opt->shabbat = 1;
1477 opt->parasha = 1;
1478 }
1479 break;
1480 case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0;
1481 else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1;
1482 break;
1483 case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0;
1484 else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1;
1485 break;
1486 case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0;
1487 else if (strcmp(input_value,"TRUE") == 0)
1488 {
1489 opt->bidi = 1;
1490 opt->force_hebrew = 1;
1491 }
1492 break;
1493 case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0;
1494 else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1;
1495 break;
1496 case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0;
1497 else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1;
1498 break;
1499 case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0;
1500 else if (strcmp(input_value,"TRUE") == 0) opt->html = 1;
1501 break;
1502 case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0;
1503 else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1;
1504 break;
1505 case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0;
1506 else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1;
1507 break;
1508 case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0;
1509 else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1;
1510 break;
1511
1512 // MENU
1513 case 17:if (menu_item < MAX_MENU_ITEMS)
1514 {
1515 menu_len = strlen(input_value);
1516 opt->menu_item[menu_item] = malloc(menu_len+1);
1517 memcpy(opt->menu_item[menu_item], input_value,menu_len);
1518 menu_item++;
1519 }
1520 break;
1521 // CANDLE_LIGHTING
1522 case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0;
1523 else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1;
1524 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1525 {
1526 opt->candles = atoi(input_value);
1527 if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES;
1528 else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES;
1529 }
1530 break;
1531
1532 // HAVDALAH
1533 case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0;
1534 else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1;
1535 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1536 {
1537 opt->havdalah = atoi(input_value);
1538 if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES;
1539 else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES;
1540 }
1541 break;
1542
1543 } // end of switch(i)
1544 break; // if found a match don't continue for loop
1545 }
1546 }
1547 }
1548 }
1549 }
1550 free(input_string);
1551 free(input_key);
1552 free(input_value);
1553 return;
1554 }
1555
1556
1557 /****************************************************
1558 * exit elegantly
1559 ****************************************************/
1560 void exit_main( option_list *opt, const int exit_code)
1561 {
1562 int i;
1563 for (i=0; i<MAX_MENU_ITEMS; i++)
1564 {
1565 if (opt->menu_item[i] == NULL) break;
1566 free(opt->menu_item[i]);
1567 }
1568 exit (exit_code);
1569 }
1570
1571
1572 /****************************************************
1573 * parse a command-line or a config-file menu line
1574 *
1575 * It was appropriate to make this a function, outside
1576 * of main, because of its dual use and dual reference
1577 ****************************************************/
1578 int hcal_parser( const int switch_arg, option_list *opt,
1579 double *lat, int *opt_latitude,
1580 double *lon, int *opt_Longitude,
1581 int *tz, int long_option_index)
1582
1583 {
1584 int error_detected = 0;
1585
1586 switch (switch_arg)
1587 {
1588
1589 case 0: /* long options */
1590 switch (long_option_index)
1591 {
1592 /* --version */ case 0: print_version (); exit_main(opt, 0); break;
1593 /* --help */ case 1: print_help (); exit_main(opt, 0); break;
1594 /* --no-reverse */ case 2: opt->no_reverse = 1; break;
1595 /* --html */ case 3: break;
1596 /* --parasha */ case 4: break;
1597 /* --shabbat */ case 5: break;
1598 /* --three-month*/ case 6: break;
1599 /* --colorize */ case 7: break;
1600 /* --footnote */ case 8: break;
1601 /* --hebrew */ case 9: break;
1602 /* --israel */ case 10:break;
1603 /* --latitude */ case 11:break;
1604 /* --longitude */ case 12:break;
1605 /* --timezone */ case 13:break;
1606 /* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break;
1607 /* --quiet-alerts*/ case 15: break;
1608 /* --visual */ case 16:
1609 /* --bidi */ case 17: break;
1610 /* --one-month */ case 18: break;
1611 /* --no-visual */ case 19:
1612 /* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break;
1613 /* --no-color */ case 21: opt->colorize = 0; break;
1614 /* --no-footnote*/ case 22: opt->footnote = 0; break;
1615 /* --menu */ case 23: break;
1616 /* --candles */ case 24:
1617 if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1;
1618 else
1619 {
1620 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1621 {
1622 opt->candles = atoi(optarg);
1623 if ( (opt->candles >= MIN_CANDLES_MINUTES) &&
1624 (opt->candles <= MAX_CANDLES_MINUTES) ) break;
1625 }
1626 print_parm_error("--candles");
1627 error_detected++;
1628 }
1629 break;
1630 /* --havdalah */ case 25:
1631 if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1;
1632 else
1633 {
1634 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1635 {
1636 opt->havdalah = atoi(optarg);
1637 if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) &&
1638 (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break;
1639 }
1640 print_parm_error("--havdalah");
1641 error_detected++;
1642 }
1643 break;
1644
1645 } // end switch for long_options
1646 break;
1647
1648
1649 case '1': opt->three_month = 0; break;
1650 case '3': opt->three_month = 1; break;
1651 case 'b': opt->bidi = 1; opt->force_hebrew = 1; break;
1652 case 'c': opt->colorize = 1; break;
1653 case 'd': opt->diaspora = 1; break;
1654 case 'f': opt->footnote = 1; break;
1655 case 'h': opt->html = 1; break;
1656 case 'H': opt->force_hebrew = 1; break;
1657 case 'I': opt->force_israel = 1; break;
1658 case 'i': opt->external_css = 1; break;
1659 case 'm': opt->menu = 1; break;
1660 case 'p': opt->parasha = 1; break;
1661 case 'q': opt->quiet_alerts = 1; break;
1662 case 'l':
1663 error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude);
1664 break;
1665 case 'L':
1666 error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude);
1667 break;
1668 case 's':
1669 opt->shabbat = 1;
1670 opt->parasha = 1;
1671 if (opt->candles == 0) opt->candles = 1;
1672 if (opt->havdalah == 0) opt->havdalah = 1;
1673 break;
1674 case 'z':
1675 error_detected = error_detected + parse_timezone(optarg, tz);
1676 break;
1677 case '?':
1678 // FIXME if (strchr(short_options,optopt)!=NULL)
1679 print_parm_missing_error((char*) &optopt);
1680 error_detected = TRUE;
1681 break;
1682 default: print_usage_hcal (); exit_main(opt, 0); break;
1683 }
1684 return error_detected;
1685 }
1686
1687 /**************************************************
1688 ***************************************************
1689 ***************************************************
1690 * main
1691 ***************************************************
1692 ***************************************************
1693 **************************************************/
1694 int main (int argc, char *argv[])
1695 {
1696
1697 /* date */
1698 int month, year;
1699
1700 double lat = BAD_COORDINATE; /* set to this value for error handling */
1701 double lon = BAD_COORDINATE; /* set to this value for error handling */
1702 int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */
1703
1704 int opt_latitude = 0; /* -l option latitude */
1705 int opt_Longitude = 0; /* -L option longitude */
1706
1707 int error_detected = FALSE; /* exit after reporting ALL bad parms */
1708
1709
1710 option_list opt;
1711 opt.bidi = 0; // visual bidi, implies --force-hebrew
1712 opt.html = 0; // -h html format flag
1713 opt.diaspora = 0; // -d Diaspora holidays
1714 opt.external_css = 0; // -i External css file
1715 opt.parasha = 0; // -p print parasha alongside calendar
1716 opt.shabbat = 0; // -c print candle-lighting alongside calendar
1717 opt.candles = 0;
1718 opt.havdalah = 0;
1719 opt.no_reverse = 0; // don't highlight today in reverse video
1720 opt.three_month = 0; // print previous and next months also
1721 opt.colorize = 0; // display calendar in muted, more pleasing tones
1722 opt.footnote = 0; // display description of month's holidays
1723 opt.force_hebrew = 0; // force display of Hebrew data in Hebrew
1724 opt.force_israel = 0; // override diaspora-awareness
1725 opt.not_sunset_aware = 0; // override sunset-awareness
1726 opt.quiet_alerts = 0;
1727
1728 opt.lat = BAD_COORDINATE;
1729 opt.lon = BAD_COORDINATE;
1730 opt.tz = BAD_TIMEZONE;
1731
1732 opt.menu = 0; // -m print menus for user-selection
1733 int i;
1734 for (i=0; i<MAX_MENU_ITEMS; i++) opt.menu_item[i] = NULL;
1735
1736
1737 // support for getopt short options
1738 static char * short_options = "13bcdfhHiImpqsl:L:z:";
1739
1740 /* support for long options */
1741 int long_option_index = 0;
1742 int c;
1743 static struct option long_options[] = {
1744 // name, has_arg, flag, val
1745 {"version", 0, 0, 0},
1746 {"help", 0, 0, 0},
1747 {"no-reverse", 0, 0, 0},
1748 {"html", 0, 0, 'h'},
1749 {"parasha", 0, 0, 'p'},
1750 {"shabbat", 0, 0, 's'},
1751 {"three-month", 0, 0, '3'},
1752 {"colorize", 0, 0, 'c'},
1753 {"footnote",0,0,'f'},
1754 {"hebrew",0,0,'H'},
1755 {"israel",0,0,'I'},
1756 {"latitude", 1, 0, 'l'},
1757 {"longitude", 1, 0, 'L'},
1758 {"timezone", 1, 0, 'z'},
1759 {"not-sunset-aware", 0, 0, 0},
1760 {"quiet-alerts",0,0,'q'},
1761 {"bidi",0,0,'b'},
1762 {"visual",0,0,'b'},
1763 {"one-month",0,0,'1'},
1764 {"no-bidi",0,0,0},
1765 {"no-visual",0,0,0},
1766 {"no-color",0,0,0},
1767 {"no-footnote",0,0,0},
1768 {"menu",0,0,'m'},
1769 {"candles",2,0,0},
1770 {"havdalah",2,0,0},
1771 {0, 0, 0, 0}
1772 };
1773
1774 /* hdate struct */
1775 hdate_struct h;
1776
1777 // for config file user-defined menus
1778 size_t menu_len = 0;
1779 int menu_index;
1780 char *menuptr, *optptr;
1781
1782 /************************************************************
1783 * init locale
1784 *
1785 * I'm not sure why this had to be done. Per an answer on
1786 * stackoverflow (not yet check out by me):
1787 *
1788 * "At program startup, you should call setlocale():
1789 * setlocale(LC_CTYPE, "");
1790 * This will cause the wide character functions to use the
1791 * appropriate character set defined by the environment - eg.
1792 * on Unix-like systems, the LANG environment variable. For
1793 * example, this means that if your LANG variable is set to a
1794 * UTF8 locale, the wide character functions will handle input
1795 * and output in UTF8. (This is how the POSIX wc utility is
1796 * specified to work). You can then use the wide-character
1797 * versions of all the standard functions. However, if you
1798 * really do want to count characters rather than bytes, and
1799 * can assume that your text files are encoded in UTF-8, then
1800 * the easiest approach is to count all bytes that are not
1801 * trail bytes (i.e., in the range 0x80 to 0xBF)."
1802 *
1803 * Note: the code sets LC_ALL instead of LC_CTYPE; and the
1804 * code does not use wide_char functions ...
1805 ************************************************************/
1806 setlocale (LC_ALL, "");
1807
1808 /************************************************************
1809 * parse config file
1810 ************************************************************/
1811 FILE *config_file = get_config_file("/hcal", "/hcalrc", hcal_config_file_text);
1812 if (config_file != NULL)
1813 {
1814 read_config_file(config_file, &opt, &lat, &opt_latitude, &lon, &opt_Longitude, &tz);
1815 fclose(config_file);
1816 }
1817
1818
1819
1820 /************************************************************
1821 * parse command line
1822 ************************************************************/
1823 while ((c = getopt_long(argc, argv,
1824 short_options, long_options,
1825 &long_option_index)) != -1)
1826 error_detected = error_detected
1827 + hcal_parser(c, &opt,
1828 &lat, &opt_latitude,
1829 &lon, &opt_Longitude,
1830 &tz, long_option_index);
1831
1832
1833 /**************************************************
1834 * BEGIN - enable user-defined menu
1835 *************************************************/
1836 if (opt.menu)
1837 {
1838 i = menu_select( &opt.menu_item[0], MAX_MENU_ITEMS );
1839 if (i == -1) exit_main(&opt, 0);
1840 else if ((i < MAX_MENU_ITEMS) && (opt.menu_item[i] != NULL))
1841 {
1842
1843 /**************************************************
1844 * parse user's menu selection
1845 *************************************************/
1846 menuptr = opt.menu_item[i];
1847 menu_len = strlen( menuptr );
1848 menu_index = 0;
1849 optptr = NULL;
1850 optarg = NULL;
1851
1852 while (( c = menu_item_parse( menuptr, menu_len, &menu_index,
1853 &optptr, short_options, long_options,
1854 &long_option_index, &error_detected) ) != -1)
1855 {
1856 error_detected = error_detected +
1857 hcal_parser(c, &opt,
1858 &lat, &opt_latitude,
1859 &lon, &opt_Longitude,
1860 &tz, long_option_index);
1861 }
1862 }
1863 }
1864 /**************************************************
1865 * END - enable user-defined menu
1866 *************************************************/
1867
1868
1869 /**************************************************
1870 * sanity check - options compatability
1871 *************************************************/
1872 if ( (opt.three_month) &&
1873 ((opt.parasha) || (opt.shabbat) || (opt.footnote) ) )
1874 {
1875 error(0,0,"%s", N_("ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-month' mode"));
1876 opt.parasha = 0;
1877 opt.shabbat = 0;
1878 opt.footnote = 0;
1879 }
1880
1881 /************************************************************
1882 * function validate_location is defined in the include file
1883 * ./location.include.c
1884 * It issues an exit(EXIT_CODE_BAD_PARMS) [==1]
1885 * if it discovers, um, bad parameters
1886 ************************************************************/
1887 validate_location(opt_latitude, opt_Longitude, &lat, &lon, &tz,
1888 opt.quiet_alerts, error_detected, print_usage_hcal);
1889 opt.lat = lat;
1890 opt.lon = lon;
1891 opt.tz = tz;
1892
1893 /************************************************************
1894 * determine what day to highlight (ie. what is today)
1895 ************************************************************/
1896 if ((opt.no_reverse) || (opt.html))
1897 {
1898 // user doesn't want any highlighting
1899 opt.jd_today_g = 0;
1900 opt.jd_today_h = 0;
1901 }
1902 else
1903 {
1904 hdate_set_gdate (&h, 0, 0, 0);
1905 opt.jd_today_g = h.hd_jd;
1906 if ((!opt.not_sunset_aware) &&
1907 (check_for_sunset(&h, lat, lon, tz)) )
1908 opt.jd_today_h = h.hd_jd + 1;
1909 else opt.jd_today_h = h.hd_jd;
1910 }
1911
1912 /**************************************************
1913 * parse and vaildate date parameters
1914 **************************************************/
1915
1916
1917 /**************************************************
1918 * no date parameter provided - use current mm yyyy
1919 * and no need to validate parameters
1920 **************************************************/
1921 if (argc == (optind))
1922 {
1923 if ((opt.not_sunset_aware) || (opt.no_reverse) || (opt.html))
1924 // call function only if not already called
1925 // for sunset awareness, above.
1926 hdate_set_gdate (&h, 0, 0, 0); // today
1927 month = h.gd_mon;
1928 year = h.gd_year;
1929 }
1930 else
1931 {
1932 /********************************************************
1933 * additional parameters provided - get them and validate
1934 ********************************************************/
1935 if (argc == (optind + 2))
1936 {
1937 month = atoi (argv[optind]);
1938 year = atoi (argv[optind + 1]);
1939 }
1940 else if (argc == (optind + 1))
1941 {
1942 month = 0;
1943 year = atoi (argv[optind]);
1944 }
1945 else
1946 {
1947 error(0,0,"%s: %s", N_("error"), N_("too many parameters received. expected [[mm] [yyyy]"));
1948 exit_main(&opt, 0);
1949 }
1950
1951 /********************************************************
1952 * parameter validation - year
1953 ********************************************************/
1954 if (!validate_hdate(CHECK_YEAR_PARM, 0, month, year))
1955 {
1956 print_parm_error(N_("year"));
1957 exit_main(&opt, 0);
1958 }
1959 /********************************************************
1960 * parameter validation - month
1961 ********************************************************/
1962 if ((month!=0) && (!validate_hdate(CHECK_MONTH_PARM, 0, month, year)))
1963 {
1964 print_parm_error(N_("month"));
1965 exit_main(&opt, 0);
1966 }
1967 }
1968
1969
1970 /************************************************************
1971 * begin processing the user request
1972 ************************************************************/
1973
1974 /************************************************************
1975 * diaspora awareness
1976 ************************************************************/
1977 if (opt.force_israel) opt.diaspora = 0;
1978 else
1979 {
1980 tzset();
1981 // system timezone is denominated in seconds
1982 if ( (timezone/-3600) != 2) opt.diaspora = 1;
1983 }
1984
1985 /************************************************************
1986 * print HTML header
1987 ************************************************************/
1988 if (opt.html) print_header_html (opt.external_css, opt.force_hebrew);
1989
1990
1991 /************************************************************
1992 * print one year
1993 ************************************************************/
1994 if (month == 0)
1995 {
1996 if (opt.three_month)
1997 for (month=2; month<13; month=month+3) print_month (month, year, opt);
1998 else for (month=1; month<13; month++)
1999 {
2000 print_month (month, year, opt);
2001 if ((opt.footnote) && month<12) printf("\n");
2002 }
2003 }
2004
2005
2006 /************************************************************
2007 * print only this month
2008 ************************************************************/
2009 else print_month (month, year, opt);
2010
2011
2012 /************************************************************
2013 * print HTML footer
2014 ************************************************************/
2015 if (opt.html) print_html_footer ();
2016
2017 exit_main(&opt, 0);
2018 return 0;
2019 }
0 /* local_functions.c http://libhdate.sourceforge.net
1 * a collection of functions in support of both hcal.c and hdate.c
2 * hcal.c Hebrew calendar (part of package libhdate)
3 * hdate.c Hebrew date/times information(part of package libhdate)
4 *
5 * compile:
6 * gcc `pkg-config --libs --cflags libhdate` ocal_functions.c -o local_functions
7 *
8 * Copyright: 2011-2012 (c) Boruch Baum
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24 /**************************************************
25 * functions to support hcal and hdate
26 **************************************************/
27
28 #include <hdate.h> // For hebrew date
29 //include "../../src/hdate.h"
30 #include <stdlib.h> // For atoi, malloc
31 #include <error.h> // For error
32 #include <errno.h> // For errno
33 #include <time.h> // For time
34 #include <ctype.h> // for isprint
35 #include <fnmatch.h> // For fnmatch
36 #include <string.h> // For mempcpy
37 #include <getopt.h> // For optarg, optind
38 #include <stdio.h> // For printf, fopen, fclose, fprintf, snprintf. FILE
39 #include <pwd.h> // for get pwuid
40 #include <unistd.h> // for getuid
41 #include <sys/stat.h>
42 #include <sys/types.h> // for mkdir,
43
44
45 // support for fnmatch
46 #define FNM_EXTMATCH (1 << 5)
47 #define FNM_NOFLAG 0
48
49 #define BAD_COORDINATE 999
50 #define BAD_TIMEZONE 999
51 #define DELTA_LONGITUDE 30
52
53 #define EXIT_CODE_BAD_PARMS 1
54
55
56
57 // copied from support.h in src dir
58 #ifdef ENABLE_NLS
59 # include <libintl.h>
60 # undef _
61 # define _(String) dgettext (PACKAGE, String)
62 # ifdef gettext_noop
63 # define N_(String) gettext_noop (String)
64 # else
65 # define N_(String) (String)
66 # endif
67 #else
68 # define textdomain(String) (String)
69 # define gettext(String) (String)
70 # define dgettext(Domain,Message) (Message)
71 # define dcgettext(Domain,Message,Type) (Message)
72 # define bindtextdomain(Domain,Directory) (Domain)
73 # define _(String) (String)
74 # define N_(String) (String)
75 #endif
76
77 #define FALSE 0
78 #define TRUE -1
79
80
81 // support for options parsing
82 #define MIN_CANDLES_MINUTES 18
83 #define DEFAULT_CANDLES_MINUTES 20
84 #define MAX_CANDLES_MINUTES 90
85 #define MIN_MOTZASH_MINUTES 20
86 #define MAX_MOTZASH_MINUTES 90
87
88
89 /************************************************************
90 * begin - error message functions
91 ************************************************************/
92 void print_parm_error ( char *parm_name )
93 {
94 error(0,0,"%s: %s %s %s",N_("error"),
95 N_("parameter"), parm_name,
96 N_("is non-numeric or out of bounds"));
97 }
98
99 void print_parm_missing_error ( char *parm_name )
100 {
101 error(0,0,"%s: %s %s %s",N_("error"),
102 N_("option"), parm_name, N_("missing parameter"));
103 }
104
105 void print_alert_timezone( int tz )
106 {
107 error(0,0,"%s: %s, %+d:%d UTC",
108 N_("ALERT: time zone not entered, using system local time zone"),
109 *tzname, tz/60, tz%60);
110 }
111
112 void print_parm_invalid_error( char *parm_name )
113 {
114 error(0,0,"%s: %s %s %s",N_("error"),
115 N_("option"), parm_name, N_("is not a valid option"));
116 }
117
118
119 /************************************************************
120 * end - error message functions
121 ************************************************************/
122
123
124
125
126 /************************************************************
127 * begin - alert message functions
128 ************************************************************/
129 void print_alert_coordinate( char *city_name )
130 {
131 error(0,0,"%s %s",
132 N_("ALERT: guessing... will use co-ordinates for"),
133 city_name);
134 }
135
136 void print_alert_default_location( int tz )
137 {
138 switch (tz/60)
139 {
140 case -8: print_alert_coordinate( N_("Los Angeles") ); break;
141 case -6: print_alert_coordinate( N_("Mexico City") ); break;
142 case -5: print_alert_coordinate( N_("New York City") ); break;
143 // case -5: print_alert_coordinate( N_("Toronto") ); break;
144 // case -3: print_alert_coordinate( N_("Sao Paolo") ); break;
145 case -3: print_alert_coordinate( N_("Buenos Aires") ); break;
146 case 0: print_alert_coordinate( N_("London") ); break;
147 case 1: print_alert_coordinate( N_("Paris") ); break;
148 case 2: print_alert_coordinate( N_("Tel-Aviv") ); break;
149 case 3: print_alert_coordinate( N_("Moscow") ); break;
150 case 5: print_alert_coordinate( N_("Tashkent") ); break;
151 case 8: print_alert_coordinate( N_("Beijing") ); break;
152 // case 8: print_alert_coordinate( N_("Hong Kong") ); break;
153 case -10: print_alert_coordinate( N_("Honolulu") ); break;
154 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;
155 }
156 }
157 /************************************************************
158 * end - alert message functions
159 ************************************************************/
160
161
162
163 /************************************************************
164 * set default location
165 ************************************************************/
166 void set_default_location( int tz, double *lat, double *lon )
167 {
168 /* Temporarily, set some default lat/lon coordinates
169 for certain timezones */
170
171 /**
172 { 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ),
173 { 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ),
174 { 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ),
175 { 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ),
176 { 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ),
177 { 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ),
178 { 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ),
179 { 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ),
180 { 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ),
181 { 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ),
182 { 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ),
183 { 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ),
184 { 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ),
185 { 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ),
186 { 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ),
187 { 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ),
188 { 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ),
189 { 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ),
190 { 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ),
191 { 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' )
192 **/
193
194 switch (tz/60)
195 {
196 case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles
197 case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City
198 case -5: *lat = 40.0; *lon = -74.0; break; // New York
199 // case -5: *lat = 43.71; *lon = -79.43; break; // Toronto
200 // case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo
201 case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires
202 case 0: *lat = 51.0; *lon = 0.0; break; // London
203 case 1: *lat = 48.0; *lon = 2.0; break; // Paris
204 case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv
205 case 3: *lat = 55.0; *lon = 37.0; break; // Moscow
206 case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent
207 case 8: *lat = 39.90; *lon = 116.38; break; // Beijing
208 // case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong
209 case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu
210 default: *lat = 0.0; *lon = tz * .25; break; // center of timeone:
211 // .25 = (15 degrees) / 60 [because tz is in minutes, not hours]
212 }
213 return;
214 }
215
216
217
218 /************************************************************
219 * check for sunset
220 ************************************************************/
221 int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone )
222 {
223 time_t now_time;
224 struct tm *now_timep;
225 int sunrise, sunset;
226
227 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
228 &sunrise, &sunset);
229
230 time(&now_time);
231 now_timep = localtime(&now_time);
232
233 if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1;
234 else return 0;
235 }
236
237
238
239
240 /***********************************************************
241 * reverse a hebrew string (for visual bidi)
242 * parameters:
243 * source is a pointer to a writeable buffer.
244 * source_len is the length of a string in source. This
245 * length must be LESS than the size of the source buffer
246 ***********************************************************/
247 void revstr( char *source, const size_t source_len)
248 {
249 #define H_CHAR_WIDTH 2
250
251 #define DEBUG 0
252 #if DEBUG
253 printf("\nrevstr: entry: sourcelen = %zd, source = %s\n",source_len, source);
254 #endif
255
256 if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);};
257 if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %zd",source_len); exit(0);};
258
259 size_t i,j;
260 char *temp_buff;
261
262 temp_buff = malloc(source_len+2);
263 if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);};
264
265 for (i=(source_len-1), j=0; j < source_len; i--, j++)
266 {
267 if (isprint(source[i])) temp_buff[j] = source[i];
268 else
269 {
270 // FIXME - presumes H_CHAR_WIDTH = 2
271 temp_buff[j++] = source[i-1];
272 temp_buff[j] = source[i--];
273 }
274 }
275 memcpy(source, temp_buff, source_len);
276 source[source_len] = '\0';
277 #if DEBUG
278 printf("\nrevstr: before free(tempbuff): sourcelen = %zd, source = %s\n",source_len, source);
279 #endif
280 free(temp_buff);
281 return;
282 }
283
284
285 /************************************************************
286 * parse coordinate
287 *
288 * presumes commandline options were parsed using getopt.
289 * returns 1 to *opt_found on success
290 * returns the floating point value of the coordinate in *coordinate
291 *
292 * type_flag (1-latitude, 2=longitude)
293 ************************************************************/
294 int parse_coordinate( const int type_flag, char *input_string,
295 double *coordinate, int *opt_found)
296 {
297 //#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
298 //#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
299 //#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
300 //#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
301
302 #define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])"
303 #define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])"
304
305 #define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])"
306 #define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])"
307
308 char* seconds;
309
310 double fractional_part = 0;
311 int direction_modifier = 1;
312
313 /************************************************************
314 * input_string should hold the value to parse
315 * It must exist and be numeric
316 * we don't want confuse it with the next option of for "-x"
317 ************************************************************/
318 if (!input_string)
319 {
320 if (type_flag == 1) print_parm_missing_error(N_("l (latitude)"));
321 else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)"));
322 return TRUE; // error_detected = TRUE; ie failure
323 }
324
325 /************************************************************
326 * parse latitude
327 ************************************************************/
328 if (type_flag == 1)
329 {
330 if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
331 && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
332 {
333 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
334 print_parm_missing_error(N_("l (latitude)"));
335 else print_parm_error(N_("l (latitude)"));
336 return TRUE; // error_detected = TRUE; ie failure
337 }
338
339
340 if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1;
341
342
343 if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
344 {
345 *coordinate = (double) atof( strtok( input_string, "nNsS"));
346 }
347 else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
348 {
349 *coordinate = (double) atof( strtok( input_string, "nNsS:'\""));
350 fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60;
351 seconds = strtok( NULL, "nNsS:'\"");
352 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
353 }
354
355
356 if (*coordinate > 0)
357 *coordinate = (*coordinate + fractional_part) * direction_modifier;
358 else
359 *coordinate = *coordinate - fractional_part;
360
361
362 if( (*coordinate > -90) && (*coordinate < 90) )
363 {
364 *opt_found = 1;
365 return FALSE; // error_detected = FALSE; ie. success
366 }
367 print_parm_error(N_("L (Longitude)"));
368 return TRUE; // error_detected = TRUE; ie failure
369 }
370
371
372 /************************************************************
373 * parse longitude
374 ************************************************************/
375 if (type_flag == 2)
376 {
377 if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
378 && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
379 {
380 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
381 print_parm_missing_error(N_("L (Longitude)"));
382 else print_parm_error(N_("L (Longitude)"));
383 return TRUE; // error_detected = TRUE; ie failure
384 }
385
386
387 if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1;
388
389
390 if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
391 {
392 *coordinate = (double) atof( strtok( input_string, "eEwW"));
393 }
394 else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
395 {
396 *coordinate = (double) atof( strtok( input_string, "eEwW:'\""));
397 fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60;
398 seconds = strtok( NULL, "eEwW:'\"");
399 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
400 }
401
402 if (*coordinate > 0)
403 *coordinate = (*coordinate + fractional_part) * direction_modifier;
404 else
405 *coordinate = *coordinate - fractional_part;
406
407
408 if( (*coordinate > -180) && (*coordinate < 180) )
409 {
410 *opt_found = 1;
411 return FALSE; // error_detected = FALSE; ie. success
412 }
413 print_parm_error(N_("L (Longitude)"));
414 return TRUE; // error_detected = TRUE; ie failure
415 }
416
417 printf("INTERNAL ERROR: coordinate parse\n");
418 return TRUE; // error_detected = TRUE; ie failure
419 }
420
421 /************************************************************
422 * parse timezone
423 *
424 * presumes commandline options were parsed using getopt.
425 * timezone is returned in minutes, not hours
426 ************************************************************/
427 int parse_timezone( char *input_string, int *tz)
428 {
429 #define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))"
430 #define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))"
431
432 int fractional_part;
433
434 /************************************************************
435 * input_string should hold the value to parse
436 * It must exist and be numeric
437 * we don't want confuse it with the next option of for "-x"
438 ************************************************************/
439 if ((!input_string) ||
440 ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) &&
441 (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) &&
442 (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) )
443 {
444 print_parm_missing_error(N_("z (time zone)"));
445 }
446 else
447 {
448 if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
449 {
450 *tz = (int) ( atof (input_string) * 60 );
451 }
452 else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0)
453 {
454 *tz = atoi( strtok( input_string, ":'\"")) * 60;
455 fractional_part = atoi( strtok( NULL, ":'\""));
456 if (*tz < 0) *tz = *tz - fractional_part;
457 else *tz = *tz + fractional_part;
458 }
459
460 if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours
461 {
462 return FALSE; // error_detected = FALSE; ie. success
463 }
464 else print_parm_error(N_("z (timezone)"));
465 }
466 return TRUE; // error_detected = TRUE; ie failure
467 }
468
469
470
471
472 /************************************************************
473 * validate location parameters - lat, lon, tz
474 ************************************************************/
475 // originally, this was only for hdate, now also for hcal
476 // originally, we did this only if we needed the information
477 // now, because of sunset-awareness, we always perform these checks
478 // if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) )
479 void validate_location( const int opt_latitude, const int opt_Longitude,
480 double *lat, double *lon,
481 int *tz, const int quiet_alerts, int error_detected,
482 void (*print_usage)() )
483 {
484
485 /* latitude and longitude must be paired */
486 if ( (opt_latitude) && (!opt_Longitude) )
487 {
488 error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude"));
489 error_detected = TRUE;
490 }
491 else if ( (opt_Longitude) && (!opt_latitude) )
492 {
493 error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude"));
494 error_detected = TRUE;
495 }
496
497
498 if (!error_detected)
499 {
500 // if no timezone entered, choose guess method
501 if (*tz==BAD_TIMEZONE)
502 {
503 // system timezone is in seconds, but we deal in minutes
504 tzset();
505 *tz = timezone /-60;
506
507 if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) )
508 {
509 /* reject system local timezone, because it's
510 too far from the longitude explicitly provided
511 by the user; guess based on longitude entered */
512 *tz = (*lon /15) * 60;
513 }
514 if (!quiet_alerts) print_alert_timezone( *tz );
515 if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) )
516 {
517 if (!quiet_alerts) print_alert_default_location( *tz );
518 set_default_location( *tz, lat, lon );
519 }
520 printf("\n");
521 }
522 else
523 { /* we have timezone, what about latitude and longitude? */
524 if ( (opt_Longitude) && (opt_latitude) )
525 {
526 // sanity-check longitude versus timezone
527 // timezone is in minutes
528 if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE )
529 {
530 error(0,0,"%s %d:%d %s %.3f %s",
531 N_("time zone value of"), *tz/60, *tz%60,
532 N_("is incompatible with a longitude of"), *lon, N_("degrees"));
533 error_detected = TRUE;
534 }
535 }
536 else
537 {
538 if (!quiet_alerts) print_alert_default_location( *tz );
539 set_default_location( *tz, lat, lon );
540 printf("\n");
541 }
542 }
543 }
544
545 /* exit after reporting all bad parameters found */
546 if (error_detected)
547 {
548 print_usage();
549 exit(EXIT_CODE_BAD_PARMS);
550 }
551 }
552
553
554 /************************************************************
555 * check validity of date parameters
556 ************************************************************/
557 #define CHECK_DAY_PARM 1
558 #define CHECK_MONTH_PARM 2
559 #define CHECK_YEAR_PARM 3
560 int validate_hdate (int parameter_to_check, int day, int month, int year)
561 {
562 hdate_struct h;
563
564 if (year < 0) return FALSE;
565
566 switch (parameter_to_check)
567 {
568
569 case CHECK_DAY_PARM:
570
571 /************************************************************
572 * check day in Hebrew date
573 ************************************************************/
574 if (year > 3000)
575 {
576 if (year > 10999) return FALSE;
577 hdate_set_hdate (&h, 1, 1, year);
578 if ((day < 1) || (day > 30) ||
579 ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) ||
580 (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) ||
581 (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) )
582 return FALSE;
583 return TRUE;
584 }
585
586 /************************************************************
587 * check day in Gregorian date
588 ************************************************************/
589 else
590 {
591 if ((day < 1) ||
592 ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) ||
593 ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) ||
594 ((day > 29) && (month==2) && ((year%4)==0)) ||
595 ((day > 28) && (month==2) && ((year%4)!=0))
596 )
597 return FALSE;
598 return TRUE;
599 }
600 break;
601
602
603 case CHECK_MONTH_PARM:
604
605 /************************************************************
606 * check month in Hebrew date
607 ************************************************************/
608 if (year > 3000)
609 {
610 if (year > 10999) return FALSE;
611 if ((month <= 0) || (month > 14)) return FALSE;
612 hdate_set_hdate (&h, 1, 1, year);
613 if ((h.hd_size_of_year <365) && (month >12)) return FALSE;
614 return TRUE;
615 }
616
617 /************************************************************
618 * check month in Gregorian date
619 ************************************************************/
620 else
621 {
622 if ((month <= 0) || (month > 12)) return FALSE;
623 return TRUE;
624 }
625 break;
626
627 case CHECK_YEAR_PARM:
628 if (year > 10999) return FALSE;
629 return TRUE;
630 break;
631 }
632 return FALSE;
633 }
634
635 /************************************************************
636 * Greeting message to new version
637 ************************************************************/
638 void greetings_to_version_16()
639 {
640 error(0,0,"%s",N_("\
641 This seems to be to be your first time using this version.\n\
642 Please read the new documentation in the man page and config\n\
643 file. Attempting to create a config file ..."));
644 }
645
646
647 /************************************************************
648 * Open config file, or create one
649 * - returns filepointer or NULL
650 * - if file does not exist, attempt to create it
651 ************************************************************/
652 FILE* get_config_file( const char* config_dir_name,
653 const char* config_file_name,
654 const char* default_config_file_text )
655 {
656 size_t path_len;
657
658 char* config_home_path_name = "";
659 char* config_sub_path_name = "";
660
661 char* config_dir_path;
662 char* config_file_path;
663
664 FILE* config_file;
665
666 /************************************************************
667 * sub-function to get_config_file: create_config_file
668 ************************************************************/
669 void create_config_file()
670 {
671 config_file = fopen(config_file_path, "a");
672 if (config_file == NULL)
673 {
674 error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path);
675 return;
676 }
677 fprintf(config_file, "%s", default_config_file_text);
678 error(0,0,"%s: %s",N_("config file created"), config_file_path);
679 if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name);
680 }
681
682 /************************************************************
683 * sub-function to get_config_file: open_config_file
684 ************************************************************/
685 int open_config_file()
686 {
687 config_file = fopen(config_file_path, "r");
688 if (config_file == NULL)
689 {
690 if (errno != ENOENT) return FALSE;
691 // maybe replace all this with a single line asprintf()
692 path_len = strlen(config_home_path_name)
693 + strlen(config_sub_path_name)
694 + strlen(config_dir_name) +1;
695 if (path_len < 1) return FALSE;
696 config_dir_path = malloc(path_len);
697 if (config_dir_path == NULL)
698 {
699 error(0,errno,"%s",N_("memory allocation failure"));
700 return FALSE;
701 }
702 snprintf(config_dir_path, path_len, "%s%s%s",
703 config_home_path_name, config_sub_path_name,
704 config_dir_name);
705
706 if ((mkdir(config_dir_path, (mode_t) 0700) != 0) &&
707 (errno != EEXIST))
708 {
709 free(config_dir_path);
710 return FALSE;
711 }
712 greetings_to_version_16();
713 create_config_file();
714 free(config_dir_path);
715 return FALSE;
716 }
717 return TRUE;
718 }
719
720
721 /************************************************************
722 * main part of function get_config_file
723 ************************************************************/
724 config_home_path_name = getenv("XDG_CONFIG_HOME");
725 if (config_home_path_name == NULL)
726 {
727 config_home_path_name = getenv("HOME");
728 if (config_home_path_name == NULL)
729 {
730 struct passwd *passwdEnt = getpwuid(getuid());
731 config_home_path_name = passwdEnt->pw_dir;
732 if (config_home_path_name == NULL) return NULL;
733 }
734 config_sub_path_name = "/.config";
735 }
736
737 // maybe replace all this with a single line asprintf()
738 path_len = strlen(config_home_path_name) + strlen(config_sub_path_name)
739 + strlen(config_dir_name) + strlen(config_file_name) + 1;
740 if (path_len < 1) return NULL;
741 config_file_path = malloc(path_len);
742 if (config_file_path == NULL)
743 {
744 error(0,errno,"memory allocation failure");
745 return NULL;
746 }
747 snprintf(config_file_path, path_len, "%s%s%s%s",
748 config_home_path_name, config_sub_path_name,
749 config_dir_name, config_file_name);
750
751 if (open_config_file() == TRUE)
752 {
753 free(config_file_path);
754 return config_file;
755 }
756 else
757 free(config_file_path);
758 return NULL;
759 }
760
761
762
763
764 /**********************************************************************
765 * parse user's menu selection into options and their posibile
766 * arguments, which can then be parsed (processed really)
767 *
768 * menuptr points to the beginning of the menu entry string. This
769 * pointer should initially be set to NULL.
770 * menu_len is the length of the menu entry string
771 * menu_index is the current position of the parser within the string.
772 * This value should initially be set to 0.
773 * optptr is a pointer into which we put the location of option text
774 * to be parsed. This pointer should initially be set to NULL.
775 * optarg is a pointer to a possible argument to the option. This is a
776 * global variable defined by GNU getopt(), so it shouldn't be
777 * declared or passed.
778 * long_options is a pointer to a structure of type option, as defined
779 * by getopt_long()
780 * long_option_index is a pointer to position found in long_options, and
781 * simulates the similar value returned by getopt_long()
782 * error_detected is a pointer to an accumulator used to delay aborting
783 * the program until after ALL input syntax errors are reported.
784 *
785 * RETURN VALUES:
786 * -1 means the menu line string has been completely parsed.
787 * Otherwise, the return value should be the short option character
788 * found, or in the case of a long option found, 0.
789 * This should sound suspiciously similar to the return values issued
790 * by getopt_long().
791 ***********************************************************************/
792 int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index,
793 char** optptr, char* short_options,
794 struct option *long_options, int *long_option_index,
795 int *error_detected)
796 {
797 int ahead_index;
798 char *ahead;
799
800 while ( (*menu_index < menu_len) &&
801 (menuptr[*menu_index] != '#') )
802 {
803 if (menuptr[*menu_index] == '-')
804 {
805 if ( ( (*menu_index+1) >= menu_len) ||
806 (menuptr[*menu_index+1] == '#') ) break;
807 else if (menuptr[*menu_index+1] == '-')
808 {
809 if ( ( (*menu_index+2) >= menu_len) ||
810 (menuptr[*menu_index+2] == '#') ) break;
811 *menu_index = *menu_index +2;
812
813 /**************************************************
814 * We have identified the beginning of what could
815 * be a long option string. We store a pointer to
816 * it in optptr and proceed to:
817 * find its endpoint
818 * terminate it with a null
819 * if it has an argument, store a pointer to
820 * it in optarg and terminate it with a null.
821 * Then we compare the optptr to our list of
822 * valid longoptions and pass the information
823 * to the option parser
824 *************************************************/
825 *optptr = &menuptr[*menu_index]; // ??
826 ahead = *optptr;
827 ahead_index = *menu_index;
828 while ( (ahead_index < menu_len) &&
829 (strchr(" =#",*ahead) == NULL) )
830 {
831 ahead_index++;
832 ahead++;
833 }
834 if (memcmp(ahead,"=",1)==0)
835 {
836 *ahead = '\0';
837 ahead++;
838 optarg = ahead;
839 ahead_index++;
840 while ( (ahead_index < menu_len) &&
841 (strchr(" #",*ahead) == NULL) )
842 {
843 ahead_index++;
844 ahead++;
845 }
846 }
847 if ((*ahead == '#' ) && ((ahead_index+1) < menu_len))
848 ahead[1] = '#';
849 *ahead = '\0';
850 *long_option_index = 0;
851 while ( (long_options[*long_option_index].name != 0) &&
852 (strcmp(long_options[*long_option_index].name, *optptr) != 0) )
853 *long_option_index = *long_option_index + 1;
854 if (long_options[*long_option_index].name == 0)
855 {
856 *error_detected = *error_detected + 1;
857 print_parm_invalid_error(*optptr);
858 }
859 else
860 {
861 *menu_index = ahead_index;
862 return long_options[*long_option_index].val;
863 }
864 }
865 else
866 {
867 *menu_index = *menu_index + 1;
868 /**************************************************
869 * parse a short option from a menu line
870 *************************************************/
871 if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) ||
872 (menuptr[*menu_index] == ':') )
873 {
874 *error_detected = *error_detected + 1;
875 print_parm_invalid_error(*optptr);
876 }
877 else
878 {
879 *optptr = &menuptr[*menu_index];
880 *long_option_index = -1;
881 if (strchr("lLz", (int) menuptr[*menu_index]) != NULL)
882 {
883 ahead_index = *menu_index+1;
884 while ( (ahead_index < menu_len) &&
885 (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++;
886 optarg = &menuptr[ahead_index];
887 while ( (ahead_index < menu_len) &&
888 (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++;
889 menuptr[ahead_index] = '\0';
890 *menu_index = ahead_index;
891 }
892 return **optptr;
893 }
894
895 }
896 }
897 *menu_index = *menu_index + 1;
898 }
899 return -1;
900 }
901
902
903 /**************************************************
904 * prompt user for menu selection
905 *************************************************/
906 int menu_select( char* menu_list[], int max_menu_items )
907 {
908 int i, j;
909
910 for (i=0; i< max_menu_items; i++)
911 {
912 if (menu_list[i] == NULL) break;
913 if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)"));
914 printf(" %d: %s\n",i,menu_list[i]);
915 }
916 j = i;
917 if (i == 0)
918 {
919 error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file"));
920 return -1;
921 }
922 printf("\n%s: ",N_("enter your selection, or <return> to continue"));
923 i = getchar() - 48; // effectively converts valid values to integers
924 if ((i < 0) || (i >= j))
925 {
926 error(0,0,N_("menu selection received was out of bounds"));
927 return -1;
928 }
929 printf("\n");
930 return i;
931 }
0 ## Process this file with automake to produce Makefile.in
1
2 PACKAGE_NAME = libhdate
3 PACKAGE_STRING = library for Hebrew date information
4 PACKAGE_TARNAME =
5 PACKAGE_URL = libhdate.sourceforge.net
6 PACKAGE_VERSION = 1.6.02
7 VERSION = 1.6.02
8
9 SUBDIRS = po docs src examples bindings
10
11 pkgconfigdir = $(libdir)/pkgconfig
12 pkgconfig_DATA = libhdate.pc
13
14 libhdate_CFLAGS = -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie
15 libhdate_LDFLAGS = -z relro -z now
16
17
18 libhdatedocdir = ${prefix}/share/doc/libhdate
19 libhdatedoc_DATA = \
20 README\
21 COPYING\
22 AUTHORS\
23 ChangeLog\
24 INSTALL\
25 NEWS\
26 USE \
27 ABOUT-NLS
28
29 EXTRA_DIST = $(libhdatedoc_DATA) libhdate.pc.in
30
31 ACLOCAL_AMFLAGS = -I m4
0 /* hcal.c http://libhdate.sourceforge.net
1 * Hebrew calendar (part of package libhdate)
2 *
3 * compile:
4 * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal
5 *
6 * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #define _GNU_SOURCE // for mempcpy
23 #include <stdio.h> // For printf
24 #include <hdate.h> // For hebrew date
25 //#include "../../src/hdate.h"
26 #include <stdlib.h> // For atoi, malloc
27 #include <locale.h> // For setlocale
28 #include <getopt.h> // For getopt_long
29 #include <string.h> // For strlen, mempcpy
30 #include <time.h> // For time, tzset
31 //#include <wchar.h> // for unicode character operations
32
33 #define FALSE 0
34 #define TRUE -1
35 #define SHABBAT 7
36
37 #define HDATE_STRING_SHORT 1
38
39 // for opt.menu[MAX_MENU_ITEMS]
40 #define MAX_MENU_ITEMS 10
41
42
43
44 // for colorization
45 #define CODE_REVERSE_VIDEO "%c[7m", 27
46 #define CODE_RESTORE_VIDEO "%c[m", 27
47 #define CODE_BLACK "%c[30m", 27
48 #define CODE_LIGHT_RED "%c[31m", 27
49 #define CODE_LIGHT_GREEN "%c[32m", 27
50 #define CODE_LIGHT_BROWN "%c[33m", 27
51 #define CODE_DARK_BLUE "%c[34m", 27
52 #define CODE_LIGHT_PURPLE "%c[35m", 27
53 #define CODE_LIGHT_AQUA "%c[36m", 27
54 #define CODE_LIGHT_GREY "%c[37m", 27
55 #define CODE_BOLD_GREY "%c[1;30m", 27
56 #define CODE_BOLD_RED "%c[1;31m", 27
57 #define CODE_BOLD_GREEN "%c[1;32m", 27
58 #define CODE_BOLD_YELLOW "%c[1;33m", 27
59 #define CODE_BOLD_BLUE "%c[1;34m", 27
60 #define CODE_BOLD_PURPLE "%c[1;35m", 27
61 #define CODE_BOLD_AQUA "%c[1;36m", 27
62 #define CODE_BOLD_WHITE "%c[1;37m", 27
63 #define ELEMENT_WEEKDAY_G 1
64 #define ELEMENT_WEEKDAY_H 2
65 #define ELEMENT_SHABBAT_DAY 3
66 #define ELEMENT_HOLIDAY_DAY 4
67 #define ELEMENT_HOLIDAY_FLAG 5
68 #define ELEMENT_SHABBAT_NAME 6
69 #define ELEMENT_WEEKDAY_NAMES 7
70 #define ELEMENT_MONTH_G 8
71 #define ELEMENT_MONTH_H 9
72 #define ELEMENT_SHABBAT_TIMES 10
73 #define ELEMENT_PARASHA 11
74 #define ELEMENT_THIS_SHABBAT_TIMES 12
75 #define ELEMENT_THIS_PARASHA 13
76 #define ELEMENT_HOLIDAY_NAME 14
77 #define ELEMENT_TODAY_HOLIDAY_DAY 15
78 #define ELEMENT_TODAY_HOLIDAY_NAME 16
79
80 /**************************************************
81 * functions to support hcal and hdate
82 **************************************************/
83 #include "./local_functions.c"
84
85
86
87 static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' };
88 /* Holiday types: (reference hdate_holyday.c)
89 / - 0 - Regular day
90 + - 1 - Yom tov (plus yom kippor)
91 * - 2 - Erev yom kippur
92 ~ - 3 - Hol hamoed
93 ! - 4 - Hanuka and purim
94 @ - 5 - Tzomot
95 # - 6 - Independance day and Yom yerushalaim
96 $ - 7 - Lag baomer ,Tu beav, Tu beshvat
97 % - 8 - Tzahal and Holocaust memorial days
98 ^ - 9 - National days
99 */
100
101
102
103 typedef struct {
104 int html;
105 int external_css;
106 int diaspora;
107 int parasha;
108 int shabbat;
109 int candles;
110 int havdalah;
111 int no_reverse;
112 int three_month;
113 int colorize;
114 int footnote;
115 int jd_today_g;
116 int jd_today_h;
117 int force_hebrew;
118 int force_israel;
119 int not_sunset_aware;
120 int quiet_alerts;
121 int bidi;
122 double lat;
123 double lon;
124 int tz;
125 int menu;
126 char* menu_item[MAX_MENU_ITEMS];
127 } option_list;
128
129 typedef struct {
130 int g_month_1;
131 int g_year_1;
132 int g_month_2;
133 int g_year_2;
134 int h_month_1;
135 int h_year_1;
136 int h_month_2;
137 int h_year_2;
138 } header_info;
139
140
141 const char* hcal_config_file_text = N_("\
142 # configuration file for hcal - Hebrew calendar program\n\
143 # part of package libhdate\n\
144 #\n# Should you mangle this file and wish to restore its default content,\n\
145 # rename or delete this file and run hcal; hcal will automatically\n\
146 # regenerate the default content.\n#\n\
147 # Your system administrator can set system-wide defaults for hcal by\n\
148 # modifying file <not yet implemented>.\n\
149 # You may override all defaults by changing the contents of this file.\n\
150 #\n\
151 # Version information\n\
152 # This may be used by updates to hcal to determine how to parse the file\n\
153 # and whether additional information and options should be appended to\n\
154 # the end of this file.\n\
155 VERSION=2.00\n\
156 # Location awareness\n\
157 # hcal wants to accurately highlight the current Hebrew day, including\n\
158 # during the hours between sunset and secular midnight. If you don't\n\
159 # provide it with latitude, longitude, and time zone information, hcal\n\
160 # will try to guess the information, based upon your system timezone,\n\
161 # and its (limited, and maybe biased) of the dominant Jewish community\n\
162 # in that timezone. When hcal is forced to guess, it alerts the user\n\
163 # with a message that includes the guessed location.\n\
164 # hcal's guesses will also affect its default behaviour for output of\n\
165 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\
166 #SUNSET_AWARE=TRUE\n\
167 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
168 # degrees[:minutes[:seconds]] with the characters :'\" as possible\n\
169 # delimiters. Use negative values to indicate South and West, or\n\
170 # use the abbreviated compass directions N, S, E, W.\n\
171 #LATITUDE=\n\
172 #LONGITUDE=\n\
173 # TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\
174 # with the characters :'\" as possible delimiters.\n\
175 #TIMEZONE=\n\n\
176 # Israel and the diaspora\n\
177 # If hcal guesses that you're not in Israel, the DIASPORA option will be\n\
178 # set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\
179 # forces hcal to display calendar information for Israel, using hcal's\n\
180 # default coordinates foe Israel, or coordinates that you provide that\n\
181 # seem legitmately within Israel.\n\
182 # Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\
183 # Sukkot, set BOTH flags true in order to see holiday information for\n\
184 # a non-resident vistor to Israel. The command line options for these\n\
185 # features are --israel, -I, --diaspora, -d.\n\
186 #FORCE_DIASPORA=FALSE;\n\
187 #FORCE_ISRAEL=FALSE;\n\n\
188 # Shabbat related\n\
189 # Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\
190 # The command line options for these features are -p (--parasha), and\n\
191 # -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\
192 # before sunset). The HAVDALAH field can accept a value of 20 - 90\n\
193 # (minutes after sunset).\n\
194 #PARASHA_NAMES=FALSE\n\
195 #SHABBAT_INFO=FALSE\n\
196 #CANDLE_LIGHTING=FALSE\n\
197 #HAVDALAH=FALSE\n\n\
198 # Holiday identification\n\
199 # hcal flags holidays by replacing the gregorian/Hebrew date separator\n\
200 # with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\
201 # will have hcal output after the month's calendar, a list of the month's\n\
202 # holidays along with the days on which they occur.\n\
203 #FOOTNOTE=FALSE\n\n\
204 # Output in hebrew characters\n\
205 # hcal defaults to output all information in your default language, so\n\
206 # if your default language is Hebrew, you're all set. Otherwise, you can\n\
207 # set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\
208 # still outputting gregorian information in your default language. To\n\
209 # output ALL information in Hebrew, run something like this:\n\
210 # LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\
211 # If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\
212 # output, you need to install a terminal font that includes the Hebrew\n\
213 # character set (hint: unicode).\n\
214 # The command line option for FORCE_HEBREW is either --hebrew or -H\n\
215 #FORCE_HEBREW=FALSE\n\n\
216 # The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\
217 # Unfortunately, the world can not be depended upon to be either. Most\n\
218 # Xwindow applications will display the data fine with FORCE_HEBREW; most\n\
219 # xterm implementations will not. (in fact, the only xterm clone I know\n\
220 # of that comes close is mlterm). If using FORCE_HEBREW results in\n\
221 # Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\
222 # This will reverse the order of the Hebrew characters, so they will\n\
223 # display 'visual'ly correct; however, such output will not be suitable\n\
224 # for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\
225 # automatically forces hebrew.\n\
226 # The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\
227 #OUTPUT_BIDI=FALSE\n\n\
228 # Display enhancements\n\
229 # hcal defaults to display the current day in reverse video\n\
230 # The command line option for this feature is --no-reverse\n\
231 #SUPPRESS_REVERSE_VIDEO=FALSE;\n\
232 # hcal can display its output \"calming, muted tones\". Note that piping\n\
233 # colorized output may yield unexpected results.\n\
234 #COLORIZE=FALSE\n\n\
235 # HTML OUTPUT\n\
236 #OUTPUT_HTML=FALSE\n\
237 #USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\
238 # Suppress alerts and warnings\n\
239 # hcal alerts the user via STDERR when it guesses the user's location.\n\
240 #QUIET_ALERTS=FALSE\n\n\
241 # Three month display\n\
242 # hcal can display a previous, current and next month side-by-side. hcal\n\
243 # can also display a calendar for an entire year in four rows of three\n\
244 # months each. Note that this will display properly only if your console\n\
245 # is set for at least 127 columns. Note also that setting this option to\n\
246 # will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\
247 #THREE_MONTH=FALSE\n\n\
248 # User-defined menus\n\
249 # You may specify here command-line strings to optionally be parsed\n\
250 # by hcal at execution time. To do so, use the command line option -m\n\
251 # (--menu). hcal will process first the settings of this config file,\n\
252 # then the other settings of your command line, and then will prompt\n\
253 # you for which menu item you would like to select. hcal will process\n\
254 # your menu selection as if it were a new command line, further modifying\n\
255 # all the prior settings.\n\
256 # Only the first ten \"MENU=\" entries will be read. Each line will be\n\
257 # truncated at one hundred characters\n\
258 #MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\
259 #MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\
260 #MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\
261 #MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\
262 ");
263
264
265 /**************************************************
266 * print version
267 *************************************************/
268 int print_version ()
269 {
270 printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6"));
271 return 0;
272 }
273
274 /**************************************************
275 * print usage
276 *************************************************/
277 void print_usage_hcal ()
278 {
279 printf ("%s\n",
280 N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\
281 coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\
282 -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\
283 timezone: -z nn[( .nn | :mm )]\n\
284 Try \'hcal --help\' for more information"));
285 }
286
287 /**************************************************
288 * print help
289 *************************************************/
290 void print_help ()
291 {
292 print_usage_hcal();
293 printf ("%s\n",
294 N_("Hebrew calendar\nOPTIONS:\n\
295 -1 --one-month over-ride config file setting if you had set\n\
296 option --three-month as a default there\n\
297 -3 --three-month displays previous/next months\n\
298 side by side. requires 127 columns\n\
299 -b --bidi prints hebrew in reverse (visual)\n\
300 --visual\n\
301 --no-bidi over-ride config file setting if you had set\n\
302 --no-visual option -bidi as a default there\n\
303 -c --colorize displays in calming, muted tones\n\
304 --no-color over-ride a --colorize setting in your config file\n\
305 -d --diaspora use diaspora reading and holidays.\n\
306 -f --footnote print descriptive notes of holidays\n\
307 --no-footnote over-ride a footnote setting in your config file\n\
308 -h --html output in html format to stdout\n\
309 -H --hebrew print hebrew information in Hebrew\n\
310 -i use external css file \"./hcal.css\".\n\
311 -I --israel override a diaspora default\n\
312 --no-reverse do not highlight today's date\n\
313 -m --menu prompt user-defined menu from config file\n\
314 -p --parasha print week's parasha on each calendar row\n\
315 -q --quiet-alerts suppress warning messages\n\
316 -s --shabbat print Shabbat times and parshiot\n\
317 --candles modify default minhag of 20 minutes. (17<n<91)\n\
318 --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n\
319 -z --timezone nn timezone, +/-UTC\n\
320 -l --latitude yy latitude yy degrees. Negative values are South\n\
321 -L --longitude xx longitude xx degrees. Negative values are West\n\n\
322 All options can be made default in the config file, or menu-ized for\n\
323 easy selection."));
324 }
325
326
327 /**************************************************
328 * HTML - print css section
329 *************************************************/
330 int print_css (const int external_css)
331 {
332 if (external_css) printf ("\n\t@import \"hcal.css\";\n");
333 else
334 {
335 printf ("\nbody.hebrew { direction: rtl;}\n\
336 img { margin:0; padding: 0; vertical-align: middle; border: 0;}\n\
337 p {}\n\
338 table.main { width: 90%%; table-layout: fixed; font-size: 14pt; border: solid #aaaaaa; }\n\
339 table.day { width: 100%%; height: 100%%; table-layout: fixed; font-size: 14pt; }\n\
340 th.gmonth { font-size: 30pt; font-weight: bold }\n\
341 th.gyear { font-size: 30pt; font-weight: bold}\n\
342 th.hmonth { font-size: 30pt; font-weight: bold}\n\
343 th.hyear {font-size: 30pt; font-weight: bold }\n\
344 th.week { background-color: #aaaaaa; text-align: center; }\n\
345 td.gday { font-size: 30pt; vertical-align: top; }\n\
346 td.hday { font-size: 12pt; vertical-align: top; }\n\
347 td.sat { border: solid #777777; }\n\
348 td.regular { border: solid #aaaaaa; }\n\
349 td.holiday { color: #990000; border: solid #888888; }\n\
350 td.out_of_month { color: #dddddd; border: solid #dddddd; }\n\
351 tr.line1 { height: 30%%; }\n\
352 tr.line2 { height: 50%%; font-size: 30pt; }\n\
353 tr.line3 { height: 20%%; font-size: 12pt; vertical-align: bottom; }\n\
354 span.today { }\n\
355 span.gmonth { font-size: 24pt; }\n\
356 span.gyear { font-size: 24pt; }\n\
357 span.hmonth { font-size: 24pt; }\n\
358 span.hyear { font-size: 24pt; }\n\
359 span.holiday_name { }\n");
360 }
361
362 return 0;
363 }
364
365
366
367 /**************************************************
368 * HTML - print header
369 *************************************************/
370 int print_header_html ( const int external_css, const int force_hebrew)
371 {
372 printf ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\n\
373 <html>\n\
374 <head>\n\
375 <meta name=\"generator\" content=\"hcal (libhdate)\">\n\
376 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\
377 <style title=\"Normal\" type=\"text/css\" media=\"all\">");
378
379 print_css (external_css);
380
381 printf ("</style>\n");
382
383 /* some alternative css styles */
384 printf ("\n\
385 <link rel=\"alternate stylesheet\" title=\"High contrast\" type=\"text/css\" media=\"screen\" href=\"high_contrast.css\">\n\
386 <link rel=\"alternate stylesheet\" title=\"Colorful\" type=\"text/css\" media=\"screen\" href=\"colorful.css\">\n\
387 <link rel=\"alternate stylesheet\" title=\"Print\" type=\"text/css\" media=\"all\" href=\"print.css\">\n");
388
389 if ( (force_hebrew) || (hdate_is_hebrew_locale()) )
390 printf ("<title>Hebrew Calendar</title>\n</head>\n<body class=\"hebrew\"><center>\n");
391 else
392 printf ("<title>Hebrew Calendar</title>\n</head>\n<body><center>\n");
393
394 return 0;
395 }
396
397
398
399 /**************************************************
400 * HTML - print footer
401 *************************************************/
402 int print_html_footer ()
403 {
404 printf ("<!-- <p>\n\
405 <a href=\"http://validator.w3.org/check/referer\">\n<img \
406 src=\"http://www.w3.org/Icons/valid-html401\"\n\
407 alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\" />\n</a>\n");
408 printf ("<a href=\"http://jigsaw.w3.org/css-validator\">\n\
409 <img src=\"http://www.w3.org/Icons/valid-css\" alt=\"Valid CSS!\">\n\
410 </a>\n</p> -->\n");
411
412 printf ("</body></html>\n");
413
414 return 0;
415 }
416
417
418 /**************************************************
419 * Print HTML header - month line
420 *************************************************/
421 void print_header_month_line_html( const header_info header)
422 {
423
424 // TODO - fix bug ellul xxxx - tishrei xxxx+1
425 // char *h_year_1;
426 // h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE);
427 // char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1];
428 char *h_year_1 = NULL;
429
430 /**************************************************
431 * Print Gregorian month and year
432 **************************************************/
433 printf ("<table width=90%%><tr><td align=left><span class=\"gmonth\">%s <span class=\"gyear\">%d</span></td>\n",
434 hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL),
435 header.g_year_1);
436
437 h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW);
438 /**************************************************
439 * Print Hebrew month and year
440 **************************************************/
441 printf ("<td align=right><span class=\"hmonth\">");
442 if (header.h_month_1 != header.h_month_2)
443 {
444 printf ("%s-",
445 hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
446 }
447 printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
448 printf ("</span>\n");
449 printf ("<span class=\"hyear\">%s</span></td></tr></table>\n", h_year_1);
450
451 printf ("<span class=\"month_table\">\n<table class=main>\n");
452
453
454 if (h_year_1 != NULL) free(h_year_1);
455 }
456
457
458 /**************************************************
459 * HTML - print column headings for days of weeks
460 **************************************************/
461 void print_header_dow_line_html()
462 {
463 int j;
464
465 for (j = 1; j < 8; j++)
466 printf ("<th class=\"week\">%3s</th>",
467 hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE));
468 }
469
470
471
472 /**************************************************
473 * end HTML functions
474 *************************************************/
475
476
477 /*************************************************
478 * Display data in a more pleasing visual manner
479 *************************************************/
480 void colorize_element ( const int element )
481 {
482 switch (element) {
483 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
484 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break;
485 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
486 case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break;
487 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
488 case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break;
489 case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break;
490 case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break;
491 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break;
492 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
493 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
494 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
495 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
496 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
497 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
498 }
499 /* switch (element) {
500 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
501 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break;
502 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
503 case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break;
504 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
505 case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break;
506 case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break;
507 case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break;
508 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break;
509 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
510 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
511 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
512 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
513 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
514 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
515 */
516 }
517
518
519
520 /**************************************************
521 * print header - month line to stdout
522 *************************************************/
523 void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi )
524 {
525 char *g_month, *h1_month, *h2_month;
526 char *h1_year = NULL;
527 char *h2_year = NULL;
528 size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len;
529
530
531 char *hebrew_buffer, *hebrew_buffer_next;
532 size_t hebrew_buffer_len, literals_len;
533
534 int j;
535 size_t padding = 0;
536
537
538 /**************************************************
539 * Print Gregorian month and year
540 *************************************************/
541 g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL);
542 if (colorize) colorize_element(ELEMENT_MONTH_G);
543 printf ("%s %d", g_month, header.g_year_1);
544 if (colorize) printf(CODE_RESTORE_VIDEO);
545
546 /**************************************************
547 * Print Hebrew month and year
548 *
549 * because we want this printed right-justified on
550 * the same line, we need to calculate how many
551 * spaces to pad.
552 *
553 * because of the possible user option --bidi, we
554 * need to buffer the entire Hebrew text in order
555 * reverse its sequence for 'visual' display.
556 *
557 * This all requires collecting the data first
558 * and determining each's length.
559 *************************************************/
560
561 #define CALENDAR_WIDTH 41
562 #define DASH_WIDTH 3 // includes surrounding spaces
563 #define SPACE_WIDTH 1
564
565
566 /*************************************************
567 * padding info for gregorian date
568 *************************************************/
569 g_month_len = strlen(g_month);
570 g_year_len = 4;
571 switch (header.g_year_1)
572 {
573 case 1-9: g_year_len = 1; break;
574 case 10-99: g_year_len = 2; break;
575 case 100-999: g_year_len = 3; break;
576 }
577
578
579 /**************************************************
580 * collect padding info for Hebrew date
581 *************************************************/
582 h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew);
583 h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew);
584 //printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0);
585
586 h1_month_len = strlen(h1_month);
587 h1_year_len = strlen(h1_year);
588 // DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len);
589 // DEBUG - int ii; for (ii=0; ii<h1_year_len; ii++) printf("%x ",h1_year[ii]);
590
591 if (header.h_year_1 != header.h_year_2)
592 {
593
594 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
595 h2_year = hdate_string(HDATE_STRING_INT, header.h_year_2, HDATE_STRING_LONG,force_hebrew);
596
597 h2_month_len = strlen(h2_month);
598 h2_year_len = strlen(h2_year);
599 literals_len = SPACE_WIDTH + DASH_WIDTH + SPACE_WIDTH;
600
601 hebrew_buffer_len = h1_month_len + h1_year_len + h2_month_len
602 + h2_year_len + literals_len;
603
604 // printf("\nlength values = %d %d %d %d %d %d\n",h1_month_len , h1_year_len , DASH_WIDTH, h2_month_len, SPACE_WIDTH , h2_year_len);
605 hebrew_buffer = malloc(hebrew_buffer_len+1);
606 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
607 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
608 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
609 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
610 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
611 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
612 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_year, h2_year_len);
613 hebrew_buffer[hebrew_buffer_len]='\0';
614
615 // printf("\nbuffer length = %d\nbuffer contents = %s\n",hebrew_buffer_len, hebrew_buffer); exit(0);
616 // free(hebrew_buffer);
617 }
618 else if (header.h_month_1 != header.h_month_2)
619 {
620 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
621 h2_month_len = strlen(h2_month);
622 literals_len = DASH_WIDTH + SPACE_WIDTH;
623
624 hebrew_buffer_len = h1_month_len + h2_month_len + h1_year_len + literals_len;
625 hebrew_buffer = malloc(hebrew_buffer_len+1);
626 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
627 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
628 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
629 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
630 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
631 hebrew_buffer[hebrew_buffer_len]='\0';
632 }
633 else
634 {
635 h2_month_len = 0;
636 h2_year_len = 0;
637 literals_len = SPACE_WIDTH;
638
639 hebrew_buffer_len = h1_month_len + h1_year_len + literals_len;
640
641 hebrew_buffer = malloc(hebrew_buffer_len+1);
642 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
643 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
644 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
645 hebrew_buffer[hebrew_buffer_len]='\0';
646 }
647
648 if (!force_hebrew)
649 padding = CALENDAR_WIDTH - g_month_len - g_year_len - hebrew_buffer_len ;
650 else
651 padding = CALENDAR_WIDTH - g_month_len - g_year_len - (hebrew_buffer_len/2) - literals_len +1;
652
653
654
655 /**************************************************
656 * print padding
657 *************************************************/
658 for (j = 1; j < (int)padding; j++) printf(" ");
659
660
661 /**************************************************
662 * Print Hebrew month and year
663 *************************************************/
664 if (colorize) colorize_element(ELEMENT_MONTH_H);
665 if (visual_bidi) revstr(hebrew_buffer, hebrew_buffer_len);
666 printf ("%s", hebrew_buffer);
667 if (colorize) printf(CODE_RESTORE_VIDEO);
668
669
670 /**************************************************
671 * free allocated memory
672 *************************************************/
673 if (h1_year != NULL) free(h1_year);
674 // if (header.h_year_1 != header.h_year_2) free(h2_year);
675 if (h2_year != NULL) free(h2_year);
676 free(hebrew_buffer);
677 }
678
679
680 /**************************************************
681 * print column headings for days of weeks
682 **************************************************/
683 void print_header_dow_line_stdout( const int colorize )
684 {
685 int column;
686
687 void print_dow_column( int column )
688 {
689 if (hdate_is_hebrew_locale())
690 { /* Hebrew heading is a single charcter per day */
691 printf ("%s%s%s", " ",
692 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_HEBREW),
693 " ");
694 }
695 else
696 { /* presume three character heading */
697 printf ("%s%3s", " ",
698 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_LOCAL));
699 }
700
701 if (column != 7) printf (" ");
702 }
703
704 if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES);
705 for (column = 1; column < 7; column++) print_dow_column(column);
706 if (colorize) colorize_element(ELEMENT_SHABBAT_NAME);
707 print_dow_column(7);
708 if (colorize) printf(CODE_RESTORE_VIDEO);
709 }
710
711
712
713 /**************************************************
714 * calculate start/end month/year for a calendar
715 **************************************************/
716 header_info calculate_calendar_start_end (const int month, const int year)
717 {
718 hdate_struct h;
719 header_info header;
720
721 hdate_set_gdate (&h, 1, month, year);
722 header.g_month_1 = h.gd_mon;
723 header.g_year_1 = h.gd_year;
724 header.h_month_1 = h.hd_mon;
725 header.h_year_1 = h.hd_year;
726
727
728 hdate_set_jd ( &h, hdate_gdate_to_jd ( 1, month % 12 + 1, ((month==12) ? year+1 : year) ) - 1 );
729 header.g_month_2 = h.gd_mon;
730 header.g_year_2 = h.gd_year;
731 header.h_month_2 = h.hd_mon;
732 header.h_year_2 = h.hd_year;
733
734 return header;
735 }
736
737
738 /**************************************************
739 * print header - year and month
740 *************************************************/
741 int print_header ( const int month, const int year, const option_list opt)
742 {
743 header_info previous_month, current_month, next_month;
744
745
746 /**********************************************************
747 * Preliminary - set dates for begining and end of calendar
748 **********************************************************/
749 current_month = calculate_calendar_start_end(month, year);
750 if (opt.three_month)
751 {
752 previous_month = calculate_calendar_start_end(
753 (month==1 ? 12 : month-1), (month==1 ? year-1 : year) );
754 next_month = calculate_calendar_start_end(
755 (month==12 ? 1 : month+1), (month==12 ? year+1: year) );
756 }
757
758 /**************************************************
759 * HTML output - month header line
760 *************************************************/
761 if (opt.html) print_header_month_line_html(current_month);
762
763
764 /**************************************************
765 * STDOUT output - month header line
766 *************************************************/
767 else
768 {
769 if (opt.three_month)
770 {
771 print_header_month_line_stdout(previous_month, opt.colorize, opt.force_hebrew, opt.bidi);
772 printf(" ");
773 }
774
775 print_header_month_line_stdout(current_month, opt.colorize, opt.force_hebrew, opt.bidi);
776
777 if (opt.three_month)
778 {
779 printf(" ");
780 print_header_month_line_stdout(next_month, opt.colorize, opt.force_hebrew, opt.bidi);
781 }
782 }
783
784 /**************************************************
785 * terminate line
786 **************************************************/
787 if (opt.html) printf ("</tr>\n");
788 else printf ("\n");
789
790
791 /**************************************************
792 * print column headings for days of weeks
793 **************************************************/
794 if (opt.html) print_header_dow_line_html();
795 else
796 {
797 if (opt.three_month)
798 {
799 print_header_dow_line_stdout(opt.colorize);
800 printf(" ");
801 }
802 print_header_dow_line_stdout(opt.colorize);
803 if (opt.three_month)
804 {
805 printf(" ");
806 print_header_dow_line_stdout(opt.colorize);
807 }
808 }
809
810 /**************************************************
811 * terminate line
812 **************************************************/
813 if (opt.html) printf ("</tr>\n");
814 else printf ("\n");
815
816 return 0;
817 }
818
819
820 /**************************************************
821 * print HTML calendar entry (ie. a single day)
822 *************************************************/
823 void print_day_html ( const hdate_struct h, const int month, const option_list opt)
824 {
825
826 int holiday_type;
827 // char *hd_day;
828 // hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE);
829 // char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
830 char *hd_day_str = NULL;
831
832 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
833
834
835 if (h.gd_mon != month) printf ("<td class=\"out_of_month\">");
836 else if (h.hd_dw == SHABBAT) printf ("<td class=\"sat\">");
837 else if (holiday_type) printf ("<td class=\"holiday\">");
838 else printf ("<td class=\"regular\">");
839
840 /* Print a day */
841 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew);
842 printf ("<table class=day><tr class=line1><td class=\"gday\">%2d</td>\n\
843 <td class=\"hday\">%3s&nbsp;%s</td></tr><tr class=line2><td>&nbsp;</td></tr>",
844 h.gd_day,
845 hd_day_str,
846 hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew));
847 if (holiday_type) printf ("<tr class=line3><td class=\"holiday_name\">%s</td></tr>",
848 hdate_string( HDATE_STRING_HOLIDAY,
849 hdate_get_holyday (&h, opt.diaspora),
850 HDATE_STRING_SHORT, HDATE_STRING_LOCAL)
851 );
852 else printf ("<tr class=line3><td class=\"holiday_name\">&nbsp;</td></tr>");
853
854 printf ("</table></td>\n");
855
856 if (hd_day_str != NULL) free(hd_day_str);
857 }
858
859
860 /*************************************************
861 * print stdout calendar entry (ie. a single day)
862 *************************************************/
863 void print_day ( const hdate_struct h, const int month, const option_list opt)
864 {
865
866 // for forcing Hebrew printing of Hebrew data
867 //char *language;
868
869 // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
870 // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1);
871 char *hd_day_str = NULL;
872
873 size_t hd_day_buffer_str_len;
874
875 int holiday_type;
876 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
877
878 /**************************************************
879 * out of month - needs padding
880 *************************************************/
881 if (h.gd_mon != month) printf(" ");
882
883
884 /**************************************************
885 * in month - print the data
886 *************************************************/
887 else
888 {
889 /*************************************************
890 * Gregorian date entry - color prefix
891 *************************************************/
892 if (h.hd_jd == opt.jd_today_g)
893 printf (CODE_REVERSE_VIDEO);
894 else if (opt.colorize)
895 {
896 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
897 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
898 else colorize_element(ELEMENT_WEEKDAY_G);
899 }
900
901 /*************************************************
902 * Gregorian date entry - the day of the month
903 *************************************************/
904 // this next line is necessary to align numbers
905 // correctly with bidi (tested using mlterm)
906 if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) )
907 printf ("%d ", h.gd_day);
908 else printf ("%2d", h.gd_day);
909
910 /*************************************************
911 * Gregorian date entry - color cleanup
912 *************************************************/
913 if ((h.hd_jd == opt.jd_today_g) || (opt.colorize))
914 printf (CODE_RESTORE_VIDEO);
915
916
917 /*************************************************
918 * holiday flag
919 *************************************************/
920 printf ("%c", holiday_flag[holiday_type]);
921
922
923 /*************************************************
924 * Hebrew date entry - color prefix
925 *************************************************/
926 if (h.hd_jd == opt.jd_today_h)
927 printf (CODE_REVERSE_VIDEO);
928 else if (opt.colorize)
929 {
930 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
931 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
932 else colorize_element(ELEMENT_WEEKDAY_H);
933 }
934
935
936 /*************************************************
937 * Hebrew date entry - day of the month
938 *************************************************/
939 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew);
940 if (opt.bidi)
941 {
942 hd_day_buffer_str_len = (size_t) strlen(hd_day_str);
943 if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE)
944 hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1;
945 revstr(hd_day_str, hd_day_buffer_str_len);
946 }
947 if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) &&
948 ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) )
949 { // need to pad Hebrew dates 1-10, 20, 30
950 printf ("%s%s"," ",hd_day_str);
951 }
952 else printf ("%2s", hd_day_str);
953
954 /*************************************************
955 * Hebrew date entry - color cleanup
956 *************************************************/
957 if ((h.hd_jd == opt.jd_today_h) || (opt.colorize))
958 printf (CODE_RESTORE_VIDEO);
959
960 }
961
962 if (hd_day_str != NULL) free(hd_day_str);
963 }
964
965
966 /*************************************************
967 * print a calendar week's entry (ie. seven columns)
968 *************************************************/
969 void print_week( int jd, const int month, const option_list opt)
970 {
971 #define long_parasha_name 0
972
973 hdate_struct h;
974
975 int calendar_column;
976
977 // for opt.shabbat
978 int sun_hour, first_light, talit, sunrise;
979 int midday, sunset, first_stars, three_stars;
980 int this_week;
981 hdate_struct yom_shishi;
982
983 // for opt.parasha
984 int shabbat_name;
985 char *shabbat_name_str, *shabbat_name_buffer;
986 size_t shabbat_name_str_len;
987
988
989 // for forcing Hebrew printing of Hebrew data
990 //char *language;
991
992
993 /**************************************************
994 * for each column of calendar
995 *************************************************/
996 for (calendar_column = 0; calendar_column < 7; calendar_column++)
997 {
998
999 /**************************************************
1000 * Get this day's information
1001 *************************************************/
1002 hdate_set_jd (&h, jd);
1003 if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) )
1004 yom_shishi = h;
1005
1006
1007 /**************************************************
1008 * HTML calendar option
1009 *************************************************/
1010 if (opt.html) print_day_html ( h, month, opt );
1011
1012
1013
1014 /**************************************************
1015 * non-HTML calendar option
1016 *************************************************/
1017 else print_day ( h, month, opt);
1018
1019
1020 /**************************************************
1021 * space between days of week
1022 *************************************************/
1023 if (calendar_column != 6) printf (" ");
1024
1025 /**************************************************
1026 * advance to next day of week
1027 *************************************************/
1028 jd++;
1029 }
1030
1031 /**************************************************
1032 * print end of calendar line
1033 *************************************************/
1034 if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) )
1035 {
1036
1037 /********************************************************
1038 * determine whether this line gets special highlighting
1039 ********************************************************/
1040 if ((opt.colorize)
1041 && ((opt.shabbat) || (opt.parasha))
1042 && ((jd - 1) > opt.jd_today_h)
1043 && (((jd - 1) - opt.jd_today_h) < 7) )
1044 this_week = TRUE;
1045 else this_week = FALSE;
1046
1047 /*************************************************
1048 * print shabbat times
1049 *************************************************/
1050 if (opt.shabbat)
1051 {
1052 // candlelighting times
1053 /// note: compiler incorrectly issued warnings:
1054 /// "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1055 /// The initialization occurs above (~line 1005) "yom_shishi = h"
1056 hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year,
1057 opt.lat, opt.lon, &sunrise, &sunset);
1058
1059 // FIXME - allow for further minhag variation
1060 if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz;
1061 else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES;
1062
1063 if (opt.colorize)
1064 {
1065 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1066 else colorize_element(ELEMENT_SHABBAT_TIMES);
1067 }
1068 printf (" %02d:%02d", sunset / 60, sunset % 60);
1069 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1070
1071 printf(" - ");
1072
1073 // motzay shabat time
1074 hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat,
1075 opt.lon, &sun_hour, &first_light, &talit,
1076 &sunrise, &midday, &sunset,
1077 &first_stars, &three_stars);
1078
1079 // FIXME - allow for further minhag variation
1080 if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz;
1081 else three_stars = three_stars + opt.tz;
1082
1083 if (opt.colorize)
1084 {
1085 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1086 else colorize_element(ELEMENT_SHABBAT_TIMES);
1087 }
1088 printf ("%02d:%02d", three_stars / 60, three_stars % 60);
1089 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1090 }
1091
1092
1093 /*************************************************
1094 * print shabbat name
1095 *************************************************/
1096 if (opt.parasha)
1097 {
1098
1099 /*************************************************
1100 * print shabbat name - force-hebrew setup
1101 *************************************************/
1102 // BUG - this isn't thread-safe
1103 /*if (opt.force_hebrew)
1104 {
1105 language=getenv("LANGUAGE");
1106 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1107 }*/
1108
1109
1110 shabbat_name = hdate_get_parasha (&h, opt.diaspora);
1111 if (shabbat_name) shabbat_name_str =
1112 hdate_string( HDATE_STRING_PARASHA, shabbat_name,
1113 HDATE_STRING_SHORT, opt.force_hebrew);
1114 else
1115 {
1116 shabbat_name = hdate_get_holyday(&h, opt.diaspora);
1117 if (shabbat_name) shabbat_name_str =
1118 hdate_string( HDATE_STRING_HOLIDAY,
1119 shabbat_name,
1120 HDATE_STRING_SHORT, opt.force_hebrew);
1121 }
1122 if (shabbat_name)
1123 {
1124 if (opt.colorize)
1125 {
1126 if (this_week) colorize_element(ELEMENT_THIS_PARASHA);
1127 else colorize_element(ELEMENT_PARASHA);
1128 }
1129 if (opt.bidi)
1130 {
1131 shabbat_name_str_len = strlen(shabbat_name_str);
1132 shabbat_name_buffer = malloc(shabbat_name_str_len+1);
1133 memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len);
1134 shabbat_name_buffer[shabbat_name_str_len] = '\0';
1135 revstr(shabbat_name_buffer, shabbat_name_str_len);
1136
1137 // padding - FIXME - spaces are single-byte, while
1138 // the Hebrew characters are two bytes
1139 const int margin_max = 15;
1140 printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer);
1141
1142 free(shabbat_name_buffer);
1143 }
1144 else printf(" %s", shabbat_name_str);
1145 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1146 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1147 }
1148 }
1149 }
1150 }
1151
1152
1153
1154
1155 /**************************************************
1156 * print month table
1157 *************************************************/
1158 int print_calendar ( const int current_month, const int current_year, const option_list opt)
1159 {
1160 hdate_struct h;
1161 int calendar_line;
1162 int max_calendar_lines = 4;
1163 /// the initializations on next line aren't truly necessary, but they do
1164 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1165 int previous_month = 1, next_month = 1;
1166 int previous_year, next_year;
1167 /// the initializations on next line aren't truly necessary, but they do
1168 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1169 int jd_current_month, jd_previous_month = 1, jd_next_month = 1;
1170
1171 void how_many_calendar_lines( int month, int start_dow )
1172 {
1173 switch (month)
1174 {
1175 case 4:
1176 case 6:
1177 case 9:
1178 case 11: if (start_dow == 7) max_calendar_lines = 6;
1179 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1180 break;
1181 case 1:
1182 case 3:
1183 case 5:
1184 case 7:
1185 case 8:
1186 case 10:
1187 case 12: if (start_dow > 5) max_calendar_lines = 6;
1188 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1189 break;
1190 case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5;
1191 break;
1192 }
1193 }
1194
1195 /*********************************************************
1196 * Preliminaries:
1197 * - Find the first sunday(s) of each calendar
1198 * - Find number of calendar lines
1199 *********************************************************/
1200 hdate_set_gdate (&h, 1, current_month, current_year);
1201 jd_current_month = h.hd_jd - h.hd_dw + 1;
1202 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1203
1204 /*********************************************************
1205 * three months, side-by-side
1206 *********************************************************/
1207 if (opt.three_month)
1208 {
1209 /*********************************************************
1210 * previous month
1211 *********************************************************/
1212 if (current_month == 1)
1213 {
1214 previous_month = 12;
1215 previous_year = current_year - 1;
1216 }
1217 else
1218 {
1219 previous_month = current_month - 1;
1220 previous_year = current_year;
1221 }
1222 hdate_set_gdate (&h, 1, previous_month, previous_year);
1223 jd_previous_month = h.hd_jd - h.hd_dw + 1;
1224 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1225
1226 /*********************************************************
1227 * next month
1228 *********************************************************/
1229 if (current_month == 12)
1230 {
1231 next_month = 1;
1232 next_year = current_year + 1;
1233 }
1234 else
1235 {
1236 next_month = current_month + 1;
1237 next_year = current_year;
1238 }
1239 hdate_set_gdate (&h, 1, next_month, next_year);
1240 jd_next_month = h.hd_jd - h.hd_dw + 1;
1241 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1242 }
1243
1244
1245
1246 /**************************************************
1247 * maximum six lines of calendar
1248 **************************************************/
1249 for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++)
1250 {
1251 if (opt.html) printf ("<tr>\n");
1252
1253 if (opt.three_month)
1254 {
1255 print_week(jd_previous_month, previous_month, opt);
1256 jd_previous_month = jd_previous_month + 7;
1257 printf(" ");
1258 }
1259
1260 print_week(jd_current_month, current_month, opt);
1261 jd_current_month = jd_current_month + 7;
1262
1263
1264 if (opt.three_month)
1265 {
1266 printf(" ");
1267 print_week(jd_next_month, next_month, opt);
1268 jd_next_month = jd_next_month + 7;
1269 }
1270
1271 if (opt.html) printf ("</tr>\n");
1272 else printf ("\n");
1273 }
1274
1275
1276 /**************************************************
1277 * print end of calendar
1278 *************************************************/
1279 if (opt.html) printf ("</table>\n</span>");
1280
1281 return 0;
1282 }
1283
1284
1285
1286
1287
1288
1289 /****************************************************
1290 * print month header, month table, month footnotes
1291 ****************************************************/
1292 int print_month ( const int month, const int year, const option_list opt)
1293 {
1294 hdate_struct h;
1295
1296 // following are for opt.footnote
1297 int jd_counter, holiday;
1298 //char *language; // for forcing Hebrew printing of footnote
1299
1300
1301 /* check if hebrew year (year > 3000) */
1302 if (year > 3000) hdate_set_hdate (&h, 1, month, year);
1303 else hdate_set_gdate (&h, 1, month, year);
1304
1305
1306 print_header (h.gd_mon, h.gd_year, opt);
1307 print_calendar (h.gd_mon, h.gd_year, opt);
1308 printf("\n");
1309
1310
1311 /****************************************************
1312 * print footnotes
1313 ****************************************************/
1314 if (opt.footnote)
1315 {
1316 jd_counter = h.hd_jd;
1317 while ( month == h.gd_mon )
1318 {
1319 holiday = hdate_get_holyday(&h, opt.diaspora);
1320 if (holiday)
1321 {
1322 print_day ( h, month, opt);
1323 /*if (opt.force_hebrew)
1324 {
1325 // BUG - this isn't thread-safe
1326 // --- and it may no longer be nexessary anywhere
1327 // in the code now that I've embedded Hebrew
1328 language=getenv("LANGUAGE");
1329 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1330 }*/
1331 if (opt.colorize)
1332 {
1333 if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME);
1334 else colorize_element(ELEMENT_HOLIDAY_NAME);
1335 }
1336
1337 if (opt.bidi)
1338 {
1339 char *holiday_str, *holiday_buffer;
1340 size_t holiday_str_len;
1341 holiday_str = hdate_string( HDATE_STRING_HOLIDAY,
1342 holiday,
1343 HDATE_STRING_LONG,
1344 opt.force_hebrew);
1345
1346 holiday_str_len = strlen(holiday_str);
1347 holiday_buffer = malloc(holiday_str_len+1);
1348 memcpy(holiday_buffer, holiday_str, holiday_str_len);
1349 holiday_buffer[holiday_str_len] = '\0';
1350 revstr(holiday_buffer, holiday_str_len);
1351
1352 // padding - FIXME - spaces are single-byte, while
1353 // the Hebrew characters are two bytes
1354 const int margin_max = 16; // 15 fails because of jabotinsky in july
1355 printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer);
1356
1357 free(holiday_buffer);
1358 }
1359 else printf (" %s\n",
1360 hdate_string( HDATE_STRING_HOLIDAY,
1361 holiday,
1362 HDATE_STRING_LONG,
1363 opt.force_hebrew));
1364
1365 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1366 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1367 }
1368 jd_counter++;
1369 hdate_set_jd (&h, jd_counter);
1370 }
1371 }
1372 return 0;
1373 }
1374
1375
1376 /****************************************************
1377 * read and parse config file
1378 ****************************************************/
1379 void read_config_file( FILE *config_file,
1380 option_list *opt,
1381 double* latitude,
1382 int* opt_latitude,
1383 double* longitude,
1384 int* opt_longitude,
1385 int* tz )
1386
1387 {
1388 char *input_string;
1389 size_t input_str_len = 100; // WARNING: if you change this value
1390 // you will still have to also
1391 // change a matching value below
1392 // in the statement that includes:
1393 // match_count = sscanf(input_string
1394 char *input_key = "";
1395 char *input_value = "";
1396 int line_count = 0;
1397 int menu_item = 0;
1398 size_t menu_len = 0;
1399 int match_count;
1400 int end_of_input_file = FALSE;
1401 int i;
1402 const int num_of_keys = 20;
1403 const char* key_list[] = { "SUNSET_AWARE", // 0
1404 "LATITUDE",
1405 "LONGITUDE", // 2
1406 "TIMEZONE",
1407 "DIASPORA", // 4
1408 "FORCE_ISRAEL",
1409 "PARASHA_NAMES", // 6
1410 "SHABBAT_INFO",
1411 "FOOTNOTES", // 8
1412 "FORCE_HEBREW",
1413 "OUTPUT_BIDI", //10
1414 "SUPPRESS_REVERSE_VIDEO",
1415 "COLORIZE", //12
1416 "OUTPUT_HTML",
1417 "USE_EXTERNAL_CSS_FILE",
1418 "QUIET_ALERTS",
1419 "THREE_MONTH", //16
1420 "MENU",
1421 "CANDLE_LIGHTING", //18
1422 "HAVDALAH"
1423 };
1424
1425 input_string = malloc(input_str_len+1);
1426 input_key = malloc(input_str_len+1);
1427 input_value = malloc(input_str_len+1);
1428 while ( end_of_input_file!=TRUE )
1429 {
1430 end_of_input_file = getline(&input_string, &input_str_len, config_file);
1431 if ( end_of_input_file!=TRUE )
1432 {
1433 errno = 0;
1434 // The '100' in the next statement is inelegant; it is meant to
1435 // be the value of input_str_len. Alternatively, don't malloc
1436 // input_value above, use the 'a' specifier here, and free(input_value)
1437 // at the end of every successful read and evaluation
1438 match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value);
1439 line_count++;
1440 if (errno != 0) error(0,errno,"scan error at line %d", line_count);
1441 // DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s",
1442 // line_count, match_count, input_key, input_value, input_string);
1443 if (match_count ==2)
1444 {
1445 for (i=0; i<num_of_keys; i++)
1446 {
1447 if (strcmp(input_key, key_list[i]) == 0)
1448 {
1449 // DEBUG - printf("match found!, %s = %s, index = %d\n",input_key,key_list[i],i);
1450 switch(i)
1451 {
1452
1453 case 0:if (strcmp(input_value,"FALSE") == 0) opt->not_sunset_aware = 1;
1454 else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0;
1455 break;
1456 case 1:
1457 parse_coordinate(1, input_value, latitude, opt_latitude);
1458 break;
1459 case 2:
1460 parse_coordinate(2, input_value, longitude, opt_longitude);
1461 break;
1462 case 3:
1463 parse_timezone(input_value, tz);
1464 break;
1465 case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0;
1466 else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1;
1467 break;
1468 case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0;
1469 else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1;
1470 break;
1471 case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0;
1472 else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1;
1473 break;
1474 case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0;
1475 else if (strcmp(input_value,"TRUE") == 0)
1476 {
1477 opt->shabbat = 1;
1478 opt->parasha = 1;
1479 }
1480 break;
1481 case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0;
1482 else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1;
1483 break;
1484 case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0;
1485 else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1;
1486 break;
1487 case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0;
1488 else if (strcmp(input_value,"TRUE") == 0)
1489 {
1490 opt->bidi = 1;
1491 opt->force_hebrew = 1;
1492 }
1493 break;
1494 case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0;
1495 else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1;
1496 break;
1497 case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0;
1498 else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1;
1499 break;
1500 case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0;
1501 else if (strcmp(input_value,"TRUE") == 0) opt->html = 1;
1502 break;
1503 case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0;
1504 else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1;
1505 break;
1506 case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0;
1507 else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1;
1508 break;
1509 case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0;
1510 else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1;
1511 break;
1512
1513 // MENU
1514 case 17:if (menu_item < MAX_MENU_ITEMS)
1515 {
1516 menu_len = strlen(input_value);
1517 opt->menu_item[menu_item] = malloc(menu_len+1);
1518 memcpy(opt->menu_item[menu_item], input_value,menu_len);
1519 menu_item++;
1520 }
1521 break;
1522 // CANDLE_LIGHTING
1523 case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0;
1524 else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1;
1525 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1526 {
1527 opt->candles = atoi(input_value);
1528 if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES;
1529 else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES;
1530 }
1531 break;
1532
1533 // HAVDALAH
1534 case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0;
1535 else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1;
1536 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1537 {
1538 opt->havdalah = atoi(input_value);
1539 if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES;
1540 else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES;
1541 }
1542 break;
1543
1544 } // end of switch(i)
1545 break; // if found a match don't continue for loop
1546 }
1547 }
1548 }
1549 }
1550 }
1551 free(input_string);
1552 free(input_key);
1553 free(input_value);
1554 return;
1555 }
1556
1557
1558 /****************************************************
1559 * exit elegantly
1560 ****************************************************/
1561 void exit_main( option_list *opt, const int exit_code)
1562 {
1563 int i;
1564 for (i=0; i<MAX_MENU_ITEMS; i++)
1565 {
1566 if (opt->menu_item[i] == NULL) break;
1567 free(opt->menu_item[i]);
1568 }
1569 exit (exit_code);
1570 }
1571
1572
1573 /****************************************************
1574 * parse a command-line or a config-file menu line
1575 *
1576 * It was appropriate to make this a function, outside
1577 * of main, because of its dual use and dual reference
1578 ****************************************************/
1579 int hcal_parser( const int switch_arg, option_list *opt,
1580 double *lat, int *opt_latitude,
1581 double *lon, int *opt_Longitude,
1582 int *tz, int long_option_index)
1583
1584 {
1585 int error_detected = 0;
1586
1587 switch (switch_arg)
1588 {
1589
1590 case 0: /* long options */
1591 switch (long_option_index)
1592 {
1593 /* --version */ case 0: print_version (); exit_main(opt, 0); break;
1594 /* --help */ case 1: print_help (); exit_main(opt, 0); break;
1595 /* --no-reverse */ case 2: opt->no_reverse = 1; break;
1596 /* --html */ case 3: break;
1597 /* --parasha */ case 4: break;
1598 /* --shabbat */ case 5: break;
1599 /* --three-month*/ case 6: break;
1600 /* --colorize */ case 7: break;
1601 /* --footnote */ case 8: break;
1602 /* --hebrew */ case 9: break;
1603 /* --israel */ case 10:break;
1604 /* --latitude */ case 11:break;
1605 /* --longitude */ case 12:break;
1606 /* --timezone */ case 13:break;
1607 /* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break;
1608 /* --quiet-alerts*/ case 15: break;
1609 /* --visual */ case 16:
1610 /* --bidi */ case 17: break;
1611 /* --one-month */ case 18: break;
1612 /* --no-visual */ case 19:
1613 /* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break;
1614 /* --no-color */ case 21: opt->colorize = 0; break;
1615 /* --no-footnote*/ case 22: opt->footnote = 0; break;
1616 /* --menu */ case 23: break;
1617 /* --candles */ case 24:
1618 if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1;
1619 else
1620 {
1621 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1622 {
1623 opt->candles = atoi(optarg);
1624 if ( (opt->candles >= MIN_CANDLES_MINUTES) &&
1625 (opt->candles <= MAX_CANDLES_MINUTES) ) break;
1626 }
1627 print_parm_error("--candles");
1628 error_detected++;
1629 }
1630 break;
1631 /* --havdalah */ case 25:
1632 if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1;
1633 else
1634 {
1635 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1636 {
1637 opt->havdalah = atoi(optarg);
1638 if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) &&
1639 (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break;
1640 }
1641 print_parm_error("--havdalah");
1642 error_detected++;
1643 }
1644 break;
1645
1646 } // end switch for long_options
1647 break;
1648
1649
1650 case '1': opt->three_month = 0; break;
1651 case '3': opt->three_month = 1; break;
1652 case 'b': opt->bidi = 1; opt->force_hebrew = 1; break;
1653 case 'c': opt->colorize = 1; break;
1654 case 'd': opt->diaspora = 1; break;
1655 case 'f': opt->footnote = 1; break;
1656 case 'h': opt->html = 1; break;
1657 case 'H': opt->force_hebrew = 1; break;
1658 case 'I': opt->force_israel = 1; break;
1659 case 'i': opt->external_css = 1; break;
1660 case 'm': opt->menu = 1; break;
1661 case 'p': opt->parasha = 1; break;
1662 case 'q': opt->quiet_alerts = 1; break;
1663 case 'l':
1664 error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude);
1665 break;
1666 case 'L':
1667 error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude);
1668 break;
1669 case 's':
1670 opt->shabbat = 1;
1671 opt->parasha = 1;
1672 if (opt->candles == 0) opt->candles = 1;
1673 if (opt->havdalah == 0) opt->havdalah = 1;
1674 break;
1675 case 'z':
1676 error_detected = error_detected + parse_timezone(optarg, tz);
1677 break;
1678 case '?':
1679 // FIXME if (strchr(short_options,optopt)!=NULL)
1680 print_parm_missing_error((char*) &optopt);
1681 error_detected = TRUE;
1682 break;
1683 default: print_usage_hcal (); exit_main(opt, 0); break;
1684 }
1685 return error_detected;
1686 }
1687
1688 /**************************************************
1689 ***************************************************
1690 ***************************************************
1691 * main
1692 ***************************************************
1693 ***************************************************
1694 **************************************************/
1695 int main (int argc, char *argv[])
1696 {
1697
1698 /* date */
1699 int month, year;
1700
1701 double lat = BAD_COORDINATE; /* set to this value for error handling */
1702 double lon = BAD_COORDINATE; /* set to this value for error handling */
1703 int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */
1704
1705 int opt_latitude = 0; /* -l option latitude */
1706 int opt_Longitude = 0; /* -L option longitude */
1707
1708 int error_detected = FALSE; /* exit after reporting ALL bad parms */
1709
1710
1711 option_list opt;
1712 opt.bidi = 0; // visual bidi, implies --force-hebrew
1713 opt.html = 0; // -h html format flag
1714 opt.diaspora = 0; // -d Diaspora holidays
1715 opt.external_css = 0; // -i External css file
1716 opt.parasha = 0; // -p print parasha alongside calendar
1717 opt.shabbat = 0; // -c print candle-lighting alongside calendar
1718 opt.candles = 0;
1719 opt.havdalah = 0;
1720 opt.no_reverse = 0; // don't highlight today in reverse video
1721 opt.three_month = 0; // print previous and next months also
1722 opt.colorize = 0; // display calendar in muted, more pleasing tones
1723 opt.footnote = 0; // display description of month's holidays
1724 opt.force_hebrew = 0; // force display of Hebrew data in Hebrew
1725 opt.force_israel = 0; // override diaspora-awareness
1726 opt.not_sunset_aware = 0; // override sunset-awareness
1727 opt.quiet_alerts = 0;
1728
1729 opt.lat = BAD_COORDINATE;
1730 opt.lon = BAD_COORDINATE;
1731 opt.tz = BAD_TIMEZONE;
1732
1733 opt.menu = 0; // -m print menus for user-selection
1734 int i;
1735 for (i=0; i<MAX_MENU_ITEMS; i++) opt.menu_item[i] = NULL;
1736
1737
1738 // support for getopt short options
1739 static char * short_options = "13bcdfhHiImpqsl:L:z:";
1740
1741 /* support for long options */
1742 int long_option_index = 0;
1743 int c;
1744 static struct option long_options[] = {
1745 // name, has_arg, flag, val
1746 {"version", 0, 0, 0},
1747 {"help", 0, 0, 0},
1748 {"no-reverse", 0, 0, 0},
1749 {"html", 0, 0, 'h'},
1750 {"parasha", 0, 0, 'p'},
1751 {"shabbat", 0, 0, 's'},
1752 {"three-month", 0, 0, '3'},
1753 {"colorize", 0, 0, 'c'},
1754 {"footnote",0,0,'f'},
1755 {"hebrew",0,0,'H'},
1756 {"israel",0,0,'I'},
1757 {"latitude", 1, 0, 'l'},
1758 {"longitude", 1, 0, 'L'},
1759 {"timezone", 1, 0, 'z'},
1760 {"not-sunset-aware", 0, 0, 0},
1761 {"quiet-alerts",0,0,'q'},
1762 {"bidi",0,0,'b'},
1763 {"visual",0,0,'b'},
1764 {"one-month",0,0,'1'},
1765 {"no-bidi",0,0,0},
1766 {"no-visual",0,0,0},
1767 {"no-color",0,0,0},
1768 {"no-footnote",0,0,0},
1769 {"menu",0,0,'m'},
1770 {"candles",2,0,0},
1771 {"havdalah",2,0,0},
1772 {0, 0, 0, 0}
1773 };
1774
1775 /* hdate struct */
1776 hdate_struct h;
1777
1778 // for config file user-defined menus
1779 size_t menu_len = 0;
1780 int menu_index;
1781 char *menuptr, *optptr;
1782
1783 /************************************************************
1784 * init locale
1785 *
1786 * I'm not sure why this had to be done. Per an answer on
1787 * stackoverflow (not yet check out by me):
1788 *
1789 * "At program startup, you should call setlocale():
1790 * setlocale(LC_CTYPE, "");
1791 * This will cause the wide character functions to use the
1792 * appropriate character set defined by the environment - eg.
1793 * on Unix-like systems, the LANG environment variable. For
1794 * example, this means that if your LANG variable is set to a
1795 * UTF8 locale, the wide character functions will handle input
1796 * and output in UTF8. (This is how the POSIX wc utility is
1797 * specified to work). You can then use the wide-character
1798 * versions of all the standard functions. However, if you
1799 * really do want to count characters rather than bytes, and
1800 * can assume that your text files are encoded in UTF-8, then
1801 * the easiest approach is to count all bytes that are not
1802 * trail bytes (i.e., in the range 0x80 to 0xBF)."
1803 *
1804 * Note: the code sets LC_ALL instead of LC_CTYPE; and the
1805 * code does not use wide_char functions ...
1806 ************************************************************/
1807 setlocale (LC_ALL, "");
1808
1809 /************************************************************
1810 * parse config file
1811 ************************************************************/
1812 FILE *config_file = get_config_file("/hcal", "/hcalrc", hcal_config_file_text);
1813 if (config_file != NULL)
1814 {
1815 read_config_file(config_file, &opt, &lat, &opt_latitude, &lon, &opt_Longitude, &tz);
1816 fclose(config_file);
1817 }
1818
1819
1820
1821 /************************************************************
1822 * parse command line
1823 ************************************************************/
1824 while ((c = getopt_long(argc, argv,
1825 short_options, long_options,
1826 &long_option_index)) != -1)
1827 error_detected = error_detected
1828 + hcal_parser(c, &opt,
1829 &lat, &opt_latitude,
1830 &lon, &opt_Longitude,
1831 &tz, long_option_index);
1832
1833
1834 /**************************************************
1835 * BEGIN - enable user-defined menu
1836 *************************************************/
1837 if (opt.menu)
1838 {
1839 i = menu_select( &opt.menu_item[0], MAX_MENU_ITEMS );
1840 if (i == -1) exit_main(&opt, 0);
1841 else if ((i < MAX_MENU_ITEMS) && (opt.menu_item[i] != NULL))
1842 {
1843
1844 /**************************************************
1845 * parse user's menu selection
1846 *************************************************/
1847 menuptr = opt.menu_item[i];
1848 menu_len = strlen( menuptr );
1849 menu_index = 0;
1850 optptr = NULL;
1851 optarg = NULL;
1852
1853 while (( c = menu_item_parse( menuptr, menu_len, &menu_index,
1854 &optptr, short_options, long_options,
1855 &long_option_index, &error_detected) ) != -1)
1856 {
1857 error_detected = error_detected +
1858 hcal_parser(c, &opt,
1859 &lat, &opt_latitude,
1860 &lon, &opt_Longitude,
1861 &tz, long_option_index);
1862 }
1863 }
1864 }
1865 /**************************************************
1866 * END - enable user-defined menu
1867 *************************************************/
1868
1869
1870 /**************************************************
1871 * sanity check - options compatability
1872 *************************************************/
1873 if ( (opt.three_month) &&
1874 ((opt.parasha) || (opt.shabbat) || (opt.footnote) ) )
1875 {
1876 error(0,0,"%s", N_("ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-month' mode"));
1877 opt.parasha = 0;
1878 opt.shabbat = 0;
1879 opt.footnote = 0;
1880 }
1881
1882 /************************************************************
1883 * function validate_location is defined in the include file
1884 * ./location.include.c
1885 * It issues an exit(EXIT_CODE_BAD_PARMS) [==1]
1886 * if it discovers, um, bad parameters
1887 ************************************************************/
1888 validate_location(opt_latitude, opt_Longitude, &lat, &lon, &tz,
1889 opt.quiet_alerts, error_detected, print_usage_hcal);
1890 opt.lat = lat;
1891 opt.lon = lon;
1892 opt.tz = tz;
1893
1894 /************************************************************
1895 * determine what day to highlight (ie. what is today)
1896 ************************************************************/
1897 if ((opt.no_reverse) || (opt.html))
1898 {
1899 // user doesn't want any highlighting
1900 opt.jd_today_g = 0;
1901 opt.jd_today_h = 0;
1902 }
1903 else
1904 {
1905 hdate_set_gdate (&h, 0, 0, 0);
1906 opt.jd_today_g = h.hd_jd;
1907 if ((!opt.not_sunset_aware) &&
1908 (check_for_sunset(&h, lat, lon, tz)) )
1909 opt.jd_today_h = h.hd_jd + 1;
1910 else opt.jd_today_h = h.hd_jd;
1911 }
1912
1913 /**************************************************
1914 * parse and vaildate date parameters
1915 **************************************************/
1916
1917
1918 /**************************************************
1919 * no date parameter provided - use current mm yyyy
1920 * and no need to validate parameters
1921 **************************************************/
1922 if (argc == (optind))
1923 {
1924 if ((opt.not_sunset_aware) || (opt.no_reverse) || (opt.html))
1925 // call function only if not already called
1926 // for sunset awareness, above.
1927 hdate_set_gdate (&h, 0, 0, 0); // today
1928 month = h.gd_mon;
1929 year = h.gd_year;
1930 }
1931 else
1932 {
1933 /********************************************************
1934 * additional parameters provided - get them and validate
1935 ********************************************************/
1936 if (argc == (optind + 2))
1937 {
1938 month = atoi (argv[optind]);
1939 year = atoi (argv[optind + 1]);
1940 }
1941 else if (argc == (optind + 1))
1942 {
1943 month = 0;
1944 year = atoi (argv[optind]);
1945 }
1946 else
1947 {
1948 error(0,0,"%s: %s", N_("error"), N_("too many parameters received. expected [[mm] [yyyy]"));
1949 exit_main(&opt, 0);
1950 }
1951
1952 /********************************************************
1953 * parameter validation - year
1954 ********************************************************/
1955 if (!validate_hdate(CHECK_YEAR_PARM, 0, month, year))
1956 {
1957 print_parm_error(N_("year"));
1958 exit_main(&opt, 0);
1959 }
1960 /********************************************************
1961 * parameter validation - month
1962 ********************************************************/
1963 if ((month!=0) && (!validate_hdate(CHECK_MONTH_PARM, 0, month, year)))
1964 {
1965 print_parm_error(N_("month"));
1966 exit_main(&opt, 0);
1967 }
1968 }
1969
1970
1971 /************************************************************
1972 * begin processing the user request
1973 ************************************************************/
1974
1975 /************************************************************
1976 * diaspora awareness
1977 ************************************************************/
1978 if (opt.force_israel) opt.diaspora = 0;
1979 else
1980 {
1981 tzset();
1982 // system timezone is denominated in seconds
1983 if ( (timezone/-3600) != 2) opt.diaspora = 1;
1984 }
1985
1986 /************************************************************
1987 * print HTML header
1988 ************************************************************/
1989 if (opt.html) print_header_html (opt.external_css, opt.force_hebrew);
1990
1991
1992 /************************************************************
1993 * print one year
1994 ************************************************************/
1995 if (month == 0)
1996 {
1997 if (opt.three_month)
1998 for (month=2; month<13; month=month+3) print_month (month, year, opt);
1999 else for (month=1; month<13; month++)
2000 {
2001 print_month (month, year, opt);
2002 if ((opt.footnote) && month<12) printf("\n");
2003 }
2004 }
2005
2006
2007 /************************************************************
2008 * print only this month
2009 ************************************************************/
2010 else print_month (month, year, opt);
2011
2012
2013 /************************************************************
2014 * print HTML footer
2015 ************************************************************/
2016 if (opt.html) print_html_footer ();
2017
2018 exit_main(&opt, 0);
2019 return 0;
2020 }
0 /* hdate.c http://libhdate.sourceforge.net
1 * Hebrew date/times information(part of package libhdate)
2 *
3 * compile:
4 * gcc `pkg-config --libs --cflags libhdate` hdate.c -o hdate
5 *
6 * Copyright: 2011-2012 (c) Baruch Baum, 2004 (c) Yaacov Zamir
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #define _GNU_SOURCE // For mempcpy, asprintf
23 #include <hdate.h> // For hebrew date
24 //#include "../../src/hdate.h"
25 #include <stdlib.h> // For atoi, getenv, setenv
26 #include <locale.h> // For setlocale
27 #include <getopt.h> // For getopt_long
28 #include <string.h> // For strchr, mempcpy, asprintf
29
30 #include "./local_functions.c"
31
32 #define DATA_WAS_NOT_PRINTED 0
33 #define DATA_WAS_PRINTED 1
34
35 // for opt.menu[MAX_MENU_ITEMS]
36 #define MAX_MENU_ITEMS 10
37
38
39 char *debug_var; // system environment variable
40
41 static char * sunrise_text = N_("sunrise");
42 static char * sunset_text = N_("sunset");
43 static char * first_light_text = N_("first_light");
44 static char * talit_text = N_("talit");
45 static char * midday_text = N_("midday");
46 static char * first_stars_text = N_("first_stars");
47 static char * three_stars_text = N_("three_stars");
48 static char * sun_hour_text = N_("sun_hour");
49 static char * candles_text = N_("candle-lighting");
50 static char * havdalah_text = N_("havdalah");
51
52 typedef struct {
53 int hebrew;
54 int bidi;
55 int yom;
56 int leShabbat;
57 int leSeder;
58 int tablular_output;
59 int not_sunset_aware;
60 int print_tomorrow;
61 int quiet_alerts;
62 int sun;
63 int candles;
64 int havdalah;
65 int times;
66 int short_format;
67 int only_if_holiday;
68 int holidays;
69 int omer;
70 int only_if_parasha;
71 int parasha;
72 int julian;
73 int diaspora;
74 int iCal;
75 int menu;
76 char* menu_item[MAX_MENU_ITEMS];
77 } option_list;
78
79
80 const char* hdate_config_file_text = N_("\
81 # configuration file for hdate - Hebrew date information program\n\
82 # part of package libhdate\n\
83 #\n# Should you mangle this file and wish to restore its default content,\n\
84 # rename or delete this file and run hdate; hdate will automatically\n\
85 # regenerate the default content.\n#\n\
86 # Your system administrator can set system-wide defaults for hcal by\n\
87 # modifying file <not yet implemented>.\n\
88 # You may override all defaults by changing the contents of this file.\n\
89 #\n\
90 # Version information\n\
91 # This may be used by updates to hcal to determine how to parse the file\n\
92 # and whether additional information and options should be appended to\n\
93 # the end of this file.\n\
94 VERSION=2.00\n\
95 #\n\
96 # Location awareness\n\
97 # hdate wants to accurately highlight the current Hebrew day, including\n\
98 # during the hours between sunset and secular midnight. If you don't\n\
99 # provide it with latitude, longitude, and time zone information, hdate\n\
100 # will try to guess the information, based upon your system timezone,\n\
101 # and its (limited, and maybe biased) of the dominant Jewish community\n\
102 # in that timezone. When hdate is forced to guess, it alerts the user\n\
103 # with a message that includes the guessed location.\n\
104 # hdate's guesses will also affect its default behaviour for output of\n\
105 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\
106 #SUNSET_AWARE=TRUE\n\
107 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
108 # degrees[:minutes[:seconds]] with the characters :'\" as possible\n\
109 # delimiters. Use negative values to indicate South and West, or\n\
110 # use the abbreviated compass directions N, S, E, W.\n\
111 #LATITUDE=\n\
112 #LONGITUDE=\n\
113 # TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\
114 # with the characters :'\" as possible delimiters.\n\
115 #TIMEZONE=\n\n\
116 # Output in hebrew characters\n\
117 # hdate defaults to output all information in your default language, so\n\
118 # if your default language is Hebrew, you're all set. Otherwise, you can\n\
119 # set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\
120 # still outputting gregorian information in your default language. To\n\
121 # output ALL information in Hebrew, run something like this:\n\
122 # LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n\
123 # If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\
124 # output, you need to install a terminal font that includes the Hebrew\n\
125 # character set (hint: unicode).\n\
126 #FORCE_HEBREW=FALSE\n\n\
127 # The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\
128 # Unfortunately, the world can not be depended upon to be either. Most\n\
129 # Xwindow applications will display the data fine with FORCE_HEBREW; most\n\
130 # xterm implementations will not. (in fact, the only xterm clone I know\n\
131 # of that comes close is mlterm). If using FORCE_HEBREW results in\n\
132 # Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\
133 # This will reverse the order of the Hebrew characters, so they will\n\
134 # display 'visual'ly correct; however, such output will not be suitable\n\
135 # for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\
136 # automatically forces hebrew.\n\
137 #OUTPUT_BIDI=FALSE\n\n\
138 # The Hebrew language output of Hebrew information can also be 'styled'\n\
139 # in the following ways:\n\
140 # option YOM ~> yom shishi, aleph tishrei ...\n\
141 # option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n\
142 # option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n\
143 #YOM=FALSE\n\
144 #LESHABBAT=FALSE\n\
145 #LESEDER=FALSE\n\
146 \n\
147 #SUN_RISE_SET=FALSE\n\
148 #TIMES_OF_DAY=FALSE\n\
149 #SHORT_FORMAT=FALSE\n\
150 #SEFIRAT_HAOMER=FALSE\n\
151 #DIASPORA=FALSE\n\
152 \n\
153 \n\
154 # Shabbat related\n\
155 # Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\
156 # The command line options for these features are -r (--parasha), and\n\
157 # -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\
158 # before sunset). The HAVDALAH field can accept a value of 20 - 90\n\
159 # (minutes after sunset).\n\
160 #PARASHA_NAMES=FALSE\n\
161 #ONLY_IF_PARASHA_IS_READ=FALSE\n\
162 #SHABBAT_INFO=FALSE\n\n\
163 #CANDLE_LIGHTING=FALSE\n\
164 #HAVDALAH=FALSE\n\n\
165 # Holiday related\n\
166 #HOLIDAYS=FALSE\n\
167 #ONLY_IF_HOLIDAY=FALSE\n\n\
168 # Tabular output\n\
169 # This option has hdate output the information you request in a single\n\
170 # comma-delimited line per day, suitable for piping or import to\n\
171 # spreadsheet formatting applications, etc. To belabor the obvious,\n\
172 # try running - ./hdate 12 2011 -Rt --table |column -s, -t \n\
173 # The command line option for this feature is, um, --table\n\
174 #TABULAR=FALSE\n\n\
175 # iCal format\n\
176 # hdate can output its information in iCal-compatable format\n\
177 # ICAL=FALSE\n\
178 # Suppress alerts and warnings\n\
179 # hdate alerts the user via STDERR when it guesses the user's location.\n\
180 #QUIET_ALERTS=FALSE\n\n\
181 # Julian day number\n\
182 # The Julian day number is a .... See ... for more details.\n\
183 # setting the option JULIAN_DAY will have hdate output that number in\n\
184 # the format JDN-nnnnnnn at the beginning of its first line of output.\n\
185 #JULIAN_DAY=FALSE\n\n\
186 # User-defined menus\n\
187 # You may specify here command-line strings to optionally be parsed\n\
188 # by hcal at execution time. To do so, use the command line option -m\n\
189 # (--menu). hcal will process first the settings of this config file,\n\
190 # then the other settings of your command line, and then will prompt\n\
191 # you for which menu item you would like to select. hcal will process\n\
192 # your menu selection as if it were a new command line, further modifying\n\
193 # all the prior settings.\n\
194 # Only the first ten \"MENU=\" entries will be read. Each line will be\n\
195 # truncated at one hundred characters\n\
196 #MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\
197 #MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n\
198 #MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n\
199 #MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\
200 ");
201
202
203 /************************************************************
204 * print version information
205 ************************************************************/
206 int print_version ()
207 {
208 printf ("%s\n" ,N_("hdate - display Hebrew date information\nversion 1.6"));
209 return 0;
210 }
211
212 /************************************************************
213 * print usage information
214 ************************************************************/
215 void print_usage_hdate ()
216 {
217 printf ("%s\n",
218 N_("Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n\
219 hdate [options] [coordinates timezone] [julian_day]\n\n\
220 coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n\
221 -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\
222 timezone: -z nn[( .nn | :mm )]\n\
223 Try \'hdate --help\' for more information"));
224 }
225
226
227 /************************************************************
228 * print help information
229 ************************************************************/
230 void print_help ()
231 {
232 print_usage_hdate();
233
234 printf ("%s\n", N_("hdate - display Hebrew date information\nOPTIONS:\n\
235 -b --bidi prints hebrew in reverse (visual)\n\
236 --visual\n\
237 -c print Shabbat start/end times.\n\
238 --candles modify default minhag of 20 minutes. (17<n<91)\n\
239 --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n\
240 -d --diaspora use diaspora reading and holidays.\n\
241 -h --holidays print holidays.\n\
242 -H print only it is a holiday.\n\
243 -i --ical use iCal formated output.\n\
244 -j --julian print Julian day number.\n\
245 -m --menu prompt user-defined menu from config file\n\
246 -o --omer print Sefirat Haomer.\n\
247 -q --quiet-alerts suppress warning messages\n\
248 -r --parasha print weekly reading on saturday.\n\
249 -R print only if there is a weekly reading on Shabbat.\n\
250 -s --sun print sunrise/sunset times.\n\
251 -S --short-format print using short format.\n\
252 -t print day times: first light, talit, sunrise,\n\
253 midday, sunset, first stars, three stars.\n\
254 -T --table tabular output, suitable for spreadsheets\n\n\
255 -z --timezone nn timezone, +/-UTC\n\
256 -l --latitude yy latitude yy degrees. Negative values are South\n\
257 -L --longitude xx longitude xx degrees. Negative values are West\n\n\
258 --hebrew forces Hebrew to print in Hebrew characters\n\
259 --yom force Hebrew prefix to Hebrew day of week\n\
260 --leshabbat insert parasha between day of week and day\n\
261 --leseder insert parasha between day of week and day\n\
262 --not-sunset-aware don't display next day if after sunset\n\n\
263 All options can be made default in the config file, or menu-ized for\n\
264 easy selection."));
265 }
266
267
268 /************************************************************
269 * begin - error message functions
270 ************************************************************/
271 void print_alert_sunset ()
272 {
273 error(0,0,"%s", N_("ALERT: The information displayed is for today's Hebrew date.\n \
274 Because it is now after sunset, that means the data is\n \
275 for the Gregorian day beginning at midnight."));
276 }
277 /************************************************************
278 * end - error message functions
279 ************************************************************/
280
281
282
283
284
285 /************************************************************
286 * generic print astronomical time
287 ************************************************************/
288 void print_astronomical_time( const char *description, const int timeval, const int tz)
289 {
290 if (timeval < 0) printf("%s: --:--\n", description);
291 else printf("%s: %02d:%02d\n", description,
292 (timeval+tz) / 60, (timeval+tz) % 60 );
293 return;
294 }
295
296 /************************************************************
297 * generic print astronomical time for tablular output
298 ************************************************************/
299 void print_astronomical_time_tabular( const int timeval, const int tz)
300 {
301 if (timeval < 0) printf(",--:--");
302 else printf(",%02d:%02d",
303 (timeval+tz) / 60, (timeval+tz) % 60 );
304 return;
305 }
306
307
308
309
310 /************************************************************
311 * print iCal header
312 ************************************************************/
313 int print_ical_header ()
314 {
315 /* Print start of iCal format */
316 printf ("BEGIN:VCALENDAR\n");
317 printf ("VERSION:2.0\n");
318 printf ("CALSCALE:GREGORIAN\n");
319 printf ("METHOD:PUBLISH\n");
320
321 return 0;
322 }
323
324
325
326
327 /************************************************************
328 * print iCal footer
329 ************************************************************/
330 int print_ical_footer ()
331 {
332 /* Print end of iCal format */
333 printf ("END:VCALENDAR\n");
334
335 return 0;
336 }
337
338
339
340
341
342 /************************************************************
343 * find Shabbat
344 * this function is to become obsolete - I want a feature
345 * for this standard in libhdate
346 ************************************************************/
347 int find_shabbat (hdate_struct * h, int opt_d)
348 {
349 hdate_struct coming_Shabbat;
350
351 hdate_set_jd (&coming_Shabbat, h->hd_jd+(7-h->hd_dw));
352 /* this return value is the reading number,
353 used to print parshiot */
354 return hdate_get_parasha (&coming_Shabbat, opt_d);
355 }
356
357
358
359 /************************************************************
360 * print one date - both Gregorian and Hebrew
361 ************************************************************/
362 int print_date (hdate_struct * h, hdate_struct * tomorrow, option_list opt, double lat, double lon)
363 {
364 char *motzash = ""; // prefix for Saturday night
365 char *eve_before = ""; // prefix if after sunset
366 char *for_day_of_g = ""; // Hebrew prefix for day of week
367 char *apostrophe = ""; // Hebrew suffix for day of week
368 char *bet_g = ""; // Hebrew prefix for Gregorian month
369 char *bet_h = ""; // Hebrew prefix for Hebrew month
370 char *psik_mark = ""; // --force-yom
371 char *for_day_of_h = ""; // --force-yom
372 char *for_week_of = ""; // --force-leshabbat --force-leseder
373 int is_parasha_read;
374 int h_dow_form = HDATE_STRING_SHORT;
375
376 char *hday_int_str, *hyear_int_str;
377 hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
378 hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
379
380 /*
381 #ifdef ENABLE_NLS
382 locale = setlocale (LC_MESSAGES, NULL);
383 language = getenv ("LANGUAGE");
384 #else
385 locale = NULL;
386 language = NULL;
387 #endif
388 */
389
390 /************************************************************
391 * preliminary - if it's after sunset, it's tomorrow already
392 * but we will only acknowledge this if printing in the long
393 * format (which is the default)
394 ************************************************************/
395 if (opt.print_tomorrow)
396 {
397 if (opt.hebrew)
398 {
399 if (h->hd_dw==7) motzash = "מוצ\"ש, ";
400 if (h->hd_dw==6) eve_before = "ליל";
401 else eve_before = "אור ל";
402 if (!opt.yom) for_day_of_h="-";
403 }
404 else eve_before = N_("eve of ");
405 }
406
407
408 /************************************************************
409 * preliminary - prepare Hebrew prefixes if forcing any Hebrew
410 ************************************************************/
411 if (opt.hebrew)
412 {
413 bet_h="ב";
414 /* preliminary - prepare Yom prefix */
415 if (opt.yom)
416 {
417 if ( !((opt.print_tomorrow) && (h->hd_dw==6))) for_day_of_h="יום";
418 if ( ((h->hd_dw!=7) || ((h->hd_dw==7) && (opt.print_tomorrow))) &&
419 ( !((opt.print_tomorrow) && (h->hd_dw==6))) ) apostrophe = "'";
420 if ((h->hd_dw==6) && (opt.print_tomorrow)) h_dow_form = HDATE_STRING_LONG;
421 psik_mark=",";
422
423 if (opt.leShabbat)
424 {
425 if (h->hd_dw==7) for_week_of="פרשת";
426 else for_week_of="לשבת";
427 }
428 else if (opt.leSeder) for_week_of="לסדר";
429 }
430 }
431
432 /************************************************************
433 * preliminary - prepare the Hebrew prefixes
434 * for the Gregorian month and day of week
435 ************************************************************/
436 if (hdate_is_hebrew_locale())
437 { bet_g="ב"; for_day_of_g="יום ";}
438
439
440
441 /************************************************************
442 * Three major print formats: iCal, short, long
443 ************************************************************/
444
445
446 /************************************************************
447 * iCal format
448 ************************************************************/
449 if (opt.iCal)
450 {
451 printf ("%s%s %s%s ", for_day_of_g, hday_int_str, bet_h,
452 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew));
453
454 printf ("%s", hyear_int_str);
455 }
456
457
458 /************************************************************
459 * short format
460 ************************************************************/
461 else if (opt.short_format)
462 {
463 printf ("%d.%d.%d ", h->gd_day, h->gd_mon, h->gd_year);
464
465
466 if (!hdate_is_hebrew_locale() && (!opt.hebrew))
467 {
468 printf ("%d", h->hd_day);
469 }
470 else
471 {
472 printf ("%s", hday_int_str);
473 }
474
475 printf (" %s %s\n",
476 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
477 hyear_int_str);
478 }
479
480
481 /************************************************************
482 * long (normal) format
483 ************************************************************/
484 else
485 {
486 /************************************************************
487 * Gregorian date - the easy part
488 ************************************************************/
489 printf ("%s%s, %d %s%s %d, ",
490 for_day_of_g,
491 hdate_string( HDATE_STRING_DOW, h->hd_dw, opt.short_format, HDATE_STRING_LOCAL),
492 h->gd_day,
493 bet_g,
494 hdate_string( HDATE_STRING_GMONTH, h->gd_mon, opt.short_format, HDATE_STRING_LOCAL),
495 h->gd_year);
496
497
498 /************************************************************
499 * Start of the Hebrew date
500 ************************************************************/
501 if (opt.print_tomorrow) *h = *tomorrow;
502
503
504 /************************************************************
505 * All these definitions were backports to enable bidi
506 ************************************************************/
507 char *hebrew_buffer, *hebrew_buffer1, *hebrew_buffer2, *hebrew_buffer3, *hebrew_buffer4, *hebrew_buffer_next;
508 size_t hebrew_buffer_len = 0;
509 size_t hebrew_buffer1_len = 0;
510 size_t hebrew_buffer2_len = 0;
511 size_t hebrew_buffer3_len = 0;
512 size_t hebrew_buffer4_len = 0;
513
514
515 /************************************************************
516 * prepare buffers with Hebrew day of week, including
517 * possibly Shabbat name
518 ************************************************************/
519 if (opt.hebrew)
520 {
521 if (opt.yom)
522 {
523 hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s%s%s %s%s", motzash, eve_before, for_day_of_h,
524 hdate_string( HDATE_STRING_DOW, h->hd_dw, h_dow_form, opt.hebrew), apostrophe);
525 if ((opt.leShabbat) || (opt.leSeder))
526 {
527 is_parasha_read = find_shabbat(h, opt.diaspora);
528 if (is_parasha_read)
529 hebrew_buffer2_len = asprintf(&hebrew_buffer2, " %s %s", for_week_of,
530 hdate_string( HDATE_STRING_PARASHA, is_parasha_read, opt.short_format, opt.hebrew)
531 );
532 }
533 hebrew_buffer3_len = asprintf (&hebrew_buffer3, "%s ", psik_mark);
534 }
535 }
536 else hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s", eve_before);
537
538
539 hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
540 hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
541 /************************************************************
542 * prepare buffers with Hebrew dd mmmm yyyy
543 ************************************************************/
544 hebrew_buffer4_len =
545 asprintf (&hebrew_buffer4, "%s %s%s %s",
546 hday_int_str,
547 bet_h,
548 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
549 hyear_int_str);
550
551 /************************************************************
552 * prepare another GrUB - grand unified buffer
553 ************************************************************/
554 hebrew_buffer_len = hebrew_buffer1_len + hebrew_buffer2_len + hebrew_buffer3_len + hebrew_buffer4_len;
555 hebrew_buffer = malloc(hebrew_buffer_len+1);
556
557 hebrew_buffer_next = mempcpy(hebrew_buffer, hebrew_buffer1, hebrew_buffer1_len);
558 if (hebrew_buffer2_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer2, hebrew_buffer2_len);
559 if (hebrew_buffer3_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer3, hebrew_buffer3_len);
560 hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer4, hebrew_buffer4_len);
561 hebrew_buffer[hebrew_buffer_len]='\0';
562 /************************************************************
563 * bidi support (what all the buffering was for)
564 ************************************************************/
565 if (opt.bidi) revstr(hebrew_buffer, hebrew_buffer_len);
566
567 /************************************************************
568 * Finally. print the information
569 ************************************************************/
570 printf ("%s\n", hebrew_buffer);
571
572 /************************************************************
573 * CLEANUP - free allocated memory
574 ************************************************************/
575 if (hebrew_buffer1_len > 0) free(hebrew_buffer1);
576 if (hebrew_buffer2_len > 0) free(hebrew_buffer2);
577 if (hebrew_buffer3_len > 0) free(hebrew_buffer3);
578 free(hebrew_buffer4);
579 free(hebrew_buffer);
580 }
581
582
583 /************************************************************
584 * CLEANUP - free allocated memory
585 ************************************************************/
586 if (hday_int_str != NULL) free(hday_int_str);
587 if (hyear_int_str != NULL) free(hyear_int_str);
588
589 return 0;
590 }
591
592
593
594 /************************************************************
595 * option 's' - sunrise/set times
596 ************************************************************/
597 int
598 print_sunrise (hdate_struct * h, double lat, double lon, int tz, int opt_i)
599 {
600 int sunrise, sunset;
601
602 /* get times */
603 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
604 &sunrise, &sunset);
605
606 print_astronomical_time( sunrise_text, sunrise, tz);
607 print_astronomical_time( sunset_text, sunset, tz);
608
609 return DATA_WAS_PRINTED;
610 }
611
612
613
614 /************************************************************
615 * option 't' - day times
616 ************************************************************/
617 int print_times (hdate_struct * h, double lat, double lon, int tz, int opt_i)
618 {
619 int sun_hour, first_light, talit, sunrise;
620 int midday, sunset, first_stars, three_stars;
621
622 /* get times */
623 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
624 &sun_hour, &first_light, &talit, &sunrise,
625 &midday, &sunset, &first_stars, &three_stars);
626
627 print_astronomical_time( first_light_text, first_light, tz);
628 print_astronomical_time( talit_text, talit, tz);
629 print_astronomical_time( sunrise_text, sunrise, tz);
630 print_astronomical_time( midday_text, midday, tz);
631 print_astronomical_time( sunset_text, sunset, tz);
632 print_astronomical_time( first_stars_text, first_stars, tz);
633 print_astronomical_time( three_stars_text, three_stars, tz);
634 printf("%s: %02d:%02d\n",N_("sun_hour"), sun_hour/60, sun_hour%60);
635
636 return DATA_WAS_PRINTED;
637 }
638
639
640
641 /************************************************************
642 * option 'h' - holiday identification
643 ************************************************************/
644 /* int print_holiday (hdate_struct * h, int opt.diaspora, int short_format, int opt_i)
645 {
646 int holiday;
647
648 holiday = hdate_get_holyday (h, opt.diaspora);
649 if (holiday)
650 {
651 printf ("%s\n", hdate_string (holiday, short_format));
652 return DATA_WAS_PRINTED;
653 }
654 else return DATA_WAS_NOT_PRINTED;
655 }
656 */
657
658 /************************************************************
659 * option 'o' - sefirat ha'omer
660 ************************************************************/
661 int print_omer (hdate_struct * h, int const short_form, int const hebrew_form)
662 {
663 int omer_day;
664
665 omer_day = hdate_get_omer_day(h);
666 if (omer_day != 0)
667 {
668 printf ("%s %s \n", N_("today is day"), hdate_string(HDATE_STRING_OMER, omer_day, short_form, hebrew_form));
669 return DATA_WAS_PRINTED;
670 }
671 else return DATA_WAS_NOT_PRINTED;
672 }
673
674
675
676 /************************************************************
677 * option 'r' - parashat hashavua
678 ************************************************************/
679 /* int print_reading (hdate_struct * h, int opt.diaspora, int short_format, int opt_i)
680 {
681 int reading;
682
683 reading = hdate_get_parasha (h, opt.diaspora);
684 if (reading)
685 {
686 printf ("%s %s\n", N_("Parashat"), hdate_string (reading, short_format));
687 return DATA_WAS_PRINTED;
688 }
689 else return DATA_WAS_NOT_PRINTED;
690 }
691 */
692
693
694 /************************************************************
695 * option 'c' - candle-lighting time; tzeit Shabbat
696 ************************************************************/
697 int print_candles (hdate_struct * h, double lat, double lon, int tz, option_list opt)
698 {
699 int sun_hour, first_light, talit, sunrise;
700 int midday, sunset, first_stars, three_stars;
701
702 // check for friday - print knisat shabat
703 if ( (h->hd_dw == 6) && (opt.candles) )
704 {
705 // get times
706 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
707 &sunrise, &sunset);
708
709 // FIXME - allow for further minhag variation
710 if (opt.candles != 1) sunset = sunset - opt.candles;
711 else sunset = sunset - DEFAULT_CANDLES_MINUTES;
712
713 // print candlelighting times
714 print_astronomical_time( candles_text, sunset, tz);
715 return DATA_WAS_PRINTED;
716 }
717
718 // check for saturday - print motzay shabat
719 else if ( (h->hd_dw == 7) && (opt.havdalah) )
720 {
721 // get times
722 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat,
723 lon, &sun_hour, &first_light, &talit,
724 &sunrise, &midday, &sunset,
725 &first_stars, &three_stars);
726
727 // FIXME - allow for further minhag variation
728 if (opt.havdalah != 1) three_stars = sunset + opt.havdalah;
729
730 // print motzay shabat
731 print_astronomical_time( havdalah_text, three_stars, tz);
732 return DATA_WAS_PRINTED;
733 }
734 else return DATA_WAS_NOT_PRINTED;
735 }
736
737 /************************************************************
738 * print tabular header
739 ************************************************************/
740 void print_tabular_header( option_list opt)
741 {
742 printf("%s,%s",N_("Gregorian date"), N_("Hebrew Date"));
743 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 );
744 else if (opt.sun) printf(",%s,%s",sunrise_text,sunset_text);
745 if (opt.candles) printf(",%s", candles_text);
746 if (opt.havdalah) printf(",%s", havdalah_text);
747 if (opt.holidays) printf(",%s",N_("holiday"));
748 if (opt.omer) printf(",%s",N_("omer count"));
749 if (opt.parasha) printf(",%s",N_("parashat"));
750 printf("\n");
751 return;
752 }
753
754 /************************************************************
755 * print one day - tabular output *
756 ************************************************************/
757 int print_tabular_day (hdate_struct * h, option_list opt,
758 double lat, double lon, int tz)
759 {
760 int sun_hour = -1;
761 int first_light = -1;
762 int talit = -1;
763 int sunrise = -1;
764 int midday = -1;
765 int sunset = -1;
766 int first_stars = -1;
767 int three_stars = -1;
768
769 hdate_struct tomorrow;
770 int data_printed = 0;
771
772 int parasha = 0;
773 int holiday = 0;
774 int omer_day = 0;
775
776 char *hday_str = NULL;
777 char *hyear_str = NULL;
778
779 // for bidi (revstr)
780 char *hebrew_buffer = NULL;
781 size_t hebrew_buffer_len = 0;
782
783 /************************************************************
784 * options -R, -H are restrictive filters, so if there is no
785 * parasha reading / holiday, print nothing.
786 ************************************************************/
787 parasha = hdate_get_parasha (h, opt.diaspora);
788 holiday = hdate_get_holyday (h, opt.diaspora);
789 if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday)
790 return 0;
791 if (opt.only_if_parasha && !opt.only_if_holiday && !parasha)
792 return 0;
793 if (opt.only_if_holiday && !opt.only_if_parasha && !holiday)
794 return 0;
795
796
797
798 /************************************************************
799 * print Gregorian date
800 ************************************************************/
801 printf ("%d.%d.%d,", h->gd_day, h->gd_mon, h->gd_year);
802
803
804 /************************************************************
805 * begin - print Hebrew date
806 ************************************************************/
807
808 // BUG - looks like a bug - why sunset awareness in tabular output?
809 if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1);
810
811 if (opt.bidi)
812 {
813 hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
814 hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
815 hebrew_buffer_len =
816 asprintf (&hebrew_buffer, "%s %s %s",
817 hday_str,
818 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
819 hyear_str);
820 revstr(hebrew_buffer, hebrew_buffer_len);
821 printf ("%s", hebrew_buffer);
822 if (hebrew_buffer != NULL) free(hebrew_buffer);
823 }
824 else
825 {
826 // review sometime whether both checks are still necessary (see below for hyear)
827 //if ((!hdate_is_hebrew_locale()) && (!opt.hebrew))
828 //{ /* non hebrew numbers */
829 // printf ("%d", h->hd_day);
830 //}
831 //else /* Hebrew */
832 //{
833 hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,opt.hebrew);
834 printf ("%s", hday_str);
835 //}
836
837 printf (" %s ",
838 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, opt.hebrew));
839
840 hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,opt.hebrew);
841 printf ("%s", hyear_str);
842 }
843 if (hday_str != NULL) free(hday_str);
844 if (hyear_str != NULL) free(hyear_str);
845 /************************************************************
846 * end - print Hebrew date
847 ************************************************************/
848
849
850 if (opt.times)
851 {
852 /* get astronomical times */
853 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
854 &sun_hour, &first_light, &talit, &sunrise,
855 &midday, &sunset, &first_stars, &three_stars);
856 /* print astronomical times */
857 print_astronomical_time_tabular( first_light, tz);
858 print_astronomical_time_tabular( talit, tz);
859 print_astronomical_time_tabular( sunrise, tz);
860 print_astronomical_time_tabular( midday, tz);
861 print_astronomical_time_tabular( sunset, tz);
862 print_astronomical_time_tabular( first_stars, tz);
863 print_astronomical_time_tabular( three_stars, tz);
864 printf(",%02d:%02d",sun_hour/60, sun_hour%60);
865 }
866 else if (opt.sun)
867 {
868 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
869 &sunrise, &sunset);
870 print_astronomical_time_tabular( sunrise, tz);
871 print_astronomical_time_tabular( sunset, tz);
872 }
873
874 if (opt.candles)
875 {
876 if ( (h->hd_dw != 6) && (!opt.only_if_parasha) ) sunset = -1; //printf(",");
877 else
878 {
879 if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon,
880 h->gd_year, lat, lon, &sunrise, &sunset);
881 if (opt.candles != 1) sunset = sunset - opt.candles;
882 else sunset = sunset- DEFAULT_CANDLES_MINUTES;
883 }
884 print_astronomical_time_tabular( sunset, tz);
885 }
886
887 if (opt.havdalah)
888 {
889 if ( (h->hd_dw != 7) && (!opt.only_if_parasha) ) three_stars = -1; //printf(",");
890 else
891 {
892 if (opt.havdalah != 1)
893 {
894 if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon,
895 h->gd_year, lat, lon, &sunrise, &sunset);
896 three_stars = sunset + opt.havdalah;
897 }
898 else
899 {
900 if(three_stars == -1) hdate_get_utc_sun_time_full (
901 h->gd_day, h->gd_mon, h->gd_year, lat,
902 lon, &sun_hour, &first_light, &talit,
903 &sunrise, &midday, &sunset,
904 &first_stars, &three_stars);
905 }
906 }
907 print_astronomical_time_tabular( three_stars, tz);
908 }
909
910 if (opt.holidays && holiday)
911 printf (",%s",
912 hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew));
913
914 if (opt.omer)
915 {
916 omer_day = hdate_get_omer_day(h);
917 if (omer_day != 0) printf (",%d", omer_day);
918 }
919
920 if (opt.parasha && parasha)
921 {
922 if (!opt.bidi) printf (",%s",
923 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
924 else
925 {
926 hebrew_buffer_len = asprintf (&hebrew_buffer, "%s",
927 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
928 revstr(hebrew_buffer, hebrew_buffer_len);
929 printf (",%s", hebrew_buffer);
930 if (hebrew_buffer != NULL) free(hebrew_buffer);
931 }
932 }
933 printf("\n");
934
935 if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset();
936
937 return 0;
938 }
939
940
941
942
943 /************************************************************
944 * print one day - regular output
945 ************************************************************/
946 int print_day (hdate_struct * h, option_list opt,
947 double lat, double lon, int tz)
948 {
949
950 time_t t;
951 hdate_struct tomorrow;
952
953 int iCal_uid_counter = 0;
954 int data_printed = 0;
955 int parasha = 0;
956 int holiday = 0;
957
958
959 /************************************************************
960 * options -R, -H are restrictive filters, so if there is no
961 * parasha reading / holiday, print nothing.
962 ************************************************************/
963 parasha = hdate_get_parasha (h, opt.diaspora);
964 holiday = hdate_get_holyday (h, opt.diaspora);
965 if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday)
966 return 0;
967 if (opt.only_if_parasha && !opt.only_if_holiday && !parasha)
968 return 0;
969 if (opt.only_if_holiday && !opt.only_if_parasha && !holiday)
970 return 0;
971
972
973 /************************************************************
974 * print the iCal event header
975 ************************************************************/
976 if (opt.iCal)
977 {
978 printf ("BEGIN:VEVENT\n");
979 printf ("UID:hdate-%ld-%d\n", time(&t), ++iCal_uid_counter);
980 printf ("DTSTART;VALUE=DATE:%04d%02d%02d\n", h->gd_year,
981 h->gd_mon, h->gd_day);
982 printf ("SUMMARY:");
983 }
984
985
986 /************************************************************
987 * print the Julian Day Number
988 ************************************************************/
989 if (opt.julian) printf ("JDN-%d ", h->hd_jd);
990
991
992 /************************************************************
993 * print the date
994 ************************************************************/
995 if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1);
996 print_date (h, &tomorrow, opt, lat, lon);
997
998
999
1000 /************************************************************
1001 * begin - print additional information for day
1002 ************************************************************/
1003 if (opt.print_tomorrow) *h = tomorrow;
1004 if (opt.sun) data_printed = data_printed | print_sunrise (h, lat, lon, tz, opt.iCal);
1005 if (opt.times) data_printed = data_printed | print_times (h, lat, lon, tz, opt.iCal);
1006 if (opt.holidays && holiday)
1007 {
1008 printf ("%s\n",
1009 hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew));
1010 data_printed = DATA_WAS_PRINTED;
1011 }
1012 if (opt.omer) data_printed = data_printed | print_omer (h, opt.short_format, opt.hebrew);
1013 if (opt.parasha && parasha)
1014 {
1015 printf ("%s %s\n", N_("Parashat"),
1016 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
1017 data_printed = DATA_WAS_PRINTED;
1018 }
1019 if (opt.candles || opt.havdalah) data_printed = data_printed | print_candles (h, lat, lon, tz, opt);
1020 if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset();
1021 /************************************************************
1022 * end - print additional information for day
1023 ************************************************************/
1024
1025
1026
1027
1028 /************************************************************
1029 * print the iCal event footer
1030 ************************************************************/
1031 if (opt.iCal)
1032 {
1033 printf ("\nCLASS:PUBLIC\n");
1034 printf ("DTEND;VALUE=DATE:%04d%02d%02d\n", h->gd_year,
1035 h->gd_mon, h->gd_day);
1036 printf ("CATEGORIES:Holidays\n");
1037 printf ("END:VEVENT\n");
1038 }
1039
1040 return 0;
1041 }
1042
1043
1044
1045 /************************************************************
1046 * print one Gregorian month - tabular output
1047 ************************************************************/
1048 int print_tabular_gmonth( option_list opt,
1049 double lat, double lon, int tz, int month, int year)
1050 {
1051 hdate_struct h;
1052 int jd;
1053
1054 /* get date of month start */
1055 hdate_set_gdate (&h, 1, month, year);
1056 jd = h.hd_jd;
1057
1058 /* print month days */
1059 while (h.gd_mon == month)
1060 {
1061 print_tabular_day (&h, opt, lat, lon, tz);
1062 jd++;
1063 hdate_set_jd (&h, jd);
1064 }
1065
1066 return 0;
1067 }
1068
1069
1070
1071 /************************************************************
1072 * print one Gregorian month - regular output
1073 ************************************************************/
1074 int print_gmonth (option_list opt, double lat, double lon, int tz,
1075 int month, int year)
1076 {
1077 hdate_struct h;
1078 int jd;
1079
1080 /* get date of month start */
1081 hdate_set_gdate (&h, 1, month, year);
1082 jd = h.hd_jd;
1083
1084 /* print month header */
1085 if (!opt.iCal && !opt.short_format)
1086 printf ("\n%s:\n",
1087 hdate_string( HDATE_STRING_GMONTH, h.gd_mon, opt.short_format, HDATE_STRING_LOCAL));
1088
1089 /* print month days */
1090 while (h.gd_mon == month)
1091 {
1092 print_day (&h, opt, lat, lon, tz);
1093
1094 jd++;
1095 hdate_set_jd (&h, jd);
1096 }
1097
1098 return 0;
1099 }
1100
1101
1102
1103 /************************************************************
1104 * print one Hebrew month - tabular output *
1105 ************************************************************/
1106 int print_tabular_hmonth
1107 ( option_list opt, double lat, double lon, int tz,
1108 int month, int year)
1109 {
1110 hdate_struct h;
1111 int jd;
1112
1113 /* get date of month start */
1114 hdate_set_hdate (&h, 1, month, year);
1115 jd = h.hd_jd;
1116
1117 /* print month days */
1118 while (h.gd_mon == month)
1119 {
1120 print_tabular_header( opt );
1121 print_tabular_day (&h, opt, lat, lon, tz);
1122 jd++;
1123 hdate_set_jd (&h, jd);
1124 }
1125
1126 return 0;
1127 }
1128
1129
1130 /************************************************************
1131 * print one Hebrew month - regular output
1132 ************************************************************/
1133 int print_hmonth (hdate_struct * h, option_list opt,
1134 double lat, double lon, int tz, int month, int year)
1135 {
1136 int jd;
1137
1138 /* get date of month start */
1139 jd = h->hd_jd;
1140
1141 /* print month header */
1142 if (!opt.iCal && !opt.short_format)
1143 printf ("\n%s:\n",
1144 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew));
1145
1146 /* print month days */
1147 while (h->hd_mon == month)
1148 {
1149 print_day (h, opt, lat, lon, tz);
1150
1151 jd++;
1152 hdate_set_jd (h, jd);
1153 }
1154 return 0;
1155 }
1156
1157
1158
1159 /************************************************************
1160 * print one Gregorian year - tabular output *
1161 ************************************************************/
1162 int print_tabular_gyear
1163 ( option_list opt, double lat, double lon, int tz, int year)
1164 {
1165 int month = 1;
1166 while (month < 13)
1167 {
1168 print_tabular_gmonth(opt, lat, lon, tz, month, year);
1169 month++;
1170 }
1171 return 0;
1172 }
1173
1174
1175 /************************************************************
1176 * print one Hebrew year - tabular output *
1177 ************************************************************/
1178 int print_tabular_hyear
1179 ( option_list opt, double lat, double lon, int tz, int year)
1180 {
1181 hdate_struct h;
1182 int month = 1;
1183
1184 /* print year months */
1185 while (month < 13)
1186 {
1187 /* get date of month start */
1188 hdate_set_hdate (&h, 1, month, year);
1189
1190 /* if leap year, print both Adar months */
1191 if (h.hd_size_of_year > 365 && month == 6)
1192 {
1193 hdate_set_hdate (&h, 1, 13, year);
1194 print_tabular_hmonth(opt, lat, lon, tz, 13, year);
1195 hdate_set_hdate (&h, 1, 14, year);
1196 print_tabular_hmonth(opt, lat, lon, tz, 14, year);
1197 }
1198 else
1199 {
1200 print_tabular_hmonth(opt, lat, lon, tz, month, year);
1201 }
1202 month++;
1203 }
1204 return 0;
1205 }
1206
1207
1208
1209 /************************************************************
1210 * print one Gregorian year - regular output
1211 ************************************************************/
1212 int print_gyear (option_list opt, double lat, double lon, int tz, int year)
1213 {
1214
1215 int month = 1;
1216
1217 /* print year header */
1218 if (!opt.iCal && !opt.short_format)
1219 printf ("%d:\n", year);
1220
1221 /* print year months */
1222 while (month < 13)
1223 {
1224 print_gmonth ( opt, lat, lon, tz, month, year);
1225 month++;
1226 }
1227
1228 return 0;
1229 }
1230
1231
1232
1233 /************************************************************
1234 * print one hebrew year - regular output
1235 ************************************************************/
1236 int print_hyear (option_list opt, double lat, double lon, int tz, int year)
1237 {
1238 hdate_struct h;
1239 int month = 1;
1240
1241 char *h_int_str;
1242 h_int_str = hdate_string(HDATE_STRING_INT, year,HDATE_STRING_LONG,opt.hebrew);
1243 // FIXME - error check for NULL return value
1244
1245 /* print year header */
1246 if (!opt.iCal && !opt.short_format) printf ("%s:\n", h_int_str);
1247
1248 /* print year months */
1249 while (month < 13)
1250 {
1251 /* get date of month start */
1252 hdate_set_hdate (&h, 1, month, year);
1253
1254 /* if leap year, print both Adar months */
1255 if (h.hd_size_of_year > 365 && month == 6)
1256 {
1257 hdate_set_hdate (&h, 1, 13, year);
1258 print_hmonth (&h, opt, lat, lon, tz, 13, year);
1259 hdate_set_hdate (&h, 1, 14, year);
1260 print_hmonth (&h, opt, lat, lon, tz, 14, year);
1261 }
1262 else
1263 {
1264 print_hmonth (&h, opt, lat, lon, tz, month, year);
1265 }
1266 month++;
1267 }
1268
1269 return 0;
1270 }
1271
1272
1273
1274 /****************************************************
1275 * read and parse config file
1276 ****************************************************/
1277 void read_config_file( FILE *config_file,
1278 option_list *opt,
1279 double* latitude,
1280 int* opt_latitude,
1281 double* longitude,
1282 int* opt_longitude,
1283 int* tz )
1284 {
1285 char *input_string;
1286 size_t input_str_len = 100; // WARNING: if you change this value
1287 // you will still have to also
1288 // change a matching value below
1289 // in the statement that includes:
1290 // match_count = sscanf(input_string
1291 char *input_key = "";
1292 char *input_value = "";
1293 int menu_item = 0;
1294 size_t menu_len = 0;
1295 int line_count = 0;
1296 int match_count;
1297 int end_of_input_file = FALSE;
1298 int i;
1299 const int num_of_keys = 26;
1300 const char* key_list[] = { "SUNSET_AWARE", // 0
1301 "LATITUDE",
1302 "LONGITUDE", // 2
1303 "TIMEZONE",
1304 "DIASPORA", // 4
1305 "FORCE_ISRAEL",
1306 "PARASHA_NAMES", // 6
1307 "SHABBAT_INFO",
1308 "FORCE_HEBREW", // 8
1309 "OUTPUT_BIDI",
1310 "QUIET_ALERTS", //10
1311 "YOM",
1312 "LESHABBAT", //12
1313 "LESEDER",
1314 "TABULAR", //14
1315 "ICAL",
1316 "SEFIRAT_HAOMER", //16
1317 "SHORT_FORMAT",
1318 "TIMES_OF_DAY", //18
1319 "SUN_RISE_SET",
1320 "ONLY_IF_PARASHA_IS_READ",
1321 "ONLY_IF_HOLIDAY",
1322 "JULIAN_DAY", //22
1323 "CANDLE_LIGHTING",
1324 "HAVDALAH", //24
1325 "MENU"
1326 };
1327
1328 input_string = malloc(input_str_len+1);
1329 input_key = malloc(input_str_len+1);
1330 input_value = malloc(input_str_len+1);
1331
1332 while ( end_of_input_file != TRUE )
1333 {
1334 end_of_input_file = getline(&input_string, &input_str_len, config_file);
1335 if ( end_of_input_file != TRUE )
1336 {
1337 errno = 0;
1338 // The '100' in the next statement is inelegant; it is meant to
1339 // be the value of input_str_len. Alternatively, don't malloc
1340 // input_value above, use the 'a' specifier here, and free(input_value)
1341 // at the end of every successful read and evaluation
1342 match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value);
1343 line_count++;
1344 if (errno != 0) error(0,errno,"scan error at line %d", line_count);
1345 if (match_count ==2)
1346 {
1347 for (i=0; i<num_of_keys; i++)
1348 {
1349 if (strcmp(input_key, key_list[i]) == 0)
1350 {
1351 switch(i)
1352 {
1353
1354 // SUNSET_AWARE
1355 case 0:if (strcmp(input_value,"FALSE") == 0) opt->not_sunset_aware = 1;
1356 else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0;
1357 break;
1358
1359 // LATITUDE
1360 case 1:
1361 parse_coordinate(1, input_value, latitude, opt_latitude);
1362 break;
1363
1364 // LONGITUDE
1365 case 2:
1366 parse_coordinate(2, input_value, longitude, opt_longitude);
1367 break;
1368
1369 // TIMEZONE
1370 case 3:
1371 parse_timezone(input_value, tz);
1372 break;
1373
1374 // DIASPORA
1375 case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0;
1376 else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1;
1377 break;
1378
1379
1380 // case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0;
1381 // else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1;
1382 break;
1383
1384 // PARASHA_NAMES
1385 case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0;
1386 else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1;
1387 break;
1388
1389 // SHABBAT_INFO
1390 case 7:if (strcmp(input_value,"FALSE") == 0)
1391 {
1392 // maybe not do anything if set FALSE
1393 opt->candles = 0;
1394 opt->havdalah = 0;
1395 opt->parasha = 0;
1396 }
1397 else if (strcmp(input_value,"TRUE") == 0)
1398 {
1399 opt->candles = 1;
1400 opt->havdalah = 1;
1401 opt->parasha = 1;
1402 }
1403 break;
1404
1405 // FORCE_HEBREW
1406 case 8:if (strcmp(input_value,"FALSE") == 0) opt->hebrew = 0;
1407 else if (strcmp(input_value,"TRUE") == 0) opt->hebrew = 1;
1408 break;
1409
1410 // OUTPUT_BIDI
1411 case 9:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0;
1412 else if (strcmp(input_value,"TRUE") == 0)
1413 {
1414 opt->bidi = 1;
1415 opt->hebrew = 1;
1416 }
1417 break;
1418
1419 // QUIET_ALERTS
1420 case 10:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0;
1421 else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1;
1422 break;
1423
1424 // YOM
1425 case 11:if (strcmp(input_value,"FALSE") == 0) opt->yom = 0;
1426 else if (strcmp(input_value,"TRUE") == 0)
1427 {
1428 opt->yom = 1;
1429 opt->hebrew = 1;
1430 }
1431 break;
1432
1433 // LESHABBAT
1434 case 12:if (strcmp(input_value,"FALSE") == 0) opt->leShabbat = 0;
1435 else if (strcmp(input_value,"TRUE") == 0)
1436 {
1437 opt->leShabbat = 1;
1438 opt->yom = 1;
1439 opt->hebrew = 1;
1440 }
1441 break;
1442
1443 // LESEDER
1444 case 13:if (strcmp(input_value,"FALSE") == 0) opt->leSeder = 0;
1445 else if (strcmp(input_value,"TRUE") == 0)
1446 {
1447 opt->leSeder = 1;
1448 opt->yom = 1;
1449 opt->hebrew = 1;
1450 }
1451 break;
1452
1453 // TABULAR
1454 case 14:if (strcmp(input_value,"FALSE") == 0) opt->tablular_output = 0;
1455 else if (strcmp(input_value,"TRUE") == 0) opt->tablular_output = 1;
1456 break;
1457
1458 // ICAL
1459 case 15:if (strcmp(input_value,"FALSE") == 0) opt->iCal = 0;
1460 else if (strcmp(input_value,"TRUE") == 0) opt->iCal = 1;
1461 break;
1462
1463 // SEFIRAT_HAOMER
1464 case 16:if (strcmp(input_value,"FALSE") == 0) opt->omer = 0;
1465 else if (strcmp(input_value,"TRUE") == 0) opt->omer = 1;
1466 break;
1467
1468 // SHORT_FORMAT
1469 case 17:if (strcmp(input_value,"FALSE") == 0) opt->short_format = 0;
1470 else if (strcmp(input_value,"TRUE") == 0) opt->short_format = 1;
1471 break;
1472
1473 // TIMES_OF_DAY
1474 case 18:if (strcmp(input_value,"FALSE") == 0) opt->times = 0;
1475 else if (strcmp(input_value,"TRUE") == 0) opt->times = 1;
1476 break;
1477
1478 // SUN_RISE_SET
1479 case 19:if (strcmp(input_value,"FALSE") == 0) opt->sun = 0;
1480 else if (strcmp(input_value,"TRUE") == 0) opt->sun = 1;
1481 break;
1482
1483 // ONLY_IF_PARASHA_IS_READ
1484 case 20:if (strcmp(input_value,"FALSE") == 0) opt->only_if_parasha = 0;
1485 else if (strcmp(input_value,"TRUE") == 0) opt->only_if_parasha = 1;
1486 break;
1487
1488 // ONLY_IF_HOLIDAY
1489 case 21:if (strcmp(input_value,"FALSE") == 0) opt->only_if_holiday = 0;
1490 else if (strcmp(input_value,"TRUE") == 0) opt->only_if_holiday = 1;
1491 break;
1492
1493 // JULIAN_DAY
1494 case 22:if (strcmp(input_value,"FALSE") == 0) opt->julian = 0;
1495 else if (strcmp(input_value,"TRUE") == 0) opt->julian = 1;
1496 break;
1497
1498 // CANDLE_LIGHTING
1499 case 23:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0;
1500 else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1;
1501 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1502 {
1503 opt->candles = atoi(input_value);
1504 if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES;
1505 else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES;
1506 }
1507 break;
1508
1509 // HAVDALAH
1510 case 24:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0;
1511 else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1;
1512 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1513 {
1514 opt->havdalah = atoi(input_value);
1515 if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES;
1516 else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES;
1517 }
1518 break;
1519
1520 // MENU
1521 case 25:if (menu_item < MAX_MENU_ITEMS)
1522 {
1523 menu_len = strlen(input_value);
1524 opt->menu_item[menu_item] = malloc(menu_len+1);
1525 memcpy(opt->menu_item[menu_item], input_value,menu_len);
1526 menu_item++;
1527 }
1528 break;
1529
1530 } // end of switch(i)
1531 break; // if found a match don't continue for loop
1532 }
1533 }
1534 }
1535 }
1536 }
1537 free(input_string);
1538 free(input_key);
1539 free(input_value);
1540 return;
1541 }
1542
1543
1544 /****************************************************
1545 * exit elegantly
1546 ****************************************************/
1547 void exit_main( option_list *opt, int exit_code)
1548 {
1549 int i;
1550 for (i=0; i<MAX_MENU_ITEMS; i++)
1551 {
1552 if (opt->menu_item[i] == NULL) break;
1553 free(opt->menu_item[i]);
1554 }
1555 exit (exit_code);
1556 }
1557
1558
1559
1560 /****************************************************
1561 * parse a command-line or a config-file menu line
1562 *
1563 * It was appropriate to make this a function, outside
1564 * of main, because of its dual use and dual reference
1565 ****************************************************/
1566 int hdate_parser( int switch_arg, option_list *opt,
1567 double *lat, int *opt_latitude,
1568 double *lon, int *opt_Longitude,
1569 int *tz, int long_option_index)
1570 {
1571 int error_detected = 0;
1572
1573 switch (switch_arg)
1574 {
1575
1576 case 0: /* long options */
1577 switch (long_option_index)
1578 {
1579 /* --version */ case 0: print_version (); exit_main(opt,0); break;
1580 /* --help */ case 1: print_help (); exit_main(opt,0); break;
1581 /* --hebrew */ case 2: opt->hebrew = 1; break;
1582 /* --yom */ case 3:
1583 opt->yom = 1;
1584 opt->hebrew = 1;
1585 break;
1586 /* --leshabbat */ case 4:
1587 opt->leShabbat = 1;
1588 opt->yom = 1;
1589 opt->hebrew = 1;
1590 break;
1591 /* --leseder */ case 5:
1592 opt->leSeder = 1;
1593 opt->yom = 1;
1594 opt->hebrew = 1;
1595 break;
1596 /* --table */ case 6: break;
1597 /* --not-sunset-aware */case 7: opt->not_sunset_aware = 1; break;
1598 /* --quiet-alerts */ case 8: break;
1599 /* --short-format */ case 9: break;
1600 /* --parasha */ case 10:break;
1601 /* --holidays */ case 11:break;
1602 /* --shabbat-times */ case 12:break;
1603 /* --sun */ case 13:
1604 /* --sunset */ case 14:
1605 /* --sunrise */ case 15:break;
1606 /* --candle-lighting */ case 16:
1607 /* --candles */ case 17:
1608 if (optarg == NULL) opt->candles = 1;
1609 else
1610 {
1611 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1612 {
1613 opt->candles = atoi(optarg);
1614 if ( (opt->candles >= MIN_CANDLES_MINUTES) &&
1615 (opt->candles <= MAX_CANDLES_MINUTES) ) break;
1616 }
1617 print_parm_error("--candles"); // do not gettext!
1618 error_detected++;
1619 }
1620 break;
1621
1622 /* --havdalah */ case 18:
1623 if (optarg == NULL) opt->havdalah = 1;
1624 else
1625 {
1626 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1627 {
1628 opt->havdalah = atoi(optarg);
1629 if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) &&
1630 (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break;
1631 }
1632 print_parm_error("--havdalah"); // do not gettext!
1633 error_detected++;
1634 }
1635 break;
1636
1637 /* --latitude */ case 19:break;
1638 /* --longitude */ case 20:break;
1639 /* --timezone */ case 21:break;
1640 /* --bidi */ case 22:
1641 /* --visual */ case 23:break;
1642 /* --omer */ case 24:break;
1643 /* --ical */ case 25:break;
1644 /* --julian */ case 26:break;
1645 /* --diaspora */ case 27:break;
1646 /* --menu */ case 28:break;
1647
1648 } // end switch for long_options
1649 break;
1650
1651
1652 case 'b': opt->bidi = 1; opt->hebrew = 1; break;
1653 case 'c': if (opt->candles == 0) opt->candles = 1;
1654 if (opt->havdalah == 0) opt->havdalah = 1;
1655 break;
1656 case 'd': opt->diaspora = 1; break;
1657 case 'H': opt->only_if_holiday = 1; /* why no break? */
1658 /* it seems ok 'H' is used only to abort
1659 a print, so it always needs 'h' set */
1660 case 'h': opt->holidays = 1; break;
1661 case 'i': opt->iCal = 1; break;
1662 case 'j': opt->julian = 1; break;
1663 case 'q': opt->quiet_alerts = 1; break;
1664 case 'm': opt->menu = 1; break;
1665 case 'o': opt->omer = 1; break;
1666 case 'R': opt->only_if_parasha = 1;
1667 case 'r': opt->parasha = 1; break;
1668 case 'S': opt->short_format = 1; break;
1669 case 's': opt->sun = 1; break;
1670 case 't': opt->times = 1; break;
1671 case 'T': opt->tablular_output = 1; break;
1672 case 'l':
1673 error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude);
1674 break;
1675 case 'L':
1676 error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude);
1677 break;
1678 case 'z':
1679 error_detected = error_detected + parse_timezone(optarg, tz);
1680 break;
1681 case '?':
1682 // if (strchr(short_options,optopt)==NULL)
1683 // error(0,0,"option %c unknown",optopt);
1684 print_parm_missing_error((char*) &optopt);
1685 error_detected = TRUE;
1686 break;
1687 default:
1688 print_usage_hdate (); exit_main(opt,0); break;
1689 }
1690
1691 return error_detected;
1692 }
1693
1694
1695
1696
1697
1698 /************************************************************
1699 *************************************************************
1700 *************************************************************
1701 * main function
1702 *************************************************************
1703 *************************************************************
1704 ************************************************************/
1705 int main (int argc, char *argv[])
1706 {
1707
1708 hdate_struct h; /* The Hebrew date */
1709 int c;
1710
1711 int day; /* The Gregorian date */
1712 int month;
1713 int year;
1714
1715 double lat = BAD_COORDINATE; /* set to this value for error handling */
1716 double lon = BAD_COORDINATE; /* set to this value for error handling */
1717 int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */
1718
1719 int opt_latitude = 0; /* -l option latitude */
1720 int opt_Longitude = 0; /* -L option longitude */
1721
1722 int error_detected = FALSE; /* exit after reporting ALL bad parms */
1723
1724
1725 option_list opt;
1726 opt.hebrew = 0;
1727 opt.bidi = 0;
1728 opt.yom = 0;
1729 opt.leShabbat = 0;
1730 opt.leSeder = 0;
1731 opt.tablular_output = 0;
1732 opt.not_sunset_aware = 0;
1733 opt.quiet_alerts = 0;
1734 opt.print_tomorrow = 0; /* This isn't a command line option;
1735 It here to restrict sunset_aware to
1736 single-day outputs */
1737 opt.sun = 0; /* -s option sunrise/set times */
1738 opt.candles = 0;
1739 opt.havdalah = 0;
1740 opt.times = 0; /* -t option print times of day */
1741 opt.short_format = 0; /* -S Short format flag */
1742 opt.holidays = 0; /* -h option holidays */
1743 opt.only_if_holiday = 0; /* -H option just holidays */
1744 opt.parasha = 0; /* -r option reading */
1745 opt.only_if_parasha = 0; /* -R option just reading */
1746 opt.julian = 0; /* -j option Julian day number */
1747 opt.diaspora = 0; /* -d option diaspora */
1748 opt.iCal = 0; /* -i option iCal */
1749 opt.omer = 0; /* -o option Sfirat Haomer */
1750
1751 opt.menu = 0; // -m print menus for user-selection
1752 int i;
1753 for (i=0; i<MAX_MENU_ITEMS; i++) opt.menu_item[i] = NULL;
1754
1755
1756 // support for getopt short options
1757 static char * short_options = "bcdhHjimoqrRsStTl:L:z:";
1758
1759 /**********************************************
1760 * support for getopt long options
1761 * note: other (long) options will be defined
1762 * globally at beginning of this file
1763 * ********************************************/
1764 int long_option_index = 0;
1765 static struct option long_options[] = {
1766 // name, has_arg, flag, val
1767 {"version", 0, 0, 0}, // 0
1768 {"help", 0, 0, 0},
1769 {"hebrew", 0, 0, 0}, // 2
1770 {"yom", 0, 0, 0},
1771 {"leshabbat", 0, 0, 0}, // 4
1772 {"leseder", 0, 0, 0},
1773 {"table",0,0,'T'}, // 6
1774 {"not-sunset-aware",0,0,0},
1775 {"quiet-alerts",0,0,'q'}, // 8
1776 {"short_format",0,0,'S'},
1777 {"parasha",0,0,'r'}, //10
1778 {"holidays",0,0,'h'},
1779 {"shabbat-times",0,0,'c'}, //12
1780 {"sun",0,0,'s'},
1781 {"sunset",0,0,0}, //14
1782 {"sunrise",0,0,0},
1783 {"candle-lighting",0,0,0}, //16
1784 {"candles",2,0,0},
1785 {"havdalah",2,0,0}, //18
1786 {"latitude", 1, 0, 'l'},
1787 {"longitude", 1, 0, 'L'}, //20
1788 {"timezone", 1, 0, 'z'},
1789 {"bidi", 0, 0, 'b'}, //22
1790 {"visual", 0, 0, 'b'},
1791 {"omer", 0, 0, 'o'}, //24
1792 {"ical", 0, 0, 'i'},
1793 {"julian", 0, 0, 'j'}, //26
1794 {"diaspora", 0, 0, 'd'},
1795 {"menu",0,0,'m'}, //28
1796 {0, 0, 0, 0}
1797 };
1798
1799
1800 // for config file user-defined menus
1801 size_t menu_len = 0;
1802 int menu_index;
1803 char *menuptr, *optptr;
1804
1805
1806 /************************************************************
1807 * init locale
1808 *
1809 * see hcal.c for the full lecture...
1810 *
1811 ************************************************************/
1812 setlocale (LC_ALL, "");
1813
1814
1815 /************************************************************
1816 * parse config file
1817 ************************************************************/
1818 FILE *config_file = get_config_file("/hdate", "/hdaterc", hdate_config_file_text);
1819 if (config_file != NULL)
1820 {
1821 read_config_file(config_file, &opt, &lat, &opt_latitude, &lon, &opt_Longitude, &tz);
1822 fclose(config_file);
1823 }
1824
1825 /************************************************************
1826 * parse command line
1827 ************************************************************/
1828 opterr = 0; // we'll do our own error reporting
1829 while ((c = getopt_long(argc, argv,
1830 short_options, long_options,
1831 &long_option_index)) != -1)
1832 error_detected = error_detected
1833 + hdate_parser(c, &opt,
1834 &lat, &opt_latitude,
1835 &lon, &opt_Longitude,
1836 &tz, long_option_index);
1837
1838 /**************************************************
1839 * BEGIN - enable user-defined menu
1840 *************************************************/
1841 if (opt.menu)
1842 {
1843 i = menu_select( &opt.menu_item[0], MAX_MENU_ITEMS );
1844 if (i == -1) exit_main(&opt, 0);
1845 else if ((i < MAX_MENU_ITEMS) && (opt.menu_item[i] != NULL))
1846 {
1847
1848 /**************************************************
1849 * parse user's menu selection
1850 *************************************************/
1851 menuptr = opt.menu_item[i];
1852 menu_len = strlen( menuptr );
1853 menu_index = 0;
1854 optptr = NULL;
1855 optarg = NULL;
1856
1857 while (( c = menu_item_parse( menuptr, menu_len, &menu_index,
1858 &optptr, short_options, long_options,
1859 &long_option_index, &error_detected) ) != -1)
1860 {
1861 error_detected = error_detected +
1862 hdate_parser(c, &opt,
1863 &lat, &opt_latitude,
1864 &lon, &opt_Longitude,
1865 &tz, long_option_index);
1866 }
1867 }
1868 }
1869 /**************************************************
1870 * END - enable user-defined menu
1871 *************************************************/
1872
1873
1874
1875 /************************************************************
1876 * function validate_location is defined in the include file
1877 * ./location.include.c
1878 * It issues an exit(EXIT_CODE_BAD_PARMS) [==1]
1879 * if it discovers, um, bad parameters
1880 ************************************************************/
1881 validate_location(opt_latitude, opt_Longitude,
1882 &lat, &lon, &tz,
1883 opt.quiet_alerts, error_detected, print_usage_hdate);
1884
1885 /************************************************************
1886 * option "s" is a subset of option "t"
1887 ************************************************************/
1888 if (opt.sun && opt.times) opt.sun=0;
1889
1890
1891 /************************************************************
1892 * begin parse input date
1893 ************************************************************/
1894
1895 /************************************************************
1896 * parse input date - no date entered
1897 ************************************************************/
1898 if (argc == optind)
1899 {
1900
1901 /* set date for today */
1902 hdate_set_gdate (&h, 0, 0, 0);
1903
1904 if (opt.tablular_output)
1905 {
1906 print_tabular_header( opt );
1907 print_tabular_day(&h, opt, lat, lon, tz);
1908 }
1909 else
1910 {
1911 if (opt.iCal) print_ical_header ();
1912 else if (!opt.not_sunset_aware)
1913 opt.print_tomorrow = check_for_sunset(&h, lat, lon, tz);
1914 print_day (&h, opt, lat, lon, tz);
1915 if (opt.iCal) print_ical_footer ();
1916 }
1917 }
1918
1919 /************************************************************
1920 * parse input date - only year or julian day number entered
1921 ************************************************************/
1922 else if (argc == (optind + 1))
1923 {
1924 /* get year */
1925 year = atoi (argv[optind]);
1926
1927 /* handle error */
1928 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
1929
1930
1931 /************************************************************
1932 * process single Julian day
1933 ************************************************************/
1934 if (year > 348021)
1935 {
1936 hdate_set_jd (&h, year);
1937
1938 if (opt.tablular_output)
1939 {
1940 print_tabular_header( opt );
1941 print_tabular_day(&h, opt, lat, lon, tz);
1942 }
1943 else
1944 {
1945 if (opt.iCal) print_ical_header ();
1946 print_day (&h, opt, lat, lon, tz);
1947 if (opt.iCal) print_ical_footer ();
1948 }
1949 }
1950
1951
1952 /************************************************************
1953 * process entire Hebrew year
1954 ************************************************************/
1955 else if (year > 3000)
1956 {
1957 if (opt.tablular_output)
1958 {
1959 print_tabular_header( opt );
1960 print_tabular_hyear( opt, lat, lon, tz, year);
1961 }
1962 else
1963 {
1964 if (opt.iCal) print_ical_header ();
1965 print_hyear ( opt, lat, lon, tz, year);
1966 if (opt.iCal) print_ical_footer ();
1967 }
1968 }
1969 /************************************************************
1970 * process entire Gregorian year
1971 ************************************************************/
1972 else
1973 {
1974 if (opt.tablular_output)
1975 {
1976 print_tabular_header( opt );
1977 print_tabular_gyear( opt, lat, lon, tz, year);
1978 }
1979 else
1980 {
1981 if (opt.iCal) print_ical_header ();
1982
1983 print_gyear ( opt, lat, lon, tz, year);
1984
1985 if (opt.iCal) print_ical_footer ();
1986 }
1987
1988 }
1989 }
1990
1991
1992 /************************************************************
1993 * parse input date - only month and year entered
1994 ************************************************************/
1995 else if (argc == (optind + 2))
1996 {
1997
1998 year = atoi (argv[optind + 1]);
1999 month = atoi (argv[optind]);
2000
2001 /* handle errors */
2002 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
2003
2004
2005 /************************************************************
2006 * process entire Hebrew month
2007 ************************************************************/
2008 if (year > 3000)
2009 {
2010 /* begin bounds check for month */
2011 if ((month <= 0) || (month > 14))
2012 { print_parm_error(N_("month")); exit_main(&opt,0); }
2013 hdate_set_hdate (&h, 1, 1, year);
2014 if ((h.hd_size_of_year <365) && (month >12))
2015 { print_parm_error(N_("month")); exit_main(&opt,0); }
2016 /* end bounds check for month */
2017
2018
2019 if (opt.tablular_output)
2020 {
2021 print_tabular_header( opt );
2022
2023 /* get date of month start */
2024 hdate_set_hdate (&h, 1, month, year);
2025
2026 /* if leap year, print both Adar months */
2027 if (h.hd_size_of_year > 365 && month == 6)
2028 {
2029 hdate_set_hdate (&h, 1, 13, year);
2030 print_tabular_hmonth ( opt, lat, lon, tz, 13, year);
2031 hdate_set_hdate (&h, 1, 14, year);
2032 print_tabular_hmonth ( opt, lat, lon, tz, 14, year);
2033 }
2034 else
2035 {
2036 print_tabular_hmonth ( opt, lat, lon, tz, month, year);
2037 }
2038 }
2039 else
2040 {
2041 if (opt.iCal) print_ical_header ();
2042
2043 /* get date of month start */
2044 hdate_set_hdate (&h, 1, month, year);
2045
2046 /* if leap year, print both Adar months */
2047 if (h.hd_size_of_year > 365 && month == 6)
2048 {
2049 hdate_set_hdate (&h, 1, 13, year);
2050 print_hmonth (&h, opt, lat, lon, tz, 13, year);
2051 hdate_set_hdate (&h, 1, 14, year);
2052 print_hmonth (&h, opt, lat, lon, tz, 14, year);
2053 }
2054 else
2055 {
2056 print_hmonth (&h, opt, lat, lon, tz, month, year);
2057 }
2058 if (opt.iCal)
2059 print_ical_footer ();
2060 }
2061 }
2062
2063 /************************************************************
2064 * process entire Gregorian month
2065 ************************************************************/
2066 else
2067 {
2068 if ((month <= 0) || (month > 12))
2069 { print_parm_error(N_("month")); exit_main(&opt,0); }
2070
2071 if (opt.tablular_output)
2072 {
2073 print_tabular_header( opt );
2074 print_tabular_gmonth(opt, lat, lon, tz, month, year);
2075 }
2076
2077 else
2078 {
2079 if (opt.iCal)print_ical_header ();
2080
2081 print_gmonth (opt, lat, lon, tz, month, year);
2082
2083 if (opt.iCal) print_ical_footer ();
2084 }
2085 }
2086 }
2087
2088
2089 /************************************************************
2090 * parse input date - day, month and year entered
2091 ************************************************************/
2092 else if (argc == (optind + 3))
2093 {
2094 year = atoi (argv[optind + 2]);
2095 month = atoi (argv[optind + 1]);
2096 day = atoi (argv[optind]);
2097
2098 /* handle error */
2099 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
2100
2101
2102 /************************************************************
2103 * get Hebrew date
2104 ************************************************************/
2105 if (year > 3000)
2106 {
2107 /* begin bounds check for month */
2108 if ((month <= 0) || (month > 14))
2109 { print_parm_error(N_("month")); exit_main(&opt,0); }
2110 hdate_set_hdate (&h, 1, 1, year);
2111 if ((h.hd_size_of_year <365) && (month >12))
2112 { print_parm_error(N_("month")); exit_main(&opt,0); }
2113 /* end bounds check for month */
2114
2115 if ((day <= 0) || (day > 30) ||
2116 ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) ||
2117 (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) ||
2118 (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) )
2119 { print_parm_error(N_("day")); exit_main(&opt,0); }
2120
2121
2122 hdate_set_hdate (&h, day, month, year);
2123 }
2124
2125 /************************************************************
2126 * get Gregorian date
2127 ************************************************************/
2128 else
2129 {
2130 if ((month <= 0) || (month > 12))
2131 { print_parm_error(N_("month")); exit_main(&opt,0); }
2132 if ((day <= 0) ||
2133 ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) ||
2134 ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) ||
2135 ((day > 29) && (month==2) && ((year%4)==0)) ||
2136 ((day > 28) && (month==2) && ((year%4)!=0))
2137 )
2138 { print_parm_error(N_("day")); exit_main(&opt,0); }
2139
2140 hdate_set_gdate (&h, day, month, year);
2141 }
2142
2143 /************************************************************
2144 * process a single date
2145 ************************************************************/
2146 if (opt.tablular_output)
2147 {
2148 print_tabular_header( opt );
2149 print_tabular_day(&h, opt, lat, lon, tz);
2150 }
2151
2152 else
2153 {
2154 if (opt.iCal) print_ical_header ();
2155 print_day (&h, opt, lat, lon, tz);
2156
2157 if (opt.iCal) print_ical_footer ();
2158 }
2159 }
2160
2161
2162 /************************************************************
2163 * parse input date - too many fields were received
2164 ************************************************************/
2165 else
2166 {
2167 error(0,0,"%s", N_("too many arguments; after options max is dd mm yyyy"));
2168 exit_main(&opt,0);
2169 }
2170
2171 return 0;
2172 }
0 /* local_functions.c http://libhdate.sourceforge.net
1 * a collection of functions in support of both hcal.c and hdate.c
2 * hcal.c Hebrew calendar (part of package libhdate)
3 * hdate.c Hebrew date/times information(part of package libhdate)
4 *
5 * compile:
6 * gcc `pkg-config --libs --cflags libhdate` ocal_functions.c -o local_functions
7 *
8 * Copyright: 2011-2012 (c) Boruch Baum
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24 /**************************************************
25 * functions to support hcal and hdate
26 **************************************************/
27 #define _GNU_SOURCE // For mempcpy, asprintf
28
29 #include <hdate.h> // For hebrew date
30 //include "../../src/hdate.h"
31 #include <stdlib.h> // For atoi, malloc
32 #include <error.h> // For error
33 #include <errno.h> // For errno
34 #include <time.h> // For time
35 #include <ctype.h> // for isprint
36 #include <fnmatch.h> // For fnmatch
37 #include <string.h> // For mempcpy
38 #include <getopt.h> // For optarg, optind
39 #include <stdio.h> // For printf, fopen, fclose, fprintf, snprintf. FILE
40 #include <pwd.h> // for get pwuid
41 #include <unistd.h> // for getuid
42 #include <sys/stat.h>
43 #include <sys/types.h> // for mkdir,
44
45
46 // support for fnmatch
47 #define FNM_EXTMATCH (1 << 5)
48 #define FNM_NOFLAG 0
49
50 #define BAD_COORDINATE 999
51 #define BAD_TIMEZONE 999
52 #define DELTA_LONGITUDE 30
53
54 #define EXIT_CODE_BAD_PARMS 1
55
56
57
58 // copied from support.h in src dir
59 #ifdef ENABLE_NLS
60 # include <libintl.h>
61 # undef _
62 # define _(String) dgettext (PACKAGE, String)
63 # ifdef gettext_noop
64 # define N_(String) gettext_noop (String)
65 # else
66 # define N_(String) (String)
67 # endif
68 #else
69 # define textdomain(String) (String)
70 # define gettext(String) (String)
71 # define dgettext(Domain,Message) (Message)
72 # define dcgettext(Domain,Message,Type) (Message)
73 # define bindtextdomain(Domain,Directory) (Domain)
74 # define _(String) (String)
75 # define N_(String) (String)
76 #endif
77
78 #define FALSE 0
79 #define TRUE -1
80
81
82 // support for options parsing
83 #define MIN_CANDLES_MINUTES 18
84 #define DEFAULT_CANDLES_MINUTES 20
85 #define MAX_CANDLES_MINUTES 90
86 #define MIN_MOTZASH_MINUTES 20
87 #define MAX_MOTZASH_MINUTES 90
88
89
90 /************************************************************
91 * begin - error message functions
92 ************************************************************/
93 void print_parm_error ( char *parm_name )
94 {
95 error(0,0,"%s: %s %s %s",N_("error"),
96 N_("parameter"), parm_name,
97 N_("is non-numeric or out of bounds"));
98 }
99
100 void print_parm_missing_error ( char *parm_name )
101 {
102 error(0,0,"%s: %s %s %s",N_("error"),
103 N_("option"), parm_name, N_("missing parameter"));
104 }
105
106 void print_alert_timezone( int tz )
107 {
108 error(0,0,"%s: %s, %+d:%d UTC",
109 N_("ALERT: time zone not entered, using system local time zone"),
110 *tzname, tz/60, tz%60);
111 }
112
113 void print_parm_invalid_error( char *parm_name )
114 {
115 error(0,0,"%s: %s %s %s",N_("error"),
116 N_("option"), parm_name, N_("is not a valid option"));
117 }
118
119
120 /************************************************************
121 * end - error message functions
122 ************************************************************/
123
124
125
126
127 /************************************************************
128 * begin - alert message functions
129 ************************************************************/
130 void print_alert_coordinate( char *city_name )
131 {
132 error(0,0,"%s %s",
133 N_("ALERT: guessing... will use co-ordinates for"),
134 city_name);
135 }
136
137 void print_alert_default_location( int tz )
138 {
139 switch (tz/60)
140 {
141 case -8: print_alert_coordinate( N_("Los Angeles") ); break;
142 case -6: print_alert_coordinate( N_("Mexico City") ); break;
143 case -5: print_alert_coordinate( N_("New York City") ); break;
144 // case -5: print_alert_coordinate( N_("Toronto") ); break;
145 // case -3: print_alert_coordinate( N_("Sao Paolo") ); break;
146 case -3: print_alert_coordinate( N_("Buenos Aires") ); break;
147 case 0: print_alert_coordinate( N_("London") ); break;
148 case 1: print_alert_coordinate( N_("Paris") ); break;
149 case 2: print_alert_coordinate( N_("Tel-Aviv") ); break;
150 case 3: print_alert_coordinate( N_("Moscow") ); break;
151 case 5: print_alert_coordinate( N_("Tashkent") ); break;
152 case 8: print_alert_coordinate( N_("Beijing") ); break;
153 // case 8: print_alert_coordinate( N_("Hong Kong") ); break;
154 case -10: print_alert_coordinate( N_("Honolulu") ); break;
155 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;
156 }
157 }
158 /************************************************************
159 * end - alert message functions
160 ************************************************************/
161
162
163
164 /************************************************************
165 * set default location
166 ************************************************************/
167 void set_default_location( int tz, double *lat, double *lon )
168 {
169 /* Temporarily, set some default lat/lon coordinates
170 for certain timezones */
171
172 /**
173 { 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ),
174 { 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ),
175 { 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ),
176 { 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ),
177 { 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ),
178 { 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ),
179 { 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ),
180 { 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ),
181 { 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ),
182 { 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ),
183 { 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ),
184 { 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ),
185 { 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ),
186 { 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ),
187 { 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ),
188 { 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ),
189 { 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ),
190 { 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ),
191 { 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ),
192 { 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' )
193 **/
194
195 switch (tz/60)
196 {
197 case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles
198 case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City
199 case -5: *lat = 40.0; *lon = -74.0; break; // New York
200 // case -5: *lat = 43.71; *lon = -79.43; break; // Toronto
201 // case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo
202 case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires
203 case 0: *lat = 51.0; *lon = 0.0; break; // London
204 case 1: *lat = 48.0; *lon = 2.0; break; // Paris
205 case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv
206 case 3: *lat = 55.0; *lon = 37.0; break; // Moscow
207 case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent
208 case 8: *lat = 39.90; *lon = 116.38; break; // Beijing
209 // case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong
210 case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu
211 default: *lat = 0.0; *lon = tz * .25; break; // center of timeone:
212 // .25 = (15 degrees) / 60 [because tz is in minutes, not hours]
213 }
214 return;
215 }
216
217
218
219 /************************************************************
220 * check for sunset
221 ************************************************************/
222 int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone )
223 {
224 time_t now_time;
225 struct tm *now_timep;
226 int sunrise, sunset;
227
228 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
229 &sunrise, &sunset);
230
231 time(&now_time);
232 now_timep = localtime(&now_time);
233
234 if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1;
235 else return 0;
236 }
237
238
239
240
241 /***********************************************************
242 * reverse a hebrew string (for visual bidi)
243 * parameters:
244 * source is a pointer to a writeable buffer.
245 * source_len is the length of a string in source. This
246 * length must be LESS than the size of the source buffer
247 ***********************************************************/
248 void revstr( char *source, const size_t source_len)
249 {
250 #define H_CHAR_WIDTH 2
251
252 #define DEBUG 0
253 #if DEBUG
254 printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source);
255 #endif
256
257 if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);};
258 if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);};
259
260 size_t i,j;
261 char *temp_buff;
262
263 temp_buff = malloc(source_len+2);
264 if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);};
265
266 for (i=(source_len-1), j=0; j < source_len; i--, j++)
267 {
268 if (isprint(source[i])) temp_buff[j] = source[i];
269 else
270 {
271 // FIXME - presumes H_CHAR_WIDTH = 2
272 temp_buff[j++] = source[i-1];
273 temp_buff[j] = source[i--];
274 }
275 }
276 memcpy(source, temp_buff, source_len);
277 source[source_len] = '\0';
278 #if DEBUG
279 printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source);
280 #endif
281 free(temp_buff);
282 return;
283 }
284
285
286 /************************************************************
287 * parse coordinate
288 *
289 * presumes commandline options were parsed using getopt.
290 * returns 1 to *opt_found on success
291 * returns the floating point value of the coordinate in *coordinate
292 *
293 * type_flag (1-latitude, 2=longitude)
294 ************************************************************/
295 int parse_coordinate( const int type_flag, char *input_string,
296 double *coordinate, int *opt_found)
297 {
298 //#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
299 //#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
300 //#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
301 //#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
302
303 #define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])"
304 #define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])"
305
306 #define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])"
307 #define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])"
308
309 char* seconds;
310
311 double fractional_part = 0;
312 int direction_modifier = 1;
313
314 /************************************************************
315 * input_string should hold the value to parse
316 * It must exist and be numeric
317 * we don't want confuse it with the next option of for "-x"
318 ************************************************************/
319 if (!input_string)
320 {
321 if (type_flag == 1) print_parm_missing_error(N_("l (latitude)"));
322 else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)"));
323 return TRUE; // error_detected = TRUE; ie failure
324 }
325
326 /************************************************************
327 * parse latitude
328 ************************************************************/
329 if (type_flag == 1)
330 {
331 if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
332 && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
333 {
334 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
335 print_parm_missing_error(N_("l (latitude)"));
336 else print_parm_error(N_("l (latitude)"));
337 return TRUE; // error_detected = TRUE; ie failure
338 }
339
340
341 if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1;
342
343
344 if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
345 {
346 *coordinate = (double) atof( strtok( input_string, "nNsS"));
347 }
348 else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
349 {
350 *coordinate = (double) atof( strtok( input_string, "nNsS:'\""));
351 fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60;
352 seconds = strtok( NULL, "nNsS:'\"");
353 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
354 }
355
356
357 if (*coordinate > 0)
358 *coordinate = (*coordinate + fractional_part) * direction_modifier;
359 else
360 *coordinate = *coordinate - fractional_part;
361
362
363 if( (*coordinate > -90) && (*coordinate < 90) )
364 {
365 *opt_found = 1;
366 return FALSE; // error_detected = FALSE; ie. success
367 }
368 print_parm_error(N_("L (Longitude)"));
369 return TRUE; // error_detected = TRUE; ie failure
370 }
371
372
373 /************************************************************
374 * parse longitude
375 ************************************************************/
376 if (type_flag == 2)
377 {
378 if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
379 && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
380 {
381 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
382 print_parm_missing_error(N_("L (Longitude)"));
383 else print_parm_error(N_("L (Longitude)"));
384 return TRUE; // error_detected = TRUE; ie failure
385 }
386
387
388 if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1;
389
390
391 if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
392 {
393 *coordinate = (double) atof( strtok( input_string, "eEwW"));
394 }
395 else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
396 {
397 *coordinate = (double) atof( strtok( input_string, "eEwW:'\""));
398 fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60;
399 seconds = strtok( NULL, "eEwW:'\"");
400 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
401 }
402
403 if (*coordinate > 0)
404 *coordinate = (*coordinate + fractional_part) * direction_modifier;
405 else
406 *coordinate = *coordinate - fractional_part;
407
408
409 if( (*coordinate > -180) && (*coordinate < 180) )
410 {
411 *opt_found = 1;
412 return FALSE; // error_detected = FALSE; ie. success
413 }
414 print_parm_error(N_("L (Longitude)"));
415 return TRUE; // error_detected = TRUE; ie failure
416 }
417
418 printf("INTERNAL ERROR: coordinate parse\n");
419 return TRUE; // error_detected = TRUE; ie failure
420 }
421
422 /************************************************************
423 * parse timezone
424 *
425 * presumes commandline options were parsed using getopt.
426 * timezone is returned in minutes, not hours
427 ************************************************************/
428 int parse_timezone( char *input_string, int *tz)
429 {
430 #define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))"
431 #define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))"
432
433 int fractional_part;
434
435 /************************************************************
436 * input_string should hold the value to parse
437 * It must exist and be numeric
438 * we don't want confuse it with the next option of for "-x"
439 ************************************************************/
440 if ((!input_string) ||
441 ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) &&
442 (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) &&
443 (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) )
444 {
445 print_parm_missing_error(N_("z (time zone)"));
446 }
447 else
448 {
449 if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
450 {
451 *tz = (int) ( atof (input_string) * 60 );
452 }
453 else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0)
454 {
455 *tz = atoi( strtok( input_string, ":'\"")) * 60;
456 fractional_part = atoi( strtok( NULL, ":'\""));
457 if (*tz < 0) *tz = *tz - fractional_part;
458 else *tz = *tz + fractional_part;
459 }
460
461 if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours
462 {
463 return FALSE; // error_detected = FALSE; ie. success
464 }
465 else print_parm_error(N_("z (timezone)"));
466 }
467 return TRUE; // error_detected = TRUE; ie failure
468 }
469
470
471
472
473 /************************************************************
474 * validate location parameters - lat, lon, tz
475 ************************************************************/
476 // originally, this was only for hdate, now also for hcal
477 // originally, we did this only if we needed the information
478 // now, because of sunset-awareness, we always perform these checks
479 // if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) )
480 void validate_location( const int opt_latitude, const int opt_Longitude,
481 double *lat, double *lon,
482 int *tz, const int quiet_alerts, int error_detected,
483 void (*print_usage)() )
484 {
485
486 /* latitude and longitude must be paired */
487 if ( (opt_latitude) && (!opt_Longitude) )
488 {
489 error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude"));
490 error_detected = TRUE;
491 }
492 else if ( (opt_Longitude) && (!opt_latitude) )
493 {
494 error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude"));
495 error_detected = TRUE;
496 }
497
498
499 if (!error_detected)
500 {
501 // if no timezone entered, choose guess method
502 if (*tz==BAD_TIMEZONE)
503 {
504 // system timezone is in seconds, but we deal in minutes
505 tzset();
506 *tz = timezone /-60;
507
508 if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) )
509 {
510 /* reject system local timezone, because it's
511 too far from the longitude explicitly provided
512 by the user; guess based on longitude entered */
513 *tz = (*lon /15) * 60;
514 }
515 if (!quiet_alerts) print_alert_timezone( *tz );
516 if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) )
517 {
518 if (!quiet_alerts) print_alert_default_location( *tz );
519 set_default_location( *tz, lat, lon );
520 }
521 printf("\n");
522 }
523 else
524 { /* we have timezone, what about latitude and longitude? */
525 if ( (opt_Longitude) && (opt_latitude) )
526 {
527 // sanity-check longitude versus timezone
528 // timezone is in minutes
529 if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE )
530 {
531 error(0,0,"%s %d:%d %s %.3f %s",
532 N_("time zone value of"), *tz/60, *tz%60,
533 N_("is incompatible with a longitude of"), *lon, N_("degrees"));
534 error_detected = TRUE;
535 }
536 }
537 else
538 {
539 if (!quiet_alerts) print_alert_default_location( *tz );
540 set_default_location( *tz, lat, lon );
541 printf("\n");
542 }
543 }
544 }
545
546 /* exit after reporting all bad parameters found */
547 if (error_detected)
548 {
549 print_usage();
550 exit(EXIT_CODE_BAD_PARMS);
551 }
552 }
553
554
555 /************************************************************
556 * check validity of date parameters
557 ************************************************************/
558 #define CHECK_DAY_PARM 1
559 #define CHECK_MONTH_PARM 2
560 #define CHECK_YEAR_PARM 3
561 int validate_hdate (int parameter_to_check, int day, int month, int year)
562 {
563 hdate_struct h;
564
565 if (year < 0) return FALSE;
566
567 switch (parameter_to_check)
568 {
569
570 case CHECK_DAY_PARM:
571
572 /************************************************************
573 * check day in Hebrew date
574 ************************************************************/
575 if (year > 3000)
576 {
577 if (year > 10999) return FALSE;
578 hdate_set_hdate (&h, 1, 1, year);
579 if ((day < 1) || (day > 30) ||
580 ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) ||
581 (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) ||
582 (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) )
583 return FALSE;
584 return TRUE;
585 }
586
587 /************************************************************
588 * check day in Gregorian date
589 ************************************************************/
590 else
591 {
592 if ((day < 1) ||
593 ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) ||
594 ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) ||
595 ((day > 29) && (month==2) && ((year%4)==0)) ||
596 ((day > 28) && (month==2) && ((year%4)!=0))
597 )
598 return FALSE;
599 return TRUE;
600 }
601 break;
602
603
604 case CHECK_MONTH_PARM:
605
606 /************************************************************
607 * check month in Hebrew date
608 ************************************************************/
609 if (year > 3000)
610 {
611 if (year > 10999) return FALSE;
612 if ((month <= 0) || (month > 14)) return FALSE;
613 hdate_set_hdate (&h, 1, 1, year);
614 if ((h.hd_size_of_year <365) && (month >12)) return FALSE;
615 return TRUE;
616 }
617
618 /************************************************************
619 * check month in Gregorian date
620 ************************************************************/
621 else
622 {
623 if ((month <= 0) || (month > 12)) return FALSE;
624 return TRUE;
625 }
626 break;
627
628 case CHECK_YEAR_PARM:
629 if (year > 10999) return FALSE;
630 return TRUE;
631 break;
632 }
633 return FALSE;
634 }
635
636 /************************************************************
637 * Greeting message to new version
638 ************************************************************/
639 void greetings_to_version_16()
640 {
641 error(0,0,"%s",N_("\
642 This seems to be to be your first time using this version.\n\
643 Please read the new documentation in the man page and config\n\
644 file. Attempting to create a config file ..."));
645 }
646
647
648 /************************************************************
649 * Open config file, or create one
650 * - returns filepointer or NULL
651 * - if file does not exist, attempt to create it
652 ************************************************************/
653 FILE* get_config_file( const char* config_dir_name,
654 const char* config_file_name,
655 const char* default_config_file_text )
656 {
657 size_t path_len;
658
659 char* config_home_path_name = "";
660 char* config_sub_path_name = "";
661
662 char* config_dir_path;
663 char* config_file_path;
664
665 FILE* config_file;
666
667 /************************************************************
668 * sub-function to get_config_file: create_config_file
669 ************************************************************/
670 void create_config_file()
671 {
672 config_file = fopen(config_file_path, "a");
673 if (config_file == NULL)
674 {
675 error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path);
676 return;
677 }
678 fprintf(config_file, "%s", default_config_file_text);
679 error(0,0,"%s: %s",N_("config file created"), config_file_path);
680 if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name);
681 }
682
683 /************************************************************
684 * sub-function to get_config_file: open_config_file
685 ************************************************************/
686 int open_config_file()
687 {
688 config_file = fopen(config_file_path, "r");
689 if (config_file == NULL)
690 {
691 if (errno != ENOENT) return FALSE;
692 // maybe replace all this with a single line asprintf()
693 path_len = strlen(config_home_path_name)
694 + strlen(config_sub_path_name)
695 + strlen(config_dir_name) +1;
696 if (path_len < 1) return FALSE;
697 config_dir_path = malloc(path_len);
698 if (config_dir_path == NULL)
699 {
700 error(0,errno,"%s",N_("memory allocation failure"));
701 return FALSE;
702 }
703 snprintf(config_dir_path, path_len, "%s%s%s",
704 config_home_path_name, config_sub_path_name,
705 config_dir_name);
706
707 if ((mkdir(config_dir_path, (mode_t) 0700) != 0) &&
708 (errno != EEXIST))
709 {
710 free(config_dir_path);
711 return FALSE;
712 }
713 greetings_to_version_16();
714 create_config_file();
715 free(config_dir_path);
716 return FALSE;
717 }
718 return TRUE;
719 }
720
721
722 /************************************************************
723 * main part of function get_config_file
724 ************************************************************/
725 config_home_path_name = getenv("XDG_CONFIG_HOME");
726 if (config_home_path_name == NULL)
727 {
728 config_home_path_name = getenv("HOME");
729 if (config_home_path_name == NULL)
730 {
731 struct passwd *passwdEnt = getpwuid(getuid());
732 config_home_path_name = passwdEnt->pw_dir;
733 if (config_home_path_name == NULL) return NULL;
734 }
735 config_sub_path_name = "/.config";
736 }
737
738 // maybe replace all this with a single line asprintf()
739 path_len = strlen(config_home_path_name) + strlen(config_sub_path_name)
740 + strlen(config_dir_name) + strlen(config_file_name) + 1;
741 if (path_len < 1) return NULL;
742 config_file_path = malloc(path_len);
743 if (config_file_path == NULL)
744 {
745 error(0,errno,"memory allocation failure");
746 return NULL;
747 }
748 snprintf(config_file_path, path_len, "%s%s%s%s",
749 config_home_path_name, config_sub_path_name,
750 config_dir_name, config_file_name);
751
752 if (open_config_file() == TRUE)
753 {
754 free(config_file_path);
755 return config_file;
756 }
757 else
758 free(config_file_path);
759 return NULL;
760 }
761
762
763
764
765 /**********************************************************************
766 * parse user's menu selection into options and their posibile
767 * arguments, which can then be parsed (processed really)
768 *
769 * menuptr points to the beginning of the menu entry string. This
770 * pointer should initially be set to NULL.
771 * menu_len is the length of the menu entry string
772 * menu_index is the current position of the parser within the string.
773 * This value should initially be set to 0.
774 * optptr is a pointer into which we put the location of option text
775 * to be parsed. This pointer should initially be set to NULL.
776 * optarg is a pointer to a possible argument to the option. This is a
777 * global variable defined by GNU getopt(), so it shouldn't be
778 * declared or passed.
779 * long_options is a pointer to a structure of type option, as defined
780 * by getopt_long()
781 * long_option_index is a pointer to position found in long_options, and
782 * simulates the similar value returned by getopt_long()
783 * error_detected is a pointer to an accumulator used to delay aborting
784 * the program until after ALL input syntax errors are reported.
785 *
786 * RETURN VALUES:
787 * -1 means the menu line string has been completely parsed.
788 * Otherwise, the return value should be the short option character
789 * found, or in the case of a long option found, 0.
790 * This should sound suspiciously similar to the return values issued
791 * by getopt_long().
792 ***********************************************************************/
793 int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index,
794 char** optptr, char* short_options,
795 struct option *long_options, int *long_option_index,
796 int *error_detected)
797 {
798 int ahead_index;
799 char *ahead;
800
801 while ( (*menu_index < menu_len) &&
802 (menuptr[*menu_index] != '#') )
803 {
804 if (menuptr[*menu_index] == '-')
805 {
806 if ( ( (*menu_index+1) >= menu_len) ||
807 (menuptr[*menu_index+1] == '#') ) break;
808 else if (menuptr[*menu_index+1] == '-')
809 {
810 if ( ( (*menu_index+2) >= menu_len) ||
811 (menuptr[*menu_index+2] == '#') ) break;
812 *menu_index = *menu_index +2;
813
814 /**************************************************
815 * We have identified the beginning of what could
816 * be a long option string. We store a pointer to
817 * it in optptr and proceed to:
818 * find its endpoint
819 * terminate it with a null
820 * if it has an argument, store a pointer to
821 * it in optarg and terminate it with a null.
822 * Then we compare the optptr to our list of
823 * valid longoptions and pass the information
824 * to the option parser
825 *************************************************/
826 *optptr = &menuptr[*menu_index]; // ??
827 ahead = *optptr;
828 ahead_index = *menu_index;
829 while ( (ahead_index < menu_len) &&
830 (strchr(" =#",*ahead) == NULL) )
831 {
832 ahead_index++;
833 ahead++;
834 }
835 if (memcmp(ahead,"=",1)==0)
836 {
837 *ahead = '\0';
838 ahead++;
839 optarg = ahead;
840 ahead_index++;
841 while ( (ahead_index < menu_len) &&
842 (strchr(" #",*ahead) == NULL) )
843 {
844 ahead_index++;
845 ahead++;
846 }
847 }
848 if ((*ahead == '#' ) && ((ahead_index+1) < menu_len))
849 ahead[1] = '#';
850 *ahead = '\0';
851 *long_option_index = 0;
852 while ( (long_options[*long_option_index].name != 0) &&
853 (strcmp(long_options[*long_option_index].name, *optptr) != 0) )
854 *long_option_index = *long_option_index + 1;
855 if (long_options[*long_option_index].name == 0)
856 {
857 *error_detected = *error_detected + 1;
858 print_parm_invalid_error(*optptr);
859 }
860 else
861 {
862 *menu_index = ahead_index;
863 return long_options[*long_option_index].val;
864 }
865 }
866 else
867 {
868 *menu_index = *menu_index + 1;
869 /**************************************************
870 * parse a short option from a menu line
871 *************************************************/
872 if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) ||
873 (menuptr[*menu_index] == ':') )
874 {
875 *error_detected = *error_detected + 1;
876 print_parm_invalid_error(*optptr);
877 }
878 else
879 {
880 *optptr = &menuptr[*menu_index];
881 *long_option_index = -1;
882 if (strchr("lLz", (int) menuptr[*menu_index]) != NULL)
883 {
884 ahead_index = *menu_index+1;
885 while ( (ahead_index < menu_len) &&
886 (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++;
887 optarg = &menuptr[ahead_index];
888 while ( (ahead_index < menu_len) &&
889 (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++;
890 menuptr[ahead_index] = '\0';
891 *menu_index = ahead_index;
892 }
893 return **optptr;
894 }
895
896 }
897 }
898 *menu_index = *menu_index + 1;
899 }
900 return -1;
901 }
902
903
904 /**************************************************
905 * prompt user for menu selection
906 *************************************************/
907 int menu_select( char* menu_list[], int max_menu_items )
908 {
909 int i, j;
910
911 for (i=0; i< max_menu_items; i++)
912 {
913 if (menu_list[i] == NULL) break;
914 if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)"));
915 printf(" %d: %s\n",i,menu_list[i]);
916 }
917 j = i;
918 if (i == 0)
919 {
920 error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file"));
921 return -1;
922 }
923 printf("\n%s: ",N_("enter your selection, or <return> to continue"));
924 i = getchar() - 48; // effectively converts valid values to integers
925 if ((i < 0) || (i >= j))
926 {
927 error(0,0,N_("menu selection received was out of bounds"));
928 return -1;
929 }
930 printf("\n");
931 return i;
932 }
0 /* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net
1 *
2 * Copyright (C) 2011-2012 Boruch Baum <boruch-baum@users.sourceforge.net>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #define _GNU_SOURCE
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22
23 #ifdef ENABLE_NLS
24 #include <locale.h>
25 #endif
26
27 #include "hdate.h"
28 #include "support.h"
29
30 /**
31 @brief convert an integer to hebrew string UTF-8 (logical)
32
33 @param n The int to convert ( 0 < n < 11000)
34
35 @warning DEPRECATION: This function is now just a wrapper for
36 hdate_string, and is subject to deprecation.
37 Callers to this function must free() after using the memory
38 pointed to by the return value.
39 [deprecation date 2011-12-28]
40 The original function outputted to a local static string,
41 and suggested that the caller copied it away.
42 */
43 char *
44 hdate_get_int_string (int const n)
45 {
46 char *dest;
47 int hebrew_form = HDATE_STRING_HEBREW;
48
49 if (!hdate_is_hebrew_locale()) hebrew_form = HDATE_STRING_LOCAL;
50 return hdate_string( HDATE_STRING_INT, n, HDATE_STRING_SHORT, hebrew_form);
51 }
52
53
54 /**
55 @brief Return a static string, with name of week day.
56
57 @param day_of_week The number of the day 1..7 (1 - sun).
58 @param short_form A short flag (true - sun; false - sunday).
59 @warning DEPRECATION: This function is now just a wrapper for
60 hdate_string, and is subject to deprecation.
61 [deprecation date 2011-12-28]
62 */
63 char *
64 hdate_get_day_string (int const day_of_week, int const short_form)
65 {
66 return hdate_string( HDATE_STRING_DOW, day_of_week, short_form, HDATE_STRING_LOCAL);
67 }
68
69 /**
70 @brief Return a static string, with name of month.
71
72 @param month The number of the month 1..12 (1 - jan).
73 @param short_form A short flag.
74 @warning DEPRECATION: This function is now just a wrapper for
75 hdate_string, and is subject to deprecation.
76 [deprecation date 2011-12-28]
77 */
78 char *
79 hdate_get_month_string (int const month, int const short_form)
80 {
81 return hdate_string( HDATE_STRING_GMONTH, month, short_form, HDATE_STRING_LOCAL);
82 }
83
84 /**
85 @brief Return a static string, with name of hebrew month.
86
87 @param month The number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2).
88 @param short_form A short flag.
89 @warning DEPRECATION: This function is now just a wrapper for
90 hdate_string, and is subject to deprecation.
91 [deprecation date 2011-12-28]
92 */
93 char *
94 hdate_get_hebrew_month_string (int const month, int const short_form)
95 {
96 return hdate_string( HDATE_STRING_HMONTH, month, short_form, HDATE_STRING_LOCAL);
97 }
98
99 /**
100 @brief Name of hebrew holiday.
101
102 @param holiday The holiday number.
103 @param short_text A short flag. 0=true, !0=false
104 @warning DEPRECATION: This function is now just a wrapper for
105 hdate_string, and is subject to deprecation.
106 [deprecation date 2011-12-28]
107 */
108 char *
109 hdate_get_holyday_string (int const holiday, int const short_text)
110 {
111 return hdate_string( HDATE_STRING_HOLIDAY, holiday, short_text, HDATE_STRING_LOCAL);
112 }
113
114 /**
115 @brief Name of Parasha
116
117 @param parasha The Number of Parasha 1-Bereshit
118 (55 through 61 are joined strings e.g. Vayakhel Pekudei)
119 @param short_form A short flag. 0=true, !0 = false
120 @warning DEPRECATION: This function is now just a wrapper for
121 hdate_string, and is subject to deprecation.
122 [deprecation date 2011-12-28]
123 */
124 char *
125 hdate_get_parasha_string (int const parasha, int const short_form)
126 {
127 return hdate_string( HDATE_STRING_PARASHA, parasha, short_form, HDATE_STRING_LOCAL);
128 }
129
130 /**
131 @brief Return a string, with the day in the omer
132
133 @param omer day The day in the omer.
134 @return a pointer to a string with the day in the omer. The caller
135 must free() the pointer after use.
136 @warning DEPRECATION: This function is now just a wrapper for
137 hdate_string, and is subject to deprecation.
138 [deprecation date 2011-12-28]
139 @attention The prior version of this function returned a pointer to a
140 static string buffer. The current version returns a pointer to
141 a malloc()ed buffer and needs to be free()d after use.
142 */
143 char *
144 hdate_get_omer_string (int const omer_day)
145 {
146 return hdate_string( HDATE_STRING_OMER,
147 omer_day,
148 HDATE_STRING_LONG,
149 HDATE_STRING_LOCAL);
150
151 }
0 /* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net
1 *
2 * Copyright (C) 2011-2012 Boruch Baum <boruch-baum@users.sourceforge.net>
3 * 2004-2007 Yaacov Zamir <kzamir@walla.co.il>
4 * 1984-2003 Amos Shapir
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #define _GNU_SOURCE
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24
25 #ifdef ENABLE_NLS
26 #include <locale.h>
27 #endif
28
29 #include "hdate.h"
30 #include "support.h"
31
32 /**
33 @brief helper function to find hebrew locale
34
35 @return 0 - latin locale, -1 - hebrew locale
36 */
37 int
38 hdate_is_hebrew_locale()
39 {
40 char *locale;
41 char *language;
42
43 /* Get the name of the current locale. */
44 #ifdef ENABLE_NLS
45 locale = setlocale (LC_MESSAGES, NULL);
46 language = getenv ("LANGUAGE");
47 #else
48 locale = NULL;
49 language = NULL;
50 #endif
51
52 if (!((locale && (locale[0] == 'h') && (locale[1] == 'e')) ||
53 (language && (language[0] == 'h') && (language[1] == 'e'))))
54 {
55 /* not hebrew locale return false */
56 return 0;
57 }
58
59 return -1;
60 }
61
62 /**
63 @brief Return a string, with the hebrew date.
64
65 @return NULL pointer upon failure or, upon success, a pointer to a
66 string containing the short ( e.g. "1 Tishrey" ) or long (e.g. "Tuesday
67 18 Tishrey 5763 Hol hamoed Sukot" ) formated date. You must free() the
68 pointer after use.
69
70 @param h The hdate_struct of the date to print.
71 @param diaspora if true give diaspora holydays
72 @param short_format A short flag (true - returns a short string, false returns a long string).
73
74 @warning This was originally written using a local static string,
75 calling for output to be copied away.
76 */
77
78 char * hdate_get_format_date (hdate_struct const *h, int const diaspora, int const short_format)
79 {
80 int hebrew_format = HDATE_STRING_LOCAL;
81 int omer_day = 0;
82 int holiday = 0;
83 char *bet_h = ""; // Hebrew prefix for Hebrew month
84
85 char *hebrew_buffer1, *hebrew_buffer2;
86 size_t hebrew_buffer1_len = -1;
87 size_t hebrew_buffer2_len = -1;
88
89 char *hday_int_str, *hyear_int_str, *omer_str;
90
91 if (hdate_is_hebrew_locale())
92 {
93 bet_h="ב";
94 hebrew_format = HDATE_STRING_HEBREW;
95 }
96
97 hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,hebrew_format);
98 if (hday_int_str == NULL) return NULL;
99 hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,hebrew_format);
100 if (hyear_int_str == NULL)
101 {
102 free(hday_int_str);
103 return NULL;
104 }
105
106 /************************************************************
107 * short format
108 ************************************************************/
109 if (short_format)
110 {
111 hebrew_buffer1_len = asprintf (&hebrew_buffer1, "%s %s %s\n",
112 hday_int_str,
113 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, hebrew_format),
114 hyear_int_str);
115 }
116
117
118 /************************************************************
119 * long (normal) format
120 ************************************************************/
121 else
122 {
123 hebrew_buffer1_len = asprintf (&hebrew_buffer1, "%s %s%s %s",
124 hday_int_str,
125 bet_h,
126 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, hebrew_format),
127 hyear_int_str);
128
129 /* if a day in the omer print it */
130 if (hebrew_buffer1_len != -1) omer_day = hdate_get_omer_day(h);
131 if (omer_day != 0)
132 {
133 omer_str = hdate_string(HDATE_STRING_OMER, omer_day, HDATE_STRING_LONG, hebrew_format);
134 hebrew_buffer2_len = asprintf (&hebrew_buffer2, "%s, %s", hebrew_buffer1, omer_str);
135 if (omer_str != NULL) free(omer_str);
136 free(hebrew_buffer1);
137 if (hebrew_buffer2_len != -1) hebrew_buffer1 = hebrew_buffer2;
138 hebrew_buffer1_len = hebrew_buffer2_len;
139 }
140
141 /* if holiday print it */
142 if (hebrew_buffer1_len != -1) holiday = hdate_get_holyday (h, diaspora);
143 if (holiday != 0)
144 {
145 hebrew_buffer2_len = asprintf (&hebrew_buffer2, "%s, %s", hebrew_buffer1,
146 hdate_string( HDATE_STRING_HOLIDAY, holiday, HDATE_STRING_LONG, hebrew_format));
147 free(hebrew_buffer1);
148 if (hebrew_buffer2_len != -1) hebrew_buffer1 = hebrew_buffer2;
149 hebrew_buffer1_len = hebrew_buffer2_len;
150 }
151
152 }
153
154 free(hday_int_str);
155 free(hyear_int_str);
156 if (hebrew_buffer1_len != -1) return hebrew_buffer1;
157 return NULL;
158 }
159
160 /**
161 @brief Return a static string, with the package name and version
162
163 @return a a static string, with the package name and version
164 */
165 char *
166 hdate_get_version_string ()
167 {
168 static char version[500];
169
170 /* make a "packge version" string */
171 // snprintf (version, 500, "%s %s", PACKAGE, VERSION);
172
173 return (version);
174 }
175
176 /**
177 @brief Return a static string, with the name of translator
178
179 @return a a static string, with the name of translator
180 */
181 char *
182 hdate_get_translator_string ()
183 {
184 /* if untranslated return null */
185 if (strcmp (_("translator"), "translator") == 0)
186 return NULL;
187
188 /* return the translator name */
189 return _("translator");
190 }
191
192 /**
193 @brief Return string values for hdate information
194 @return a pointer to a string containing the information. In the cases
195 integers and omer, the strings will NOT be static, and the
196 caller must free() them after use.
197 @param type_of_string 0 = integer, 1 = day of week, 2 = parshaot,
198 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer
199 @param index integer ( 0 < n < 11000)
200 day of week ( 0 < n < 8 )
201 parshaot ( 0 , n < 62 )
202 hmonth ( 0 < n < 15 )
203 gmonth ( 0 < n < 13 )
204 holiday ( 0 < n < 37 )
205 omer ( 0 < n < 50 )
206 @param short_form 0 = short format
207 @param hebrew_form 0 = not hebrew (native/embedded)
208 */
209
210 // TODO - Number days of chol hamoed, and maybe have an entry for shabbat chol hamoed
211 // DONE - (I hope) change short to be = 1 long = 0, and switch order of data structures
212 // this way user app opt.short = 0/FALSE will work as a parameter to pass here
213
214 // These definitions are in hdate.h
215 //
216 // HDATE_STRING_INT 0
217 // HDATE_STRING_DOW 1
218 // HDATE_STRING_PARASHA 2
219 // HDATE_STRING_HMONTH 3
220 // HDATE_STRING_GMONTH 4
221 // HDATE_STRING_HOLIDAY 5
222 // HDATE_STRING_OMER 6
223 // HDATE STRING_SHORT 1
224 // HDATE_STRING_LONG 0
225 // HDATE_STRING_HEBREW 1
226 // HDATE_STRING_LOCAL 0
227 char* hdate_string( int const type_of_string, int const index, int const input_short_form, int const input_hebrew_form)
228 {
229 int short_form = 0;
230 int hebrew_form = 0;
231
232 // type_of_string: integer and omer require allocated strings
233 char *return_string = NULL;
234 char *h_int_string = NULL;
235 int return_string_len = -1;
236
237 #define H_CHAR_WIDTH 2
238 static char *digits[3][10] = {
239 {" ", "א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט"},
240 {"ט", "י", "כ", "ל", "מ", "נ", "ס", "ע", "פ", "צ"},
241 {" ", "ק", "ר", "ש", "ת"}
242 };
243
244 static char *days[2][2][7] = {
245 { // begin english
246 { // begin english long
247 N_("Sunday"), N_("Monday"), N_("Tuesday"), N_("Wednesday"),
248 N_("Thursday"), N_("Friday"), N_("Saturday")},
249 { // begin english short
250 N_("Sun"), N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"),
251 N_("Fri"), N_("Sat")}
252 },
253 { // begin hebrew
254 { // begin hebrew long
255 "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"},
256 { // begin hebrew short
257 "א", "ב", "ג", "ד", "ה", "ו", "ש"}
258 }
259 };
260
261 static char *parashaot[2][2][62] = {
262 { // begin english
263 { // begin english long
264 N_("none"), N_("Bereshit"), N_("Noach"),
265 N_("Lech-Lecha"), N_("Vayera"), N_("Chayei Sara"),
266 N_("Toldot"), N_("Vayetzei"), N_("Vayishlach"),
267 N_("Vayeshev"), N_("Miketz"), N_("Vayigash"), /* 11 */
268 N_("Vayechi"), N_("Shemot"), N_("Vaera"),
269 N_("Bo"), N_("Beshalach"), N_("Yitro"),
270 N_("Mishpatim"), N_("Terumah"), N_("Tetzaveh"), /* 20 */
271 N_("Ki Tisa"), N_("Vayakhel"), N_("Pekudei"),
272 N_("Vayikra"), N_("Tzav"), N_("Shmini"),
273 N_("Tazria"), N_("Metzora"), N_("Achrei Mot"),
274 N_("Kedoshim"), N_("Emor"), N_("Behar"), /* 32 */
275 N_("Bechukotai"), N_("Bamidbar"), N_("Nasso"),
276 N_("Beha'alotcha"), N_("Sh'lach"), N_("Korach"),
277 N_("Chukat"), N_("Balak"), N_("Pinchas"), /* 41 */
278 N_("Matot"), N_("Masei"), N_("Devarim"),
279 N_("Vaetchanan"), N_("Eikev"), N_("Re'eh"),
280 N_("Shoftim"), N_("Ki Teitzei"), N_("Ki Tavo"), /* 50 */
281 N_("Nitzavim"), N_("Vayeilech"), N_("Ha'Azinu"),
282 N_("Vezot Habracha"), /* 54 */
283 N_("Vayakhel-Pekudei"),N_("Tazria-Metzora"), N_("Achrei Mot-Kedoshim"),
284 N_("Behar-Bechukotai"),N_("Chukat-Balak"), N_("Matot-Masei"),
285 N_("Nitzavim-Vayeilech")},
286 { // begin english short
287 N_("none"), N_("Bereshit"), N_("Noach"),
288 N_("Lech-Lecha"), N_("Vayera"), N_("Chayei Sara"),
289 N_("Toldot"), N_("Vayetzei"), N_("Vayishlach"),
290 N_("Vayeshev"), N_("Miketz"), N_("Vayigash"), /* 11 */
291 N_("Vayechi"), N_("Shemot"), N_("Vaera"),
292 N_("Bo"), N_("Beshalach"), N_("Yitro"),
293 N_("Mishpatim"), N_("Terumah"), N_("Tetzaveh"), /* 20 */
294 N_("Ki Tisa"), N_("Vayakhel"), N_("Pekudei"),
295 N_("Vayikra"), N_("Tzav"), N_("Shmini"),
296 N_("Tazria"), N_("Metzora"), N_("Achrei Mot"),
297 N_("Kedoshim"), N_("Emor"), N_("Behar"), /* 32 */
298 N_("Bechukotai"), N_("Bamidbar"), N_("Nasso"),
299 N_("Beha'alotcha"), N_("Sh'lach"), N_("Korach"),
300 N_("Chukat"), N_("Balak"), N_("Pinchas"), /* 41 */
301 N_("Matot"), N_("Masei"), N_("Devarim"),
302 N_("Vaetchanan"), N_("Eikev"), N_("Re'eh"),
303 N_("Shoftim"), N_("Ki Teitzei"), N_("Ki Tavo"), /* 50 */
304 N_("Nitzavim"), N_("Vayeilech"), N_("Ha'Azinu"),
305 N_("Vezot Habracha"), /* 54 */
306 N_("Vayakhel-Pekudei"),N_("Tazria-Metzora"), N_("Achrei Mot-Kedoshim"),
307 N_("Behar-Bechukotai"),N_("Chukat-Balak"), N_("Matot-Masei"),
308 N_("Nitzavim-Vayeilech")}
309 },
310 { // begin hebrew
311 { // begin hebrew long
312 "none", "בראשית", "נח",
313 "לך לך", "וירא", "חיי שרה",
314 "תולדות", "ויצא", "וישלח",
315 "וישב", "מקץ", "ויגש", /* 11 */
316 "ויחי", "שמות", "וארא",
317 "בא", "בשלח", "יתרו",
318 "משפטים", "תרומה", "תצוה", /* 20 */
319 "כי תשא", "ויקהל", "פקודי",
320 "ויקרא", "צו", "שמיני",
321 "תזריע", "מצורע", "אחרי מות",
322 "קדושים", "אמור", "בהר", /* 32 */
323 "בחוקתי", "במדבר", "נשא",
324 "בהעלתך", "שלח", "קרח",
325 "חקת", "בלק", "פנחס", /* 41 */
326 "מטות", "מסעי", "דברים",
327 "ואתחנן", "עקב", "ראה",
328 "שופטים", "כי תצא", "כי תבוא", /* 50 */
329 "נצבים", "וילך", "האזינו",
330 "וזאת הברכה", /* 54 */
331 "ויקהל-פקודי", "תזריע-מצורע", "אחרי מות-קדושים",
332 "בהר-בחוקתי", "חוקת-בלק", "מטות מסעי",
333 "נצבים-וילך"},
334 { // begin hebrew short
335 "none", "בראשית", "נח",
336 "לך לך", "וירא", "חיי שרה",
337 "תולדות", "ויצא", "וישלח",
338 "וישב", "מקץ", "ויגש", /* 11 */
339 "ויחי", "שמות", "וארא",
340 "בא", "בשלח", "יתרו",
341 "משפטים", "תרומה", "תצוה", /* 20 */
342 "כי תשא", "ויקהל", "פקודי",
343 "ויקרא", "צו", "שמיני",
344 "תזריע", "מצורע", "אחרי מות",
345 "קדושים", "אמור", "בהר", /* 32 */
346 "בחוקתי", "במדבר", "נשא",
347 "בהעלתך", "שלח", "קרח",
348 "חקת", "בלק", "פנחס", /* 41 */
349 "מטות", "מסעי", "דברים",
350 "ואתחנן", "עקב", "ראה",
351 "שופטים", "כי תצא", "כי תבוא", /* 50 */
352 "נצבים", "וילך", "האזינו",
353 "וזאת הברכה", /* 54 */
354 "ויקהל-פקודי", "תזריע-מצורע", "אחרי מות-קדושים",
355 "בהר-בחוקתי", "חוקת-בלק", "מטות מסעי",
356 "נצבים-וילך"}
357 }
358 };
359
360 static char *hebrew_months[2][2][14] = {
361 { // begin english
362 { // begin english long
363 N_("Tishrei"), N_("Cheshvan"), N_("Kislev"), N_("Tevet"),
364 N_("Sh'vat"), N_("Adar"), N_("Nisan"), N_("Iyyar"),
365 N_("Sivan"), N_("Tammuz"), N_("Av"), N_("Elul"), N_("Adar I"),
366 N_("Adar II")},
367 { // begin english short
368 N_("Tishrei"), N_("Cheshvan"), N_("Kislev"), N_("Tevet"),
369 N_("Sh'vat"), N_("Adar"), N_("Nisan"), N_("Iyyar"),
370 N_("Sivan"), N_("Tammuz"), N_("Av"), N_("Elul"), N_("Adar I"),
371 N_("Adar II")}
372 },
373 { // begin hebrew
374 { // begin hebrew long
375 "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "ניסן", "אייר",
376 "סיון", "תמוז", "אב", "אלול", "אדר א", "אדר ב" },
377 { // begin hebrew short
378 "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "ניסן", "אייר",
379 "סיון", "תמוז", "אב", "אלול", "אדר א", "אדר ב" }}
380 };
381
382 static char *gregorian_months[2][12] = {
383 {N_("January"), N_("February"), N_("March"),
384 N_("April"), N_("May"), N_("June"),
385 N_("July"), N_("August"), N_("September"),
386 N_("October"), N_("November"), N_("December")},
387 {N_("Jan"), N_("Feb"), N_("Mar"), N_("Apr"), N_("May"),
388 N_("Jun"), N_("Jul"), N_("Aug"), N_("Sep"), N_("Oct"),
389 N_("Nov"), N_("Dec")},
390 };
391
392 static char *holidays[2][2][37] = {
393 { // begin english
394 { // begin english long
395 N_("Rosh Hashana I"), N_("Rosh Hashana II"),
396 N_("Tzom Gedaliah"), N_("Yom Kippur"),
397 N_("Sukkot"), N_("Hol hamoed Sukkot"),
398 N_("Hoshana raba"), N_("Simchat Torah"),
399 N_("Chanukah"), N_("Asara B'Tevet"),
400 N_("Tu B'Shvat"), N_("Ta'anit Esther"),
401 N_("Purim"), N_("Shushan Purim"),
402 N_("Pesach"), N_("Hol hamoed Pesach"),
403 N_("Yom HaAtzma'ut"), N_("Lag B'Omer"),
404 N_("Erev Shavuot"), N_("Shavuot"),
405 N_("Tzom Tammuz"), N_("Tish'a B'Av"),
406 N_("Tu B'Av"), N_("Yom HaShoah"),
407 N_("Yom HaZikaron"), N_("Yom Yerushalayim"),
408 N_("Shmini Atzeret"), N_("Pesach VII"),
409 N_("Pesach VIII"), N_("Shavuot II"),
410 N_("Sukkot II"), N_("Pesach II"),
411 N_("Family Day"), N_("Memorial day for fallen whose place of burial is unknown"),
412 N_("Yitzhak Rabin memorial day"), N_("Zeev Zhabotinsky day"),
413 N_("Erev Yom Kippur")},
414 { // begin english short
415 N_("Rosh Hashana I"), N_("Rosh Hashana II"),
416 N_("Tzom Gedaliah"), N_("Yom Kippur"),
417 N_("Sukkot"), N_("Hol hamoed Sukkot"),
418 N_("Hoshana raba"), N_("Simchat Torah"),
419 N_("Chanukah"), N_("Asara B'Tevet"), /* 10 */
420 N_("Tu B'Shvat"), N_("Ta'anit Esther"),
421 N_("Purim"), N_("Shushan Purim"),
422 N_("Pesach"), N_("Hol hamoed Pesach"),
423 N_("Yom HaAtzma'ut"), N_("Lag B'Omer"),
424 N_("Erev Shavuot"), N_("Shavuot"), /* 20 */
425 N_("Tzom Tammuz"), N_("Tish'a B'Av"),
426 N_("Tu B'Av"), N_("Yom HaShoah"),
427 N_("Yom HaZikaron"), N_("Yom Yerushalayim"),
428 N_("Shmini Atzeret"), N_("Pesach VII"),
429 N_("Pesach VIII"), N_("Shavuot II"), /* 30 */
430 N_("Sukkot II"), N_("Pesach II"),
431 N_("Family Day"), N_("Memorial day for fallen whose place of burial is unknown"),
432 N_("Rabin memorial day"), N_("Zhabotinsky day"),
433 N_("Erev Yom Kippur")}
434 },
435 { // begin hebrew
436 { // begin hebrew long
437 "א ר\"ה", "ב' ר\"ה",
438 "צום גדליה", "יוה\"כ",
439 "סוכות", "חוה\"מ סוכות",
440 "הוש\"ר", "שמח\"ת",
441 "חנוכה", "י' בטבת", /* 10 */
442 "ט\"ו בשבט", "תענית אסתר",
443 "פורים", "שושן פורים",
444 "פסח", "חוה\"מ פסח",
445 "יום העצמאות", "ל\"ג בעומר",
446 "ערב שבועות", "שבועות", /* 20 */
447 "צום תמוז", "ט' באב",
448 "ט\"ו באב", "יום השואה",
449 "יום הזכרון", "יום י-ם",
450 "שמיני עצרת", "ז' פסח",
451 "אחרון של פסח", "ב' שבועות", /* 30 */
452 "ב' סוכות", "ב' פסח",
453 "יום המשפחה", "יום זכרון...",
454 "יום הזכרון ליצחק רבין","יום ז\'בוטינסקי",
455 "עיוה\"כ"},
456 { // begin hebrew short
457 "א' ראש השנה", "ב' ראש השנה",
458 "צום גדליה", "יום הכפורים",
459 "סוכות", "חול המועד סוכות",
460 "הושענא רבה", "שמחת תורה",
461 "חנוכה", "צום עשרה בטבת",/* 10 */
462 "ט\"ו בשבט", "תענית אסתר",
463 "פורים", "שושן פורים",
464 "פסח", "חול המועד פסח",
465 "יום העצמאות", "ל\"ג בעומר",
466 "ערב שבועות", "שבועות", /* 20 */
467 "צום שבעה עשר בתמוז", "תשעה באב",
468 "ט\"ו באב", "יום השואה",
469 "יום הזכרון", "יום ירושלים",
470 "שמיני עצרת", "שביעי פסח",
471 "אחרון של פסח", "שני של שבועות",/* 30 */
472 "שני של סוכות", "שני של פסח",
473 "יום המשפחה", "יום זכרון...",
474 "יום הזכרון ליצחק רבין","יום ז\'בוטינסקי",
475 "עיוה\"כ"} }
476 };
477
478 #ifdef ENABLE_NLS
479 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
480 bind_textdomain_codeset (PACKAGE, "UTF-8");
481 #endif
482
483 // validate parameters
484 if (input_short_form != 0) short_form = 1;
485 if (input_hebrew_form != 0) hebrew_form = 1;
486
487 switch (type_of_string)
488 {
489 case HDATE_STRING_DOW: if (index >= 1 && index <= 7)
490 return _(days[hebrew_form][short_form][index - 1]);
491 break;
492 case HDATE_STRING_PARASHA: if (index >= 1 && index <= 61)
493 return _(parashaot[hebrew_form][short_form][index]);
494 break;
495 case HDATE_STRING_HMONTH:
496 if (index >= 1 && index <= 14)
497 return _(hebrew_months[hebrew_form][short_form][index - 1]);
498 break;
499 case HDATE_STRING_GMONTH:
500 if (index >= 1 && index <= 12)
501 return _(gregorian_months[short_form][index - 1]);
502 break;
503 case HDATE_STRING_HOLIDAY: if (index >= 1 && index <= 37)
504 return _(holidays[hebrew_form][short_form][index - 1]);
505 break;
506 case HDATE_STRING_OMER:
507 if (index > 0 && index < 50)
508 {
509 h_int_string = hdate_string(HDATE_STRING_INT, index, HDATE_STRING_LONG, hebrew_form);
510 if (h_int_string == NULL) return NULL;
511
512 return_string_len = asprintf(
513 &return_string, "%s %s", h_int_string, _("in the Omer"));
514
515 free(h_int_string);
516
517 if (return_string_len != -1) return return_string;
518 }
519 return NULL;
520 break;
521 case HDATE_STRING_INT:
522 if ((index > 0) && (index < 11000))
523 {
524 // not hebrew form - return the number in decimal form
525 if (!hebrew_form)
526 {
527 return_string_len = asprintf (&return_string, "%d", index);
528 if (return_string_len == -1) return NULL;
529 return return_string;
530 }
531
532 // HEBREW_NUMBER_BUFFER_SIZE 17 defined in hdate.h
533 return_string = malloc(HEBREW_NUMBER_BUFFER_SIZE);
534 if (return_string == NULL) return NULL;
535
536 return_string[0] = '\0';
537
538 int n = index;
539
540 if (n >= 1000)
541 {
542 strncat (return_string, digits[0][n / 1000], H_CHAR_WIDTH);
543 n %= 1000;
544 }
545 while (n >= 400)
546 {
547 strncat (return_string, digits[2][4], H_CHAR_WIDTH);
548 n -= 400;
549 }
550 if (n >= 100)
551 {
552 strncat (return_string, digits[2][n / 100], H_CHAR_WIDTH);
553 n %= 100;
554 }
555 if (n >= 10)
556 {
557 if (n == 15 || n == 16)
558 n -= 9;
559 strncat (return_string, digits[1][n / 10], H_CHAR_WIDTH);
560 n %= 10;
561 }
562 if (n > 0)
563 strncat (return_string, digits[0][n], H_CHAR_WIDTH);
564
565 // possibly add the ' and " to hebrew numbers
566 if (!short_form)
567 {
568 return_string_len = strlen (return_string);
569 if (return_string_len <= H_CHAR_WIDTH) strncat (return_string, "'", H_CHAR_WIDTH);
570 else
571 {
572 return_string[return_string_len + 1] = return_string[return_string_len];
573 return_string[return_string_len] = return_string[return_string_len - 1];
574 return_string[return_string_len - 1] = return_string[return_string_len - 2];
575 return_string[return_string_len - 2] = '\"';
576 return_string[return_string_len + 2] = '\0';
577 }
578 }
579 return return_string;
580 }
581 return NULL;
582 break;
583 } // end of switch(type_of_string)
584
585 return NULL;
586 }
0
1 EXTRA_DIST = hdate.i
2
3 if WITH_PERL
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cxx *.so *wrap* *.pm
8
9 all-am: hdate.so
10
11
12 hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so
15
16 hdate_wrap.cxx: hdate.i
17 swig -perl -c++ hdate.i
18
19 install-data-local: hdate.so
20 $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/
21 $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so
22 $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm
23
24 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/perl
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i
233 @WITH_PERL_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_PERL_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.pm
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/perl/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_PERL_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_PERL_TRUE@all-am: hdate.so
429
430 @WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx
431 @WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PERL_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so
433
434 @WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i
435 @WITH_PERL_TRUE@ swig -perl -c++ hdate.i
436
437 @WITH_PERL_TRUE@install-data-local: hdate.so
438 @WITH_PERL_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/
439 @WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PE_MODULES_PATH)/auto/hdate/hdate.so
440 @WITH_PERL_TRUE@ $(INSTALL_DATA) hdate.pm $(DESTDIR)$(PE_MODULES_PATH)/hdate.pm
441
442 # Tell versions [3.59,3.63) of GNU make to not export all variables.
443 # Otherwise a system limit (for SysV at least) may be exceeded.
444 .NOEXPORT:
0
1 EXTRA_DIST = hdate.i hdate.ini
2
3 if WITH_PHP
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cpp *.h *.so *.php *wrap*
8
9 all-am: hdate.so
10
11
12 hdate.so: hdate_wrap.cpp
13 g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp
14 gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so
15
16 hdate_wrap.cpp: hdate.i
17 swig -php5 -c++ hdate.i
18
19 install-data-local: hdate.so hdate.ini hdate.php
20 $(mkinstalldirs) $(DESTDIR)$(PH_MODULES_PATH)
21 $(INSTALL_DATA) hdate.so $(DESTDIR)$(PH_MODULES_PATH)/hdate.so
22
23 $(mkinstalldirs) $(DESTDIR)$(PH_CONFIG_PATH)
24 $(INSTALL_DATA) hdate.ini $(DESTDIR)$(PH_CONFIG_PATH)/hdate.ini
25
26 $(mkinstalldirs) $(DESTDIR)$(PH_INCLUDE_PATH)
27 $(INSTALL_DATA) hdate.php $(DESTDIR)$(PH_INCLUDE_PATH)/hdate.php
28 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/php
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i hdate.ini
233 @WITH_PHP_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_PHP_TRUE@CLEANFILES = *.o *.cpp *.h *.so *.php *wrap*
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/php/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/php/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_PHP_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_PHP_TRUE@all-am: hdate.so
429
430 @WITH_PHP_TRUE@hdate.so: hdate_wrap.cpp
431 @WITH_PHP_TRUE@ g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp
432 @WITH_PHP_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so
433
434 @WITH_PHP_TRUE@hdate_wrap.cpp: hdate.i
435 @WITH_PHP_TRUE@ swig -php5 -c++ hdate.i
436
437 @WITH_PHP_TRUE@install-data-local: hdate.so hdate.ini hdate.php
438 @WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_MODULES_PATH)
439 @WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(PH_MODULES_PATH)/hdate.so
440
441 @WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_CONFIG_PATH)
442 @WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.ini $(DESTDIR)$(PH_CONFIG_PATH)/hdate.ini
443
444 @WITH_PHP_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PH_INCLUDE_PATH)
445 @WITH_PHP_TRUE@ $(INSTALL_DATA) hdate.php $(DESTDIR)$(PH_INCLUDE_PATH)/hdate.php
446
447 # Tell versions [3.59,3.63) of GNU make to not export all variables.
448 # Otherwise a system limit (for SysV at least) may be exceeded.
449 .NOEXPORT:
0
1 EXTRA_DIST = hdate.i
2
3 if WITH_PYTHON
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cxx *.so *wrap* *.py
8
9 all-am: _hdate.so
10
11
12 _hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so
15
16 hdate_wrap.cxx: hdate.i
17 swig -python -c++ hdate.i
18
19 install-data-local: _hdate.so
20 $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH)
21 $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so
22 $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py
23
24 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/python
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i
233 @WITH_PYTHON_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_PYTHON_TRUE@CLEANFILES = *.o *.cxx *.so *wrap* *.py
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/python/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_PYTHON_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_PYTHON_TRUE@all-am: _hdate.so
429
430 @WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx
431 @WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PYTHON_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so
433
434 @WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i
435 @WITH_PYTHON_TRUE@ swig -python -c++ hdate.i
436
437 @WITH_PYTHON_TRUE@install-data-local: _hdate.so
438 @WITH_PYTHON_TRUE@ $(mkinstalldirs) $(DESTDIR)$(PY_MODULES_PATH)
439 @WITH_PYTHON_TRUE@ $(INSTALL_DATA) _hdate.so $(DESTDIR)$(PY_MODULES_PATH)/_hdate.so
440 @WITH_PYTHON_TRUE@ $(INSTALL_DATA) hdate.py $(DESTDIR)$(PY_MODULES_PATH)/hdate.py
441
442 # Tell versions [3.59,3.63) of GNU make to not export all variables.
443 # Otherwise a system limit (for SysV at least) may be exceeded.
444 .NOEXPORT:
0
1 EXTRA_DIST = hdate.i
2
3 if WITH_RUBY
4
5 DEPS= $(top_builddir)/src/libhdate.la
6
7 CLEANFILES = *.o *.cxx *.so *wrap*
8
9 all-am: hdate.so
10
11
12 hdate.so: hdate_wrap.cxx
13 g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src
14 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
15
16 hdate_wrap.cxx: hdate.i
17 swig -c++ -ruby hdate.i
18
19 install-data-local: hdate.so
20 $(mkinstalldirs) $(DESTDIR)$(RU_MODULES_PATH)
21 $(INSTALL_DATA) hdate.so $(DESTDIR)$(RU_MODULES_PATH)/hdate.so
22
23 endif
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
20 case $$MAKEFLAGS in \
21 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
31 esac; \
32 test $$am__dry = yes; \
33 }
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 subdir = bindings/ruby
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
54 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
55 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
56 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
57 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
58 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
59 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
60 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
61 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
62 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_CLEAN_FILES =
67 CONFIG_CLEAN_VPATH_FILES =
68 SOURCES =
69 DIST_SOURCES =
70 am__can_run_installinfo = \
71 case $$AM_UPDATE_INFO_DIR in \
72 n|no|NO) false;; \
73 *) (install-info --version) >/dev/null 2>&1;; \
74 esac
75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76 ACLOCAL = @ACLOCAL@
77 AMTAR = @AMTAR@
78 AR = @AR@
79 AUTOCONF = @AUTOCONF@
80 AUTOHEADER = @AUTOHEADER@
81 AUTOMAKE = @AUTOMAKE@
82 AWK = @AWK@
83 CC = @CC@
84 CCDEPMODE = @CCDEPMODE@
85 CFLAGS = @CFLAGS@
86 CPP = @CPP@
87 CPPFLAGS = @CPPFLAGS@
88 CYGPATH_W = @CYGPATH_W@
89 DATADIRNAME = @DATADIRNAME@
90 DEFS = @DEFS@
91 DEPDIR = @DEPDIR@
92 DLLTOOL = @DLLTOOL@
93 DSYMUTIL = @DSYMUTIL@
94 DUMPBIN = @DUMPBIN@
95 ECHO_C = @ECHO_C@
96 ECHO_N = @ECHO_N@
97 ECHO_T = @ECHO_T@
98 EGREP = @EGREP@
99 EXEEXT = @EXEEXT@
100 FGREP = @FGREP@
101 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
102 GMSGFMT = @GMSGFMT@
103 GMSGFMT_015 = @GMSGFMT_015@
104 GP_MODULES_PATH = @GP_MODULES_PATH@
105 GREP = @GREP@
106 INSTALL = @INSTALL@
107 INSTALL_DATA = @INSTALL_DATA@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
111 INTLLIBS = @INTLLIBS@
112 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBICONV = @LIBICONV@
116 LIBINTL = @LIBINTL@
117 LIBOBJS = @LIBOBJS@
118 LIBS = @LIBS@
119 LIBTOOL = @LIBTOOL@
120 LIPO = @LIPO@
121 LN_S = @LN_S@
122 LTLIBICONV = @LTLIBICONV@
123 LTLIBINTL = @LTLIBINTL@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAINT = @MAINT@
126 MAKEINFO = @MAKEINFO@
127 MANIFEST_TOOL = @MANIFEST_TOOL@
128 MKDIR_P = @MKDIR_P@
129 MSGFMT = @MSGFMT@
130 MSGFMT_015 = @MSGFMT_015@
131 MSGMERGE = @MSGMERGE@
132 NM = @NM@
133 NMEDIT = @NMEDIT@
134 OBJDUMP = @OBJDUMP@
135 OBJEXT = @OBJEXT@
136 OTOOL = @OTOOL@
137 OTOOL64 = @OTOOL64@
138 PACKAGE = @PACKAGE@
139 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
140 PACKAGE_NAME = @PACKAGE_NAME@
141 PACKAGE_STRING = @PACKAGE_STRING@
142 PACKAGE_TARNAME = @PACKAGE_TARNAME@
143 PACKAGE_URL = @PACKAGE_URL@
144 PACKAGE_VERSION = @PACKAGE_VERSION@
145 PATH_SEPARATOR = @PATH_SEPARATOR@
146 PA_MODULES_PATH = @PA_MODULES_PATH@
147 PA_VERSION = @PA_VERSION@
148 PE_CFLAGS = @PE_CFLAGS@
149 PE_MODULES_PATH = @PE_MODULES_PATH@
150 PH_CONFIG_PATH = @PH_CONFIG_PATH@
151 PH_INCLUDE_PATH = @PH_INCLUDE_PATH@
152 PH_MODULES_PATH = @PH_MODULES_PATH@
153 PKG_CONFIG = @PKG_CONFIG@
154 POSUB = @POSUB@
155 PY_CFLAGS = @PY_CFLAGS@
156 PY_MODULES_PATH = @PY_MODULES_PATH@
157 PY_VERSION = @PY_VERSION@
158 RANLIB = @RANLIB@
159 RU_CFLAGS = @RU_CFLAGS@
160 RU_MODULES_PATH = @RU_MODULES_PATH@
161 RU_VERSION = @RU_VERSION@
162 SED = @SED@
163 SET_MAKE = @SET_MAKE@
164 SHELL = @SHELL@
165 STRIP = @STRIP@
166 USE_NLS = @USE_NLS@
167 VERSION = @VERSION@
168 VERSION_INFO = @VERSION_INFO@
169 XGETTEXT = @XGETTEXT@
170 XGETTEXT_015 = @XGETTEXT_015@
171 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
172 abs_builddir = @abs_builddir@
173 abs_srcdir = @abs_srcdir@
174 abs_top_builddir = @abs_top_builddir@
175 abs_top_srcdir = @abs_top_srcdir@
176 ac_ct_AR = @ac_ct_AR@
177 ac_ct_CC = @ac_ct_CC@
178 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
179 am__include = @am__include@
180 am__leading_dot = @am__leading_dot@
181 am__quote = @am__quote@
182 am__tar = @am__tar@
183 am__untar = @am__untar@
184 bindir = @bindir@
185 build = @build@
186 build_alias = @build_alias@
187 build_cpu = @build_cpu@
188 build_os = @build_os@
189 build_vendor = @build_vendor@
190 builddir = @builddir@
191 datadir = @datadir@
192 datarootdir = @datarootdir@
193 docdir = @docdir@
194 dvidir = @dvidir@
195 exec_prefix = @exec_prefix@
196 have_fpc = @have_fpc@
197 have_gpc = @have_gpc@
198 have_perl = @have_perl@
199 have_php = @have_php@
200 have_php_config = @have_php_config@
201 have_python = @have_python@
202 have_ruby = @have_ruby@
203 have_swig = @have_swig@
204 host = @host@
205 host_alias = @host_alias@
206 host_cpu = @host_cpu@
207 host_os = @host_os@
208 host_vendor = @host_vendor@
209 htmldir = @htmldir@
210 includedir = @includedir@
211 infodir = @infodir@
212 install_sh = @install_sh@
213 libdir = @libdir@
214 libexecdir = @libexecdir@
215 localedir = @localedir@
216 localstatedir = @localstatedir@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 top_build_prefix = @top_build_prefix@
230 top_builddir = @top_builddir@
231 top_srcdir = @top_srcdir@
232 EXTRA_DIST = hdate.i
233 @WITH_RUBY_TRUE@DEPS = $(top_builddir)/src/libhdate.la
234 @WITH_RUBY_TRUE@CLEANFILES = *.o *.cxx *.so *wrap*
235 all: all-am
236
237 .SUFFIXES:
238 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
239 @for dep in $?; do \
240 case '$(am__configure_deps)' in \
241 *$$dep*) \
242 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
243 && { if test -f $@; then exit 0; else break; fi; }; \
244 exit 1;; \
245 esac; \
246 done; \
247 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/ruby/Makefile'; \
248 $(am__cd) $(top_srcdir) && \
249 $(AUTOMAKE) --gnu bindings/ruby/Makefile
250 .PRECIOUS: Makefile
251 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252 @case '$?' in \
253 *config.status*) \
254 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
255 *) \
256 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
257 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
258 esac;
259
260 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
262
263 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
264 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
265 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267 $(am__aclocal_m4_deps):
268
269 mostlyclean-libtool:
270 -rm -f *.lo
271
272 clean-libtool:
273 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
279
280
281 distdir: $(DISTFILES)
282 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
283 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
284 list='$(DISTFILES)'; \
285 dist_files=`for file in $$list; do echo $$file; done | \
286 sed -e "s|^$$srcdirstrip/||;t" \
287 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
288 case $$dist_files in \
289 */*) $(MKDIR_P) `echo "$$dist_files" | \
290 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
291 sort -u` ;; \
292 esac; \
293 for file in $$dist_files; do \
294 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
295 if test -d $$d/$$file; then \
296 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
297 if test -d "$(distdir)/$$file"; then \
298 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
299 fi; \
300 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
301 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
302 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
303 fi; \
304 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
305 else \
306 test -f "$(distdir)/$$file" \
307 || cp -p $$d/$$file "$(distdir)/$$file" \
308 || exit 1; \
309 fi; \
310 done
311 check-am: all-am
312 check: check-am
313 all-am: Makefile
314 installdirs:
315 install: install-am
316 install-exec: install-exec-am
317 install-data: install-data-am
318 uninstall: uninstall-am
319
320 install-am: all-am
321 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
322
323 installcheck: installcheck-am
324 install-strip:
325 if test -z '$(STRIP)'; then \
326 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
327 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
328 install; \
329 else \
330 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
331 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
332 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
333 fi
334 mostlyclean-generic:
335
336 clean-generic:
337 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
338
339 distclean-generic:
340 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
341 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
342
343 maintainer-clean-generic:
344 @echo "This command is intended for maintainers to use"
345 @echo "it deletes files that may require special tools to rebuild."
346 @WITH_RUBY_FALSE@install-data-local:
347 clean: clean-am
348
349 clean-am: clean-generic clean-libtool mostlyclean-am
350
351 distclean: distclean-am
352 -rm -f Makefile
353 distclean-am: clean-am distclean-generic
354
355 dvi: dvi-am
356
357 dvi-am:
358
359 html: html-am
360
361 html-am:
362
363 info: info-am
364
365 info-am:
366
367 install-data-am: install-data-local
368
369 install-dvi: install-dvi-am
370
371 install-dvi-am:
372
373 install-exec-am:
374
375 install-html: install-html-am
376
377 install-html-am:
378
379 install-info: install-info-am
380
381 install-info-am:
382
383 install-man:
384
385 install-pdf: install-pdf-am
386
387 install-pdf-am:
388
389 install-ps: install-ps-am
390
391 install-ps-am:
392
393 installcheck-am:
394
395 maintainer-clean: maintainer-clean-am
396 -rm -f Makefile
397 maintainer-clean-am: distclean-am maintainer-clean-generic
398
399 mostlyclean: mostlyclean-am
400
401 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
402
403 pdf: pdf-am
404
405 pdf-am:
406
407 ps: ps-am
408
409 ps-am:
410
411 uninstall-am:
412
413 .MAKE: install-am install-strip
414
415 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
426
427
428 @WITH_RUBY_TRUE@all-am: hdate.so
429
430 @WITH_RUBY_TRUE@hdate.so: hdate_wrap.cxx
431 @WITH_RUBY_TRUE@ g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src
432 @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
433
434 @WITH_RUBY_TRUE@hdate_wrap.cxx: hdate.i
435 @WITH_RUBY_TRUE@ swig -c++ -ruby hdate.i
436
437 @WITH_RUBY_TRUE@install-data-local: hdate.so
438 @WITH_RUBY_TRUE@ $(mkinstalldirs) $(DESTDIR)$(RU_MODULES_PATH)
439 @WITH_RUBY_TRUE@ $(INSTALL_DATA) hdate.so $(DESTDIR)$(RU_MODULES_PATH)/hdate.so
440
441 # Tell versions [3.59,3.63) of GNU make to not export all variables.
442 # Otherwise a system limit (for SysV at least) may be exceeded.
443 .NOEXPORT:
0 /* local_functions.c http://libhdate.sourceforge.net
1 * a collection of functions in support of both hcal.c and hdate.c
2 * hcal.c Hebrew calendar (part of package libhdate)
3 * hdate.c Hebrew date/times information(part of package libhdate)
4 *
5 * compile:
6 * gcc `pkg-config --libs --cflags libhdate` ocal_functions.c -o local_functions
7 *
8 * Copyright: 2011-2012 (c) Boruch Baum
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24 /**************************************************
25 * functions to support hcal and hdate
26 **************************************************/
27
28 #include <hdate.h> // For hebrew date
29 //include "../../src/hdate.h"
30 #include <stdlib.h> // For atoi, malloc
31 #include <error.h> // For error
32 #include <errno.h> // For errno
33 #include <time.h> // For time
34 #include <ctype.h> // for isprint
35 #include <fnmatch.h> // For fnmatch
36 #include <string.h> // For mempcpy
37 #include <getopt.h> // For optarg, optind
38 #include <stdio.h> // For printf, fopen, fclose, fprintf, snprintf. FILE
39 #include <pwd.h> // for get pwuid
40 #include <unistd.h> // for getuid
41 #include <sys/stat.h>
42 #include <sys/types.h> // for mkdir,
43
44
45 // support for fnmatch
46 #define FNM_EXTMATCH (1 << 5)
47 #define FNM_NOFLAG 0
48
49 #define BAD_COORDINATE 999
50 #define BAD_TIMEZONE 999
51 #define DELTA_LONGITUDE 30
52
53 #define EXIT_CODE_BAD_PARMS 1
54
55
56
57 // copied from support.h in src dir
58 #ifdef ENABLE_NLS
59 # include <libintl.h>
60 # undef _
61 # define _(String) dgettext (PACKAGE, String)
62 # ifdef gettext_noop
63 # define N_(String) gettext_noop (String)
64 # else
65 # define N_(String) (String)
66 # endif
67 #else
68 # define textdomain(String) (String)
69 # define gettext(String) (String)
70 # define dgettext(Domain,Message) (Message)
71 # define dcgettext(Domain,Message,Type) (Message)
72 # define bindtextdomain(Domain,Directory) (Domain)
73 # define _(String) (String)
74 # define N_(String) (String)
75 #endif
76
77 #define FALSE 0
78 #define TRUE -1
79
80
81 // support for options parsing
82 #define MIN_CANDLES_MINUTES 18
83 #define DEFAULT_CANDLES_MINUTES 20
84 #define MAX_CANDLES_MINUTES 90
85 #define MIN_MOTZASH_MINUTES 20
86 #define MAX_MOTZASH_MINUTES 90
87
88
89 /************************************************************
90 * begin - error message functions
91 ************************************************************/
92 void print_parm_error ( char *parm_name )
93 {
94 error(0,0,"%s: %s %s %s",N_("error"),
95 N_("parameter"), parm_name,
96 N_("is non-numeric or out of bounds"));
97 }
98
99 void print_parm_missing_error ( char *parm_name )
100 {
101 error(0,0,"%s: %s %s %s",N_("error"),
102 N_("option"), parm_name, N_("missing parameter"));
103 }
104
105 void print_alert_timezone( int tz )
106 {
107 error(0,0,"%s: %s, %+d:%d UTC",
108 N_("ALERT: time zone not entered, using system local time zone"),
109 *tzname, tz/60, tz%60);
110 }
111
112 void print_parm_invalid_error( char *parm_name )
113 {
114 error(0,0,"%s: %s %s %s",N_("error"),
115 N_("option"), parm_name, N_("is not a valid option"));
116 }
117
118
119 /************************************************************
120 * end - error message functions
121 ************************************************************/
122
123
124
125
126 /************************************************************
127 * begin - alert message functions
128 ************************************************************/
129 void print_alert_coordinate( char *city_name )
130 {
131 error(0,0,"%s %s",
132 N_("ALERT: guessing... will use co-ordinates for"),
133 city_name);
134 }
135
136 void print_alert_default_location( int tz )
137 {
138 switch (tz/60)
139 {
140 case -8: print_alert_coordinate( N_("Los Angeles") ); break;
141 case -6: print_alert_coordinate( N_("Mexico City") ); break;
142 case -5: print_alert_coordinate( N_("New York City") ); break;
143 // case -5: print_alert_coordinate( N_("Toronto") ); break;
144 // case -3: print_alert_coordinate( N_("Sao Paolo") ); break;
145 case -3: print_alert_coordinate( N_("Buenos Aires") ); break;
146 case 0: print_alert_coordinate( N_("London") ); break;
147 case 1: print_alert_coordinate( N_("Paris") ); break;
148 case 2: print_alert_coordinate( N_("Tel-Aviv") ); break;
149 case 3: print_alert_coordinate( N_("Moscow") ); break;
150 case 5: print_alert_coordinate( N_("Tashkent") ); break;
151 case 8: print_alert_coordinate( N_("Beijing") ); break;
152 // case 8: print_alert_coordinate( N_("Hong Kong") ); break;
153 case -10: print_alert_coordinate( N_("Honolulu") ); break;
154 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;
155 }
156 }
157 /************************************************************
158 * end - alert message functions
159 ************************************************************/
160
161
162
163 /************************************************************
164 * set default location
165 ************************************************************/
166 void set_default_location( int tz, double *lat, double *lon )
167 {
168 /* Temporarily, set some default lat/lon coordinates
169 for certain timezones */
170
171 /**
172 { 00 } ( Latitude : 31.78; Longitude : 35.22; Name : 'Jerusalem' ),
173 { 01 } ( Latitude : 32.07; Longitude : 34.77; Name : 'Tel Aviv-Jafa' ),
174 { 02 } ( Latitude : 32.82; Longitude : 34.99; Name : 'Hifa' ),
175 { 03 } ( Latitude : 31.96; Longitude : 34.80; Name : 'Rishon Lezion' ),
176 { 04 } ( Latitude : 31.80; Longitude : 34.64; Name : 'Ashdod' ),
177 { 05 } ( Latitude : 31.25; Longitude : 34.80; Name : 'Be''er Sheva' ),
178 { 06 } ( Latitude : 32.09; Longitude : 34.88; Name : 'Petach Tiqva' ),
179 { 07 } ( Latitude : 32.33; Longitude : 34.86; Name : 'Netanya' ),
180 { 08 } ( Latitude : 32.02; Longitude : 34.76; Name : 'Holon' ),
181 { 09 } ( Latitude : 32.09; Longitude : 34.85; Name : 'B''ene Beraq' ),
182 { 10 } ( Latitude : 32.02; Longitude : 34.75; Name : 'Bat Yam' ),
183 { 11 } ( Latitude : 32.08; Longitude : 34.80; Name : 'Ramat Gan' ),
184 { 12 } ( Latitude : 31.67; Longitude : 34.56; Name : 'Ashqelon' ),
185 { 13 } ( Latitude : 31.89; Longitude : 34.80; Name : 'Rehovot' ),
186 { 14 } ( Latitude : 32.17; Longitude : 34.84; Name : 'Herzeliyya' ),
187 { 15 } ( Latitude : 32.19; Longitude : 34.91; Name : 'Kfar Saba' ),
188 { 16 } ( Latitude : 32.45; Longitude : 34.92; Name : 'Hadera' ),
189 { 17 } ( Latitude : 32.19; Longitude : 34.88; Name : 'Ra''anana' ),
190 { 18 } ( Latitude : 31.96; Longitude : 34.90; Name : 'Lod' ),
191 { 19 } ( Latitude : 31.93; Longitude : 34.86; Name : 'Ramla' )
192 **/
193
194 switch (tz/60)
195 {
196 case -8: *lat = 34.05; *lon =-118.25; break; // Los Angeles
197 case -6: *lat = 19.43; *lon = -99.13; break; // Mexico City
198 case -5: *lat = 40.0; *lon = -74.0; break; // New York
199 // case -5: *lat = 43.71; *lon = -79.43; break; // Toronto
200 // case -3: *lat = -23.55; *lon = -46.61; break; // Sao Paolo
201 case -3: *lat = -34.6; *lon = -58.37; break; // Buenos Aires
202 case 0: *lat = 51.0; *lon = 0.0; break; // London
203 case 1: *lat = 48.0; *lon = 2.0; break; // Paris
204 case 2: *lat = 32.0; *lon = 34.0; break; // Tel aviv
205 case 3: *lat = 55.0; *lon = 37.0; break; // Moscow
206 case 5: *lat = 41.27; *lon = 69.22; break; // Tashkent
207 case 8: *lat = 39.90; *lon = 116.38; break; // Beijing
208 // case 8: *lat = 22.26; *lon = 114.15; break; // Hong Kong
209 case 10: *lat = 21.30; *lon = 157.82; break; // Honolulu
210 default: *lat = 0.0; *lon = tz * .25; break; // center of timeone:
211 // .25 = (15 degrees) / 60 [because tz is in minutes, not hours]
212 }
213 return;
214 }
215
216
217
218 /************************************************************
219 * check for sunset
220 ************************************************************/
221 int check_for_sunset (hdate_struct * h, double lat, double lon, int timezone )
222 {
223 time_t now_time;
224 struct tm *now_timep;
225 int sunrise, sunset;
226
227 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
228 &sunrise, &sunset);
229
230 time(&now_time);
231 now_timep = localtime(&now_time);
232
233 if ( ((now_timep->tm_hour) *60 + now_timep->tm_min) > (sunset + timezone) ) return 1;
234 else return 0;
235 }
236
237
238
239
240 /***********************************************************
241 * reverse a hebrew string (for visual bidi)
242 * parameters:
243 * source is a pointer to a writeable buffer.
244 * source_len is the length of a string in source. This
245 * length must be LESS than the size of the source buffer
246 ***********************************************************/
247 void revstr( char *source, const size_t source_len)
248 {
249 #define H_CHAR_WIDTH 2
250
251 #define DEBUG 0
252 #if DEBUG
253 printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source);
254 #endif
255
256 if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);};
257 if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);};
258
259 size_t i,j;
260 char *temp_buff;
261
262 temp_buff = malloc(source_len+2);
263 if (temp_buff == NULL) {error(0,0,"revstr: malloc failure"); exit(0);};
264
265 for (i=(source_len-1), j=0; j < source_len; i--, j++)
266 {
267 if (isprint(source[i])) temp_buff[j] = source[i];
268 else
269 {
270 // FIXME - presumes H_CHAR_WIDTH = 2
271 temp_buff[j++] = source[i-1];
272 temp_buff[j] = source[i--];
273 }
274 }
275 memcpy(source, temp_buff, source_len);
276 source[source_len] = '\0';
277 #if DEBUG
278 printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source);
279 #endif
280 free(temp_buff);
281 return;
282 }
283
284
285 /************************************************************
286 * parse coordinate
287 *
288 * presumes commandline options were parsed using getopt.
289 * returns 1 to *opt_found on success
290 * returns the floating point value of the coordinate in *coordinate
291 *
292 * type_flag (1-latitude, 2=longitude)
293 ************************************************************/
294 int parse_coordinate( const int type_flag, char *input_string,
295 double *coordinate, int *opt_found)
296 {
297 //#define NEGATIVE_NUMBER_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
298 //#define NEGATIVE_DMS_GLOB "-[[:digit:]]?([[:digit:]]?([[:digit:]]))?([:\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
299 //#define COORDINATE_GLOB_DECIMAL "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))"
300 //#define COORDINATE_GLOB_DMS "?([+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))"
301
302 #define LATITUDE_GLOB_DECIMAL "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([nNsS])"
303 #define LONGITUDE_GLOB_DECIMAL "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?(.+([[:digit:]]))?([eEwW])"
304
305 #define LATITUDE_GLOB_DMS "?([nNsS+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([nNsS])"
306 #define LONGITUDE_GLOB_DMS "?([eEwW+-])[[:digit:]]?([[:digit:]]?([[:digit:]]))?([':\"]?([012345])[[:digit:]]?([:'\"]?([012345])[[:digit:]]))?([eEwW])"
307
308 char* seconds;
309
310 double fractional_part = 0;
311 int direction_modifier = 1;
312
313 /************************************************************
314 * input_string should hold the value to parse
315 * It must exist and be numeric
316 * we don't want confuse it with the next option of for "-x"
317 ************************************************************/
318 if (!input_string)
319 {
320 if (type_flag == 1) print_parm_missing_error(N_("l (latitude)"));
321 else if (type_flag == 2) print_parm_missing_error(N_("L (Longitue)"));
322 return TRUE; // error_detected = TRUE; ie failure
323 }
324
325 /************************************************************
326 * parse latitude
327 ************************************************************/
328 if (type_flag == 1)
329 {
330 if( (fnmatch( LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
331 && (fnmatch( LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
332 {
333 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
334 print_parm_missing_error(N_("l (latitude)"));
335 else print_parm_error(N_("l (latitude)"));
336 return TRUE; // error_detected = TRUE; ie failure
337 }
338
339
340 if ( strpbrk(input_string, "sS") != NULL ) direction_modifier = -1;
341
342
343 if (fnmatch(LATITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
344 {
345 *coordinate = (double) atof( strtok( input_string, "nNsS"));
346 }
347 else if (fnmatch(LATITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
348 {
349 *coordinate = (double) atof( strtok( input_string, "nNsS:'\""));
350 fractional_part = (double) atof( strtok( NULL, "nNsS:'\""))/60;
351 seconds = strtok( NULL, "nNsS:'\"");
352 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
353 }
354
355
356 if (*coordinate > 0)
357 *coordinate = (*coordinate + fractional_part) * direction_modifier;
358 else
359 *coordinate = *coordinate - fractional_part;
360
361
362 if( (*coordinate > -90) && (*coordinate < 90) )
363 {
364 *opt_found = 1;
365 return FALSE; // error_detected = FALSE; ie. success
366 }
367 print_parm_error(N_("L (Longitude)"));
368 return TRUE; // error_detected = TRUE; ie failure
369 }
370
371
372 /************************************************************
373 * parse longitude
374 ************************************************************/
375 if (type_flag == 2)
376 {
377 if( (fnmatch( LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0)
378 && (fnmatch( LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH) !=0) )
379 {
380 if (fnmatch("-*", input_string, FNM_NOFLAG)==0)
381 print_parm_missing_error(N_("L (Longitude)"));
382 else print_parm_error(N_("L (Longitude)"));
383 return TRUE; // error_detected = TRUE; ie failure
384 }
385
386
387 if ( strpbrk(input_string, "wW") != NULL ) direction_modifier = -1;
388
389
390 if (fnmatch(LONGITUDE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
391 {
392 *coordinate = (double) atof( strtok( input_string, "eEwW"));
393 }
394 else if (fnmatch(LONGITUDE_GLOB_DMS, input_string, FNM_EXTMATCH)==0)
395 {
396 *coordinate = (double) atof( strtok( input_string, "eEwW:'\""));
397 fractional_part = (double) atof( strtok( NULL, "eEwW:'\""))/60;
398 seconds = strtok( NULL, "eEwW:'\"");
399 if (seconds != NULL) fractional_part = fractional_part + (double) atof( seconds)/3600;
400 }
401
402 if (*coordinate > 0)
403 *coordinate = (*coordinate + fractional_part) * direction_modifier;
404 else
405 *coordinate = *coordinate - fractional_part;
406
407
408 if( (*coordinate > -180) && (*coordinate < 180) )
409 {
410 *opt_found = 1;
411 return FALSE; // error_detected = FALSE; ie. success
412 }
413 print_parm_error(N_("L (Longitude)"));
414 return TRUE; // error_detected = TRUE; ie failure
415 }
416
417 printf("INTERNAL ERROR: coordinate parse\n");
418 return TRUE; // error_detected = TRUE; ie failure
419 }
420
421 /************************************************************
422 * parse timezone
423 *
424 * presumes commandline options were parsed using getopt.
425 * timezone is returned in minutes, not hours
426 ************************************************************/
427 int parse_timezone( char *input_string, int *tz)
428 {
429 #define TIMEZONE_GLOB_DECIMAL "?([+-])?(1)[[:digit:]]?(.+([[:digit:]]))"
430 #define TIMEZONE_GLOB_DM "?([+-])?(1)[[:digit:]]?([:'\"]+([[:digit:]]))"
431
432 int fractional_part;
433
434 /************************************************************
435 * input_string should hold the value to parse
436 * It must exist and be numeric
437 * we don't want confuse it with the next option of for "-x"
438 ************************************************************/
439 if ((!input_string) ||
440 ( (fnmatch("-*",input_string,FNM_NOFLAG)==0) &&
441 (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)!=0) &&
442 (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)!=0) ) )
443 {
444 print_parm_missing_error(N_("z (time zone)"));
445 }
446 else
447 {
448 if (fnmatch(TIMEZONE_GLOB_DECIMAL, input_string, FNM_EXTMATCH)==0)
449 {
450 *tz = (int) ( atof (input_string) * 60 );
451 }
452 else if (fnmatch(TIMEZONE_GLOB_DM, input_string, FNM_EXTMATCH)==0)
453 {
454 *tz = atoi( strtok( input_string, ":'\"")) * 60;
455 fractional_part = atoi( strtok( NULL, ":'\""));
456 if (*tz < 0) *tz = *tz - fractional_part;
457 else *tz = *tz + fractional_part;
458 }
459
460 if( (*tz > -720) && (*tz < 720) ) // 720 minutes in 12 hours
461 {
462 return FALSE; // error_detected = FALSE; ie. success
463 }
464 else print_parm_error(N_("z (timezone)"));
465 }
466 return TRUE; // error_detected = TRUE; ie failure
467 }
468
469
470
471
472 /************************************************************
473 * validate location parameters - lat, lon, tz
474 ************************************************************/
475 // originally, this was only for hdate, now also for hcal
476 // originally, we did this only if we needed the information
477 // now, because of sunset-awareness, we always perform these checks
478 // if ( (opt.sun) || (opt.times) || (opt.candles) || (opt.havdalah) )
479 void validate_location( const int opt_latitude, const int opt_Longitude,
480 double *lat, double *lon,
481 int *tz, const int quiet_alerts, int error_detected,
482 void (*print_usage)() )
483 {
484
485 /* latitude and longitude must be paired */
486 if ( (opt_latitude) && (!opt_Longitude) )
487 {
488 error(0,0,"%s: %s", N_("error"), N_("valid longitude parameter missing for given latitude"));
489 error_detected = TRUE;
490 }
491 else if ( (opt_Longitude) && (!opt_latitude) )
492 {
493 error(0,0,"%s: %s", N_("error"), N_("valid latitude parameter missing for given longitude"));
494 error_detected = TRUE;
495 }
496
497
498 if (!error_detected)
499 {
500 // if no timezone entered, choose guess method
501 if (*tz==BAD_TIMEZONE)
502 {
503 // system timezone is in seconds, but we deal in minutes
504 tzset();
505 *tz = timezone /-60;
506
507 if ( (opt_latitude) && (opt_Longitude) && ( ((*lon/15)-(*tz/60)) > DELTA_LONGITUDE ) )
508 {
509 /* reject system local timezone, because it's
510 too far from the longitude explicitly provided
511 by the user; guess based on longitude entered */
512 *tz = (*lon /15) * 60;
513 }
514 if (!quiet_alerts) print_alert_timezone( *tz );
515 if ( (*lat==BAD_COORDINATE) && (*lon==BAD_COORDINATE) )
516 {
517 if (!quiet_alerts) print_alert_default_location( *tz );
518 set_default_location( *tz, lat, lon );
519 }
520 printf("\n");
521 }
522 else
523 { /* we have timezone, what about latitude and longitude? */
524 if ( (opt_Longitude) && (opt_latitude) )
525 {
526 // sanity-check longitude versus timezone
527 // timezone is in minutes
528 if ( abs( ( (*tz/60) * 15 ) - *lon ) > DELTA_LONGITUDE )
529 {
530 error(0,0,"%s %d:%d %s %.3f %s",
531 N_("time zone value of"), *tz/60, *tz%60,
532 N_("is incompatible with a longitude of"), *lon, N_("degrees"));
533 error_detected = TRUE;
534 }
535 }
536 else
537 {
538 if (!quiet_alerts) print_alert_default_location( *tz );
539 set_default_location( *tz, lat, lon );
540 printf("\n");
541 }
542 }
543 }
544
545 /* exit after reporting all bad parameters found */
546 if (error_detected)
547 {
548 print_usage();
549 exit(EXIT_CODE_BAD_PARMS);
550 }
551 }
552
553
554 /************************************************************
555 * check validity of date parameters
556 ************************************************************/
557 #define CHECK_DAY_PARM 1
558 #define CHECK_MONTH_PARM 2
559 #define CHECK_YEAR_PARM 3
560 int validate_hdate (int parameter_to_check, int day, int month, int year)
561 {
562 hdate_struct h;
563
564 if (year < 0) return FALSE;
565
566 switch (parameter_to_check)
567 {
568
569 case CHECK_DAY_PARM:
570
571 /************************************************************
572 * check day in Hebrew date
573 ************************************************************/
574 if (year > 3000)
575 {
576 if (year > 10999) return FALSE;
577 hdate_set_hdate (&h, 1, 1, year);
578 if ((day < 1) || (day > 30) ||
579 ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) ||
580 (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) ||
581 (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) )
582 return FALSE;
583 return TRUE;
584 }
585
586 /************************************************************
587 * check day in Gregorian date
588 ************************************************************/
589 else
590 {
591 if ((day < 1) ||
592 ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) ||
593 ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) ||
594 ((day > 29) && (month==2) && ((year%4)==0)) ||
595 ((day > 28) && (month==2) && ((year%4)!=0))
596 )
597 return FALSE;
598 return TRUE;
599 }
600 break;
601
602
603 case CHECK_MONTH_PARM:
604
605 /************************************************************
606 * check month in Hebrew date
607 ************************************************************/
608 if (year > 3000)
609 {
610 if (year > 10999) return FALSE;
611 if ((month <= 0) || (month > 14)) return FALSE;
612 hdate_set_hdate (&h, 1, 1, year);
613 if ((h.hd_size_of_year <365) && (month >12)) return FALSE;
614 return TRUE;
615 }
616
617 /************************************************************
618 * check month in Gregorian date
619 ************************************************************/
620 else
621 {
622 if ((month <= 0) || (month > 12)) return FALSE;
623 return TRUE;
624 }
625 break;
626
627 case CHECK_YEAR_PARM:
628 if (year > 10999) return FALSE;
629 return TRUE;
630 break;
631 }
632 return FALSE;
633 }
634
635 /************************************************************
636 * Greeting message to new version
637 ************************************************************/
638 void greetings_to_version_16()
639 {
640 error(0,0,"%s",N_("\
641 This seems to be to be your first time using this version.\n\
642 Please read the new documentation in the man page and config\n\
643 file. Attempting to create a config file ..."));
644 }
645
646
647 /************************************************************
648 * Open config file, or create one
649 * - returns filepointer or NULL
650 * - if file does not exist, attempt to create it
651 ************************************************************/
652 FILE* get_config_file( const char* config_dir_name,
653 const char* config_file_name,
654 const char* default_config_file_text )
655 {
656 size_t path_len;
657
658 char* config_home_path_name = "";
659 char* config_sub_path_name = "";
660
661 char* config_dir_path;
662 char* config_file_path;
663
664 FILE* config_file;
665
666 /************************************************************
667 * sub-function to get_config_file: create_config_file
668 ************************************************************/
669 void create_config_file()
670 {
671 config_file = fopen(config_file_path, "a");
672 if (config_file == NULL)
673 {
674 error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path);
675 return;
676 }
677 fprintf(config_file, "%s", default_config_file_text);
678 error(0,0,"%s: %s",N_("config file created"), config_file_path);
679 if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name);
680 }
681
682 /************************************************************
683 * sub-function to get_config_file: open_config_file
684 ************************************************************/
685 int open_config_file()
686 {
687 config_file = fopen(config_file_path, "r");
688 if (config_file == NULL)
689 {
690 if (errno != ENOENT) return FALSE;
691 // maybe replace all this with a single line asprintf()
692 path_len = strlen(config_home_path_name)
693 + strlen(config_sub_path_name)
694 + strlen(config_dir_name) +1;
695 if (path_len < 1) return FALSE;
696 config_dir_path = malloc(path_len);
697 if (config_dir_path == NULL)
698 {
699 error(0,errno,"%s",N_("memory allocation failure"));
700 return FALSE;
701 }
702 snprintf(config_dir_path, path_len, "%s%s%s",
703 config_home_path_name, config_sub_path_name,
704 config_dir_name);
705
706 if ((mkdir(config_dir_path, (mode_t) 0700) != 0) &&
707 (errno != EEXIST))
708 {
709 free(config_dir_path);
710 return FALSE;
711 }
712 greetings_to_version_16();
713 create_config_file();
714 free(config_dir_path);
715 return FALSE;
716 }
717 return TRUE;
718 }
719
720
721 /************************************************************
722 * main part of function get_config_file
723 ************************************************************/
724 config_home_path_name = getenv("XDG_CONFIG_HOME");
725 if (config_home_path_name == NULL)
726 {
727 config_home_path_name = getenv("HOME");
728 if (config_home_path_name == NULL)
729 {
730 struct passwd *passwdEnt = getpwuid(getuid());
731 config_home_path_name = passwdEnt->pw_dir;
732 if (config_home_path_name == NULL) return NULL;
733 }
734 config_sub_path_name = "/.config";
735 }
736
737 // maybe replace all this with a single line asprintf()
738 path_len = strlen(config_home_path_name) + strlen(config_sub_path_name)
739 + strlen(config_dir_name) + strlen(config_file_name) + 1;
740 if (path_len < 1) return NULL;
741 config_file_path = malloc(path_len);
742 if (config_file_path == NULL)
743 {
744 error(0,errno,"memory allocation failure");
745 return NULL;
746 }
747 snprintf(config_file_path, path_len, "%s%s%s%s",
748 config_home_path_name, config_sub_path_name,
749 config_dir_name, config_file_name);
750
751 if (open_config_file() == TRUE)
752 {
753 free(config_file_path);
754 return config_file;
755 }
756 else
757 free(config_file_path);
758 return NULL;
759 }
760
761
762
763
764 /**********************************************************************
765 * parse user's menu selection into options and their posibile
766 * arguments, which can then be parsed (processed really)
767 *
768 * menuptr points to the beginning of the menu entry string. This
769 * pointer should initially be set to NULL.
770 * menu_len is the length of the menu entry string
771 * menu_index is the current position of the parser within the string.
772 * This value should initially be set to 0.
773 * optptr is a pointer into which we put the location of option text
774 * to be parsed. This pointer should initially be set to NULL.
775 * optarg is a pointer to a possible argument to the option. This is a
776 * global variable defined by GNU getopt(), so it shouldn't be
777 * declared or passed.
778 * long_options is a pointer to a structure of type option, as defined
779 * by getopt_long()
780 * long_option_index is a pointer to position found in long_options, and
781 * simulates the similar value returned by getopt_long()
782 * error_detected is a pointer to an accumulator used to delay aborting
783 * the program until after ALL input syntax errors are reported.
784 *
785 * RETURN VALUES:
786 * -1 means the menu line string has been completely parsed.
787 * Otherwise, the return value should be the short option character
788 * found, or in the case of a long option found, 0.
789 * This should sound suspiciously similar to the return values issued
790 * by getopt_long().
791 ***********************************************************************/
792 int menu_item_parse(char* menuptr, size_t menu_len, int *menu_index,
793 char** optptr, char* short_options,
794 struct option *long_options, int *long_option_index,
795 int *error_detected)
796 {
797 int ahead_index;
798 char *ahead;
799
800 while ( (*menu_index < menu_len) &&
801 (menuptr[*menu_index] != '#') )
802 {
803 if (menuptr[*menu_index] == '-')
804 {
805 if ( ( (*menu_index+1) >= menu_len) ||
806 (menuptr[*menu_index+1] == '#') ) break;
807 else if (menuptr[*menu_index+1] == '-')
808 {
809 if ( ( (*menu_index+2) >= menu_len) ||
810 (menuptr[*menu_index+2] == '#') ) break;
811 *menu_index = *menu_index +2;
812
813 /**************************************************
814 * We have identified the beginning of what could
815 * be a long option string. We store a pointer to
816 * it in optptr and proceed to:
817 * find its endpoint
818 * terminate it with a null
819 * if it has an argument, store a pointer to
820 * it in optarg and terminate it with a null.
821 * Then we compare the optptr to our list of
822 * valid longoptions and pass the information
823 * to the option parser
824 *************************************************/
825 *optptr = &menuptr[*menu_index]; // ??
826 ahead = *optptr;
827 ahead_index = *menu_index;
828 while ( (ahead_index < menu_len) &&
829 (strchr(" =#",*ahead) == NULL) )
830 {
831 ahead_index++;
832 ahead++;
833 }
834 if (memcmp(ahead,"=",1)==0)
835 {
836 *ahead = '\0';
837 ahead++;
838 optarg = ahead;
839 ahead_index++;
840 while ( (ahead_index < menu_len) &&
841 (strchr(" #",*ahead) == NULL) )
842 {
843 ahead_index++;
844 ahead++;
845 }
846 }
847 if ((*ahead == '#' ) && ((ahead_index+1) < menu_len))
848 ahead[1] = '#';
849 *ahead = '\0';
850 *long_option_index = 0;
851 while ( (long_options[*long_option_index].name != 0) &&
852 (strcmp(long_options[*long_option_index].name, *optptr) != 0) )
853 *long_option_index = *long_option_index + 1;
854 if (long_options[*long_option_index].name == 0)
855 {
856 *error_detected = *error_detected + 1;
857 print_parm_invalid_error(*optptr);
858 }
859 else
860 {
861 *menu_index = ahead_index;
862 return long_options[*long_option_index].val;
863 }
864 }
865 else
866 {
867 *menu_index = *menu_index + 1;
868 /**************************************************
869 * parse a short option from a menu line
870 *************************************************/
871 if ((strchr(short_options, (int) menuptr[*menu_index]) == NULL) ||
872 (menuptr[*menu_index] == ':') )
873 {
874 *error_detected = *error_detected + 1;
875 print_parm_invalid_error(*optptr);
876 }
877 else
878 {
879 *optptr = &menuptr[*menu_index];
880 *long_option_index = -1;
881 if (strchr("lLz", (int) menuptr[*menu_index]) != NULL)
882 {
883 ahead_index = *menu_index+1;
884 while ( (ahead_index < menu_len) &&
885 (memcmp(&menuptr[ahead_index]," ",1)==0) ) ahead_index++;
886 optarg = &menuptr[ahead_index];
887 while ( (ahead_index < menu_len) &&
888 (memcmp(&menuptr[ahead_index]," ",1)) ) ahead_index++;
889 menuptr[ahead_index] = '\0';
890 *menu_index = ahead_index;
891 }
892 return **optptr;
893 }
894
895 }
896 }
897 *menu_index = *menu_index + 1;
898 }
899 return -1;
900 }
901
902
903 /**************************************************
904 * prompt user for menu selection
905 *************************************************/
906 int menu_select( char* menu_list[], int max_menu_items )
907 {
908 int i, j;
909
910 for (i=0; i< max_menu_items; i++)
911 {
912 if (menu_list[i] == NULL) break;
913 if (i==0) printf("\n%s:\n\n", N_("your custom menu options (from your config file)"));
914 printf(" %d: %s\n",i,menu_list[i]);
915 }
916 j = i;
917 if (i == 0)
918 {
919 error(0,0,N_("ALERT: -m (--menu) option specified, but no menu items in config file"));
920 return -1;
921 }
922 printf("\n%s: ",N_("enter your selection, or <return> to continue"));
923 i = getchar() - 48; // effectively converts valid values to integers
924 if ((i < 0) || (i >= j))
925 {
926 error(0,0,N_("menu selection received was out of bounds"));
927 return -1;
928 }
929 printf("\n");
930 return i;
931 }
0 /* libhdate - Hebrew calendar library
1 *
2 * Copyright (C) 1984-2003 Amos Shapir, 2004-2007 Yaacov Zamir <kzamir@walla.co.il>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <time.h>
19 #include <stdio.h>
20 #include <stdlib.h>
21
22 #include "hdate.h"
23 #include "support.h"
24
25 #define HOUR 1080
26 #define DAY (24*HOUR)
27 #define WEEK (7*DAY)
28 #define M(h,p) ((h)*HOUR+p)
29 #define MONTH (DAY+M(12,793)) /* Tikun for regular month */
30
31 /**
32 @brief Days since bet (?) Tishrey 3744
33
34 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
35
36 @param hebrew_year The Hebrew year
37 @return Number of days since 3,1,3744
38 */
39 int
40 hdate_days_from_3744 (int hebrew_year)
41 {
42 int years_from_3744;
43 int molad_3744;
44 int leap_months;
45 int leap_left;
46 int months;
47 int parts;
48 int days;
49 int parts_left_in_week;
50 int parts_left_in_day;
51 int week_day;
52
53 /* Start point for calculation is Molad new year 3744 (16BC) */
54 years_from_3744 = hebrew_year - 3744;
55 molad_3744 = M (1 + 6, 779); /* Molad 3744 + 6 hours in parts */
56
57 /* Time in months */
58 leap_months = (years_from_3744 * 7 + 1) / 19; /* Number of leap months */
59 leap_left = (years_from_3744 * 7 + 1) % 19; /* Months left of leap cycle */
60 months = years_from_3744 * 12 + leap_months; /* Total Number of months */
61
62 /* Time in parts and days */
63 parts = months * MONTH + molad_3744; /* Molad This year + Molad 3744 - corections */
64 days = months * 28 + parts / DAY - 2; /* 28 days in month + corections */
65
66 /* Time left for round date in corections */
67 parts_left_in_week = parts % WEEK; /* 28 % 7 = 0 so only corections counts */
68 parts_left_in_day = parts % DAY;
69 week_day = parts_left_in_week / DAY;
70
71 /* Special cases of Molad Zaken */
72 if ((leap_left < 12 && week_day == 3
73 && parts_left_in_day >= M (9 + 6, 204)) ||
74 (leap_left < 7 && week_day == 2
75 && parts_left_in_day >= M (15 + 6, 589)))
76 {
77 days++, week_day++;
78 }
79
80 /* ADU */
81 if (week_day == 1 || week_day == 4 || week_day == 6)
82 {
83 days++;
84 }
85
86 return days;
87 }
88
89 /**
90 @brief Size of Hebrew year in days
91
92 @param hebrew_year The Hebrew year
93 @return Size of Hebrew year
94 */
95 int
96 hdate_get_size_of_hebrew_year (int hebrew_year)
97 {
98 return hdate_days_from_3744 (hebrew_year + 1) -
99 hdate_days_from_3744 (hebrew_year);
100 }
101
102 /**
103 @brief Return Hebrew year type based on size and first week day of year.
104
105 year type | year length | Tishery 1 day of week
106 | 1 | 353 | 2
107 | 2 | 353 | 7
108 | 3 | 354 | 3
109 | 4 | 354 | 5
110 | 5 | 355 | 2
111 | 6 | 355 | 5
112 | 7 | 355 | 7
113 | 8 | 383 | 2
114 | 9 | 383 | 5
115 |10 | 383 | 7
116 |11 | 384 | 3
117 |12 | 385 | 2
118 |13 | 385 | 5
119 |14 | 385 | 7
120
121 @param size_of_year Length of year in days
122 @param new_year_dw First week day of year
123 @return A number for year type (1..14)
124 */
125 int
126 hdate_get_year_type (int size_of_year, int new_year_dw)
127 {
128 /* Only 14 combinations of size and week day are posible */
129 static int year_types[24] =
130 {1, 0, 0, 2, 0, 3, 4, 0, 5, 0, 6, 7,
131 8, 0, 9, 10, 0, 11, 0, 0, 12, 0, 13, 14};
132
133 int offset;
134
135 /* convert size and first day to 1..24 number */
136 /* 2,3,5,7 -> 1,2,3,4 */
137 /* 353, 354, 355, 383, 384, 385 -> 0, 1, 2, 3, 4, 5 */
138 offset = (new_year_dw + 1) / 2;
139 offset = offset + 4 * ((size_of_year % 10 - 3) + (size_of_year / 10 - 35));
140
141 /* some combinations are imposible */
142 return year_types[offset - 1];
143 }
144
145 /**
146 @brief Compute Julian day from Gregorian day, month and year
147 Algorithm from the wikipedia's julian_day
148
149 @author Yaacov Zamir
150
151 @param day Day of month 1..31
152 @param month Month 1..12
153 @param year Year in 4 digits e.g. 2001
154 @return The julian day number
155 */
156 int
157 hdate_gdate_to_jd (int day, int month, int year)
158 {
159 int a;
160 int y;
161 int m;
162 int jdn;
163
164 a = (14 - month) / 12;
165 y = year + 4800 - a;
166 m = month + 12 * a - 3;
167
168 jdn = day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045;
169
170 return jdn;
171 }
172
173 /**
174 @brief Compute Julian day from Hebrew day, month and year
175
176 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
177
178 @param day Day of month 1..31
179 @param month Month 1..14 (13 - Adar 1, 14 - Adar 2)
180 @param year Hebrew year in 4 digits e.g. 5753
181 @return The julian day number
182 */
183 int
184 hdate_hdate_to_jd (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year)
185 {
186 int length_of_year;
187 int jd;
188 int days_from_3744;
189
190 /* Adjust for leap year */
191 if (month == 13)
192 {
193 month = 6;
194 }
195 if (month == 14)
196 {
197 month = 6;
198 day += 30;
199 }
200
201 /* Calculate days since 1,1,3744 */
202 days_from_3744 = hdate_days_from_3744 (year);
203 day = days_from_3744 + (59 * (month - 1) + 1) / 2 + day;
204
205 /* length of year */
206 length_of_year = hdate_days_from_3744 (year + 1) - days_from_3744;
207
208 /* Special cases for this year */
209 if (length_of_year % 10 > 4 && month > 2) /* long Heshvan */
210 day++;
211 if (length_of_year % 10 < 4 && month > 3) /* short Kislev */
212 day--;
213 if (length_of_year > 365 && month > 6) /* leap year */
214 day += 30;
215
216 /* adjust to julian */
217 jd = day + 1715118;
218
219 /* return the 1 of tishrey julians */
220 if (jd_tishrey1 && jd_tishrey1_next_year)
221 {
222 *jd_tishrey1 = days_from_3744 + 1715119;
223 *jd_tishrey1_next_year = *jd_tishrey1 + length_of_year;
224 }
225
226 return jd;
227 }
228
229 /**
230 @brief Converting from the Julian day to the Gregorian day
231 Algorithm from 'Julian and Gregorian Day Numbers' by Peter Meyer
232
233 @author Yaacov Zamir ( Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968)
234
235 @param jd Julian day
236 @param d Return Day of month 1..31
237 @param m Return Month 1..12
238 @param y Return Year in 4 digits e.g. 2001
239 */
240 void
241 hdate_jd_to_gdate (int jd, int *d, int *m, int *y)
242 {
243 int l, n, i, j;
244 l = jd + 68569;
245 n = (4 * l) / 146097;
246 l = l - (146097 * n + 3) / 4;
247 i = (4000 * (l + 1)) / 1461001; /* that's 1,461,001 */
248 l = l - (1461 * i) / 4 + 31;
249 j = (80 * l) / 2447;
250 *d = l - (2447 * j) / 80;
251 l = j / 11;
252 *m = j + 2 - (12 * l);
253 *y = 100 * (n - 49) + i + l; /* that's a lower-case L */
254
255 return;
256 }
257
258 /**
259 @brief Converting from the Julian day to the Hebrew day
260
261 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2008
262
263 @param jd Julian day
264 @param day Return Day of month 1..31
265 @param month Return Month 1..14 (13 - Adar 1, 14 - Adar 2)
266 @param year Return Year in 4 digits e.g. 2001
267 */
268 void
269 hdate_jd_to_hdate (int jd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)
270 {
271 int days;
272 int size_of_year;
273 int internal_jd_tishrey1, internal_jd_tishrey1_next_year;
274
275 /* calculate Gregorian date */
276 hdate_jd_to_gdate (jd, day, month, year);
277
278 /* Guess Hebrew year is Gregorian year + 3760 */
279 *year = *year + 3760;
280
281 internal_jd_tishrey1 = hdate_days_from_3744 (*year) + 1715119;
282 internal_jd_tishrey1_next_year = hdate_days_from_3744 (*year + 1) + 1715119;
283
284 /* Check if computed year was underestimated */
285 if (internal_jd_tishrey1_next_year <= jd)
286 {
287 *year = *year + 1;
288 internal_jd_tishrey1 = internal_jd_tishrey1_next_year;
289 internal_jd_tishrey1_next_year = hdate_days_from_3744 (*year + 1) + 1715119;
290 }
291
292 size_of_year = internal_jd_tishrey1_next_year - internal_jd_tishrey1;
293
294 /* days into this year, first month 0..29 */
295 days = jd - internal_jd_tishrey1;
296
297 /* last 8 months allways have 236 days */
298 if (days >= (size_of_year - 236)) /* in last 8 months */
299 {
300 days = days - (size_of_year - 236);
301 *month = days * 2 / 59;
302 *day = days - (*month * 59 + 1) / 2 + 1;
303
304 *month = *month + 4 + 1;
305
306 /* if leap */
307 if (size_of_year > 355 && *month <=6)
308 *month = *month + 8;
309 }
310 else /* in 4-5 first months */
311 {
312 /* Special cases for this year */
313 if (size_of_year % 10 > 4 && days == 59) /* long Heshvan (day 30 of Heshvan) */
314 {
315 *month = 1;
316 *day = 30;
317 }
318 else if (size_of_year % 10 > 4 && days > 59) /* long Heshvan */
319 {
320 *month = (days - 1) * 2 / 59;
321 *day = days - (*month * 59 + 1) / 2;
322 }
323 else if (size_of_year % 10 < 4 && days > 87) /* short kislev */
324 {
325 *month = (days + 1) * 2 / 59;
326 *day = days - (*month * 59 + 1) / 2 + 2;
327 }
328 else /* regular months */
329 {
330 *month = days * 2 / 59;
331 *day = days - (*month * 59 + 1) / 2 + 1;
332 }
333
334 *month = *month + 1;
335 }
336
337 /* return the 1 of tishrey julians */
338 if (jd_tishrey1 && jd_tishrey1_next_year)
339 {
340 *jd_tishrey1 = internal_jd_tishrey1;
341 *jd_tishrey1_next_year = internal_jd_tishrey1_next_year;
342 }
343
344 return;
345 }
346
347 /********************************************************************************/
348 /********************************************************************************/
349
350 /**
351 @brief compute date structure from the Gregorian date
352
353 @param d Day of month 1..31
354 @param m Month 1..12 , if m or d is 0 return current date.
355 @param y Year in 4 digits e.g. 2001
356 */
357 hdate_struct *
358 hdate_set_gdate (hdate_struct * h, int d, int m, int y)
359 {
360 int jd;
361 int jd_tishrey1, jd_tishrey1_next_year;
362
363 if (!h) return NULL;
364
365 /* check for null dates (kobi) */
366 if ((d == 0) || (m == 0))
367 {
368 struct tm *tm;
369 long t;
370 /* FIXME: day start at 6:00 or 12:00 like in Gregorian cal. ? */
371 t = time (0);
372 tm = localtime (&t);
373 d = tm->tm_mday;
374 m = tm->tm_mon + 1;
375 y = tm->tm_year + 1900;
376 }
377
378 h->gd_day = d;
379 h->gd_mon = m;
380 h->gd_year = y;
381
382 jd = hdate_gdate_to_jd (d, m, y);
383 hdate_jd_to_hdate (jd, &(h->hd_day), &(h->hd_mon), &(h->hd_year), &jd_tishrey1, &jd_tishrey1_next_year);
384
385 h->hd_dw = (jd + 1) % 7 + 1;
386 h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1;
387 h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1;
388 h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw);
389 h->hd_jd = jd;
390 h->hd_days = jd - jd_tishrey1 + 1;
391 h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1;
392
393 return (h);
394 }
395
396 /**
397 @brief compute date structure from the Hebrew date
398
399 @param d Day of month 1..31
400 @param m Month 1..14 , if m or d is 0 return current date.
401 @param y Year in 4 digits e.g. 5731
402 */
403 hdate_struct *
404 hdate_set_hdate (hdate_struct * h, int d, int m, int y)
405 {
406 int jd;
407 int jd_tishrey1, jd_tishrey1_next_year;
408
409 if (!h) return NULL;
410
411 h->hd_day = d;
412 h->hd_mon = m;
413 h->hd_year = y;
414
415 jd = hdate_hdate_to_jd (d, m, y, &jd_tishrey1, &jd_tishrey1_next_year);
416 hdate_jd_to_gdate (jd, &(h->gd_day), &(h->gd_mon), &(h->gd_year));
417
418 h->hd_dw = (jd + 1) % 7 + 1;
419 h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1;
420 h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1;
421 h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw);
422 h->hd_jd = jd;
423 h->hd_days = jd - jd_tishrey1 + 1;
424 h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1;
425
426 return (h);
427 }
428
429 /**
430 @brief compute date structure from julian day
431
432 @param jd the julian day number.
433 */
434 hdate_struct *
435 hdate_set_jd (hdate_struct * h, int jd)
436 {
437 int jd_tishrey1, jd_tishrey1_next_year;
438
439 if (!h) return NULL;
440
441 hdate_jd_to_gdate (jd, &(h->gd_day), &(h->gd_mon), &(h->gd_year));
442 hdate_jd_to_hdate (jd, &(h->hd_day), &(h->hd_mon), &(h->hd_year), &jd_tishrey1, &jd_tishrey1_next_year);
443
444 h->hd_dw = (jd + 1) % 7 + 1;
445 h->hd_size_of_year = jd_tishrey1_next_year - jd_tishrey1;
446 h->hd_new_year_dw = (jd_tishrey1 + 1) % 7 + 1;
447 h->hd_year_type = hdate_get_year_type (h->hd_size_of_year , h->hd_new_year_dw);
448 h->hd_jd = jd;
449 h->hd_days = jd - jd_tishrey1 + 1;
450 h->hd_weeks = ((h->hd_days - 1) + (h->hd_new_year_dw - 1)) / 7 + 1;
451
452 return (h);
453 }
454
455 /********************************************************************************/
456 /********************************************************************************/
457
458 /**
459 @brief get the Gregorian day of the month
460
461 @param h pointer this hdate struct.
462 @return the Gregorian day of the month, 1..31.
463 */
464 int
465 hdate_get_gday (hdate_struct const * h)
466 {
467 return h->gd_day;
468 }
469
470 /**
471 @brief get the Gregorian month
472
473 @param h pointer this hdate struct.
474 @return the Gregorian month, jan = 1.
475 */
476 int
477 hdate_get_gmonth (hdate_struct const * h)
478 {
479 return h->gd_mon;
480 }
481
482 /**
483 @brief get the Gregorian year
484
485 @param h pointer this hdate struct.
486 @return the Gregorian year.
487 */
488 int
489 hdate_get_gyear (hdate_struct const * h)
490 {
491 return h->gd_year;
492 }
493
494 /**
495 @brief get the Hebrew day of the month
496
497 @param h pointer this hdate struct.
498 @return the Hebrew day of the month, 1..30.
499 */
500 int
501 hdate_get_hday (hdate_struct const * h)
502 {
503 return h->hd_day;
504 }
505
506 /**
507 @brief get the Hebrew month
508
509 @param h pointer this hdate struct.
510 @return the Hebrew month, Tishery = 1 .. Adar I =13, Adar II = 14.
511 */
512 int
513 hdate_get_hmonth (hdate_struct const * h)
514 {
515 return h->hd_mon;
516 }
517
518 /**
519 @brief get the Hebrew year
520
521 @param h pointer this hdate struct.
522 @return the Hebrew year.
523 */
524 int
525 hdate_get_hyear (hdate_struct const * h)
526 {
527 return h->hd_year;
528 }
529
530 /**
531 @brief get the day of the week
532
533 @param h pointer this hdate struct.
534 @return the the day of the week.
535 */
536 int
537 hdate_get_day_of_the_week (hdate_struct const * h)
538 {
539 return h->hd_dw;
540 }
541
542 /**
543 @brief get the size of the hebrew year
544
545 @param h pointer this hdate struct.
546 @return the the size of the hebrew year.
547 */
548 int
549 hdate_get_size_of_year (hdate_struct const * h)
550 {
551 return h->hd_size_of_year;
552 }
553
554 /**
555 @brief get the new year day of the week
556
557 @param h pointer this hdate struct.
558 @return the the new year day of the week.
559 */
560 int
561 hdate_get_new_year_day_of_the_week (hdate_struct const * h)
562 {
563 return h->hd_new_year_dw;
564 }
565
566 /**
567 @brief get the Julian day number
568
569 @param h pointer this hdate struct.
570 @return the Julian day number.
571 */
572 int
573 hdate_get_julian (hdate_struct const * h)
574 {
575 return h->hd_jd;
576 }
577
578 /**
579 @brief get the number of days passed since 1 tishrey
580
581 @param h pointer this hdate struct.
582 @return the number of days passed since 1 tishrey.
583 */
584 int
585 hdate_get_days (hdate_struct const * h)
586 {
587 return h->hd_days;
588 }
589
590 /**
591 @brief get the number of weeks passed since 1 tishrey
592
593 @param h pointer this hdate struct.
594 @return the number of weeks passed since 1 tishrey.
595 */
596 int
597 hdate_get_weeks (hdate_struct const * h)
598 {
599 return h->hd_weeks;
600 }
601
602 /********************************************************************************/
603 /********************************************************************************/
604
605 /**
606 @brief creat a new hdate struct object, must be deleted using delete_hdate.
607
608 @return a new hdate object
609 */
610 hdate_struct *
611 new_hdate ()
612 {
613 /* allocate memory for a new hdate object */
614 hdate_struct *h = (hdate_struct *) malloc (sizeof (hdate_struct));
615
616 /* check for out of memory */
617 if (!h)
618 return NULL;
619
620 /* get todays date */
621 hdate_set_gdate (h, 0, 0, 0);
622
623 return h;
624 }
625
626 /**
627 @brief delete an hdate struct object.
628
629 @param h pointer this hdate struct.
630 */
631 hdate_struct *
632 delete_hdate (hdate_struct *h)
633 {
634 /* if h exist delete it */
635 if (h)
636 {
637 free (h);
638 h = NULL;
639 }
640
641 return h;
642 }
643
0 .TH "src/hdate.h" 3 "Sun Jan 8 2012" "Version 1.4" "libhdate C language" \" -*- nroff -*-
1 .ad l
2 .nh
3 .SH NAME
4 src/hdate.h \-
5 .PP
6 libhdate C language header\&.
7
8 .SH SYNOPSIS
9 .br
10 .PP
11 .SS "Data Structures"
12
13 .in +1c
14 .ti -1c
15 .RI "struct \fBhdate_struct\fP"
16 .br
17 .RI "\fIlibhdate Hebrew date struct \fP"
18 .in -1c
19 .SS "Defines"
20
21 .in +1c
22 .ti -1c
23 .RI "#define \fBHDATE_DIASPORA_FLAG\fP -1"
24 .br
25 .RI "\fIuse diaspora dates and holydays flag \fP"
26 .ti -1c
27 .RI "#define \fBHDATE_ISRAEL_FLAG\fP 0"
28 .br
29 .RI "\fIuse israel dates and holydays flag \fP"
30 .ti -1c
31 .RI "#define \fBHDATE_SHORT_FLAG\fP -1"
32 .br
33 .RI "\fIuse short strings flag \fP"
34 .ti -1c
35 .RI "#define \fBHDATE_LONG_FLAG\fP 0"
36 .br
37 .RI "\fIuse long strings flag \fP"
38 .ti -1c
39 .RI "#define \fBHEBREW_NUMBER_BUFFER_SIZE\fP 17"
40 .br
41 .RI "\fIfor hdate_get_int_string_ and hdate_get_int_wstring \fP"
42 .ti -1c
43 .RI "#define \fBHEBREW_WNUMBER_BUFFER_SIZE\fP 9"
44 .br
45 .ti -1c
46 .RI "#define \fBHDATE_STRING_INT\fP 0"
47 .br
48 .RI "\fIfor function hdate_string: identifies string type: integer \fP"
49 .ti -1c
50 .RI "#define \fBHDATE_STRING_DOW\fP 1"
51 .br
52 .RI "\fIfor function hdate_string: identifies string type: day of week \fP"
53 .ti -1c
54 .RI "#define \fBHDATE_STRING_PARASHA\fP 2"
55 .br
56 .RI "\fIfor function hdate_string: identifies string type: parasha \fP"
57 .ti -1c
58 .RI "#define \fBHDATE_STRING_HMONTH\fP 3"
59 .br
60 .RI "\fIfor function hdate_string: identifies string type: hebrew_month \fP"
61 .ti -1c
62 .RI "#define \fBHDATE_STRING_GMONTH\fP 4"
63 .br
64 .RI "\fIfor function hdate_string: identifies string type: gregorian_month \fP"
65 .ti -1c
66 .RI "#define \fBHDATE_STRING_HOLIDAY\fP 5"
67 .br
68 .RI "\fIfor function hdate_string: identifies string type: holiday \fP"
69 .ti -1c
70 .RI "#define \fBHDATE_STRING_OMER\fP 6"
71 .br
72 .ti -1c
73 .RI "#define \fBHDATE_STRING_SHORT\fP 1"
74 .br
75 .RI "\fIfor function hdate_string: use short form, if one exists \fP"
76 .ti -1c
77 .RI "#define \fBHDATE_STRING_LONG\fP 0"
78 .br
79 .RI "\fIfor function hdate_string: use long form \fP"
80 .ti -1c
81 .RI "#define \fBHDATE_STRING_HEBREW\fP 1"
82 .br
83 .RI "\fIfor function hdate_string: use embedded hebrew string \fP"
84 .ti -1c
85 .RI "#define \fBHDATE_STRING_LOCAL\fP 0"
86 .br
87 .RI "\fIfor function hdate_string: use local locale string \fP"
88 .in -1c
89 .SS "Functions"
90
91 .in +1c
92 .ti -1c
93 .RI "\fBhdate_struct\fP * \fBhdate_set_gdate\fP (\fBhdate_struct\fP *h, int d, int m, int y)"
94 .br
95 .RI "\fIcompute date structure from the Gregorian date \fP"
96 .ti -1c
97 .RI "\fBhdate_struct\fP * \fBhdate_set_hdate\fP (\fBhdate_struct\fP *h, int d, int m, int y)"
98 .br
99 .RI "\fIcompute date structure from the Hebrew date \fP"
100 .ti -1c
101 .RI "\fBhdate_struct\fP * \fBhdate_set_jd\fP (\fBhdate_struct\fP *h, int jd)"
102 .br
103 .RI "\fIcompute date structure from the Julian day \fP"
104 .ti -1c
105 .RI "char * \fBhdate_get_format_date\fP (\fBhdate_struct\fP const *h, int diaspora, int s)"
106 .br
107 .RI "\fIReturn a string, with the hebrew date\&. \fP"
108 .ti -1c
109 .RI "int \fBhdate_get_parasha\fP (\fBhdate_struct\fP const *h, int diaspora)"
110 .br
111 .RI "\fIget the number of hebrew parasha\&. \fP"
112 .ti -1c
113 .RI "int \fBhdate_get_holyday\fP (\fBhdate_struct\fP const *h, int diaspora)"
114 .br
115 .RI "\fIget the number of hebrew holiday\&. \fP"
116 .ti -1c
117 .RI "char * \fBhdate_get_int_string\fP (int n)"
118 .br
119 .RI "\fIconvert an integer to hebrew string\&. \fP"
120 .ti -1c
121 .RI "char * \fBhdate_get_day_string\fP (int day, int s)"
122 .br
123 .RI "\fIReturn a static string, with name of week day\&. \fP"
124 .ti -1c
125 .RI "char * \fBhdate_get_month_string\fP (int month, int s)"
126 .br
127 .RI "\fIReturn a static string, with name of month\&. \fP"
128 .ti -1c
129 .RI "char * \fBhdate_get_hebrew_month_string\fP (int month, int s)"
130 .br
131 .RI "\fIReturn a static string, with name of hebrew month\&. \fP"
132 .ti -1c
133 .RI "char * \fBhdate_get_holyday_string\fP (int holyday, int s)"
134 .br
135 .RI "\fIName of hebrew holiday\&. \fP"
136 .ti -1c
137 .RI "char * \fBhdate_get_parasha_string\fP (int parasha, int s)"
138 .br
139 .RI "\fIName of Parasha\&. \fP"
140 .ti -1c
141 .RI "char * \fBhdate_get_omer_string\fP (int omer_day)"
142 .br
143 .RI "\fIReturn a static string, with the day in the omer\&. \fP"
144 .ti -1c
145 .RI "int \fBhdate_get_omer_day\fP (\fBhdate_struct\fP const *h)"
146 .br
147 .RI "\fIReturn the day in the omer of the given date\&. \fP"
148 .ti -1c
149 .RI "int \fBhdate_get_holyday_type\fP (int holyday)"
150 .br
151 .RI "\fIReturn number of hebrew holyday type\&. \fP"
152 .ti -1c
153 .RI "int \fBhdate_get_size_of_hebrew_year\fP (int hebrew_year)"
154 .br
155 .RI "\fIsize of hebrew year in days\&. \fP"
156 .ti -1c
157 .RI "int \fBhdate_days_from_3744\fP (int hebrew_year)"
158 .br
159 .RI "\fIDays since Tishrey 3744\&. \fP"
160 .ti -1c
161 .RI "int \fBhdate_get_year_type\fP (int size_of_year, int new_year_dw)"
162 .br
163 .RI "\fIReturn Hebrew year type based on size and first week day of year\&. \fP"
164 .ti -1c
165 .RI "int \fBhdate_gdate_to_jd\fP (int day, int month, int year)"
166 .br
167 .RI "\fICompute Julian day from Gregorian date\&. \fP"
168 .ti -1c
169 .RI "int \fBhdate_hdate_to_jd\fP (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year)"
170 .br
171 .RI "\fICompute Julian day from Hebrew day, month and year\&. \fP"
172 .ti -1c
173 .RI "void \fBhdate_jd_to_gdate\fP (int jd, int *day, int *month, int *year)"
174 .br
175 .RI "\fIConverting from the Julian day to the Gregorian date\&. \fP"
176 .ti -1c
177 .RI "void \fBhdate_jd_to_hdate\fP (int jd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)"
178 .br
179 .RI "\fIConverting from the Julian day to the Hebrew day\&. \fP"
180 .ti -1c
181 .RI "int \fBhdate_get_day_of_year\fP (int day, int month, int year)"
182 .br
183 .RI "\fIdays from 1 january \fP"
184 .ti -1c
185 .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)"
186 .br
187 .RI "\fIutc sun times for altitude at a gregorian date \fP"
188 .ti -1c
189 .RI "void \fBhdate_get_utc_sun_time\fP (int day, int month, int year, double latitude, double longitude, int *sunrise, int *sunset)"
190 .br
191 .RI "\fIutc sunrise/set time for a gregorian date \fP"
192 .ti -1c
193 .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)"
194 .br
195 .RI "\fIutc sunrise/set time for a gregorian date \fP"
196 .ti -1c
197 .RI "int \fBhdate_get_gday\fP (\fBhdate_struct\fP const *h)"
198 .br
199 .RI "\fIget the Gregorian day of the month \fP"
200 .ti -1c
201 .RI "int \fBhdate_get_gmonth\fP (\fBhdate_struct\fP const *h)"
202 .br
203 .RI "\fIget the Gregorian month \fP"
204 .ti -1c
205 .RI "int \fBhdate_get_gyear\fP (\fBhdate_struct\fP const *h)"
206 .br
207 .RI "\fIget the Gregorian year \fP"
208 .ti -1c
209 .RI "int \fBhdate_get_hday\fP (\fBhdate_struct\fP const *h)"
210 .br
211 .RI "\fIget the Hebrew day of the month \fP"
212 .ti -1c
213 .RI "int \fBhdate_get_hmonth\fP (\fBhdate_struct\fP const *h)"
214 .br
215 .RI "\fIget the Hebrew month \fP"
216 .ti -1c
217 .RI "int \fBhdate_get_hyear\fP (\fBhdate_struct\fP const *h)"
218 .br
219 .RI "\fIget the Hebrew year \fP"
220 .ti -1c
221 .RI "int \fBhdate_get_day_of_the_week\fP (\fBhdate_struct\fP const *h)"
222 .br
223 .RI "\fIget the day of the week \fP"
224 .ti -1c
225 .RI "int \fBhdate_get_size_of_year\fP (\fBhdate_struct\fP const *h)"
226 .br
227 .RI "\fIget the size of the hebrew year \fP"
228 .ti -1c
229 .RI "int \fBhdate_get_new_year_day_of_the_week\fP (\fBhdate_struct\fP const *h)"
230 .br
231 .RI "\fIget the new year day of the week \fP"
232 .ti -1c
233 .RI "int \fBhdate_get_julian\fP (\fBhdate_struct\fP const *h)"
234 .br
235 .RI "\fIget the Julian day number \fP"
236 .ti -1c
237 .RI "int \fBhdate_get_days\fP (\fBhdate_struct\fP const *h)"
238 .br
239 .RI "\fIget the number of days passed since 1 tishrey \fP"
240 .ti -1c
241 .RI "int \fBhdate_get_weeks\fP (\fBhdate_struct\fP const *h)"
242 .br
243 .RI "\fIget the number of weeks passed since 1 tishrey \fP"
244 .ti -1c
245 .RI "\fBhdate_struct\fP * \fBnew_hdate\fP ()"
246 .br
247 .RI "\fIcreat a new hdate struct object, must be deleted using delete_hdate\&. \fP"
248 .ti -1c
249 .RI "\fBhdate_struct\fP * \fBdelete_hdate\fP (\fBhdate_struct\fP *h)"
250 .br
251 .RI "\fIdelete an hdate struct object\&. \fP"
252 .ti -1c
253 .RI "char * \fBhdate_get_version_string\fP ()"
254 .br
255 .RI "\fIReturn a static string, with the package name and version\&. \fP"
256 .ti -1c
257 .RI "char * \fBhdate_get_translator_string\fP ()"
258 .br
259 .RI "\fIname of translator \fP"
260 .ti -1c
261 .RI "int \fBhdate_is_hebrew_locale\fP ()"
262 .br
263 .RI "\fIhelper function to find hebrew locale \fP"
264 .ti -1c
265 .RI "char * \fBhdate_string\fP (int type_of_string, int index, int short_form, int hebrew_form)"
266 .br
267 .RI "\fIReturn string values for hdate information\&. \fP"
268 .in -1c
269 .SH "Detailed Description"
270 .PP
271 libhdate C language header\&.
272
273 libhdate - Hebrew calendar library, the C language header file\&.
274 .SH "Define Documentation"
275 .PP
276 .SS "#define \fBHDATE_DIASPORA_FLAG\fP -1"
277 .PP
278 use diaspora dates and holydays flag
279 .SS "#define \fBHDATE_ISRAEL_FLAG\fP 0"
280 .PP
281 use israel dates and holydays flag
282 .SS "#define \fBHDATE_SHORT_FLAG\fP -1"
283 .PP
284 use short strings flag
285 .SS "#define \fBHDATE_LONG_FLAG\fP 0"
286 .PP
287 use long strings flag
288 .SS "#define \fBHEBREW_NUMBER_BUFFER_SIZE\fP 17"
289 .PP
290 for hdate_get_int_string_ and hdate_get_int_wstring \fBNote:\fP
291 .RS 4
292 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\&.\&.\&.
293 .RE
294 .PP
295
296 .SS "#define \fBHEBREW_WNUMBER_BUFFER_SIZE\fP 9"
297 .SS "#define \fBHDATE_STRING_INT\fP 0"
298 .PP
299 for function hdate_string: identifies string type: integer
300 .SS "#define \fBHDATE_STRING_DOW\fP 1"
301 .PP
302 for function hdate_string: identifies string type: day of week
303 .SS "#define \fBHDATE_STRING_PARASHA\fP 2"
304 .PP
305 for function hdate_string: identifies string type: parasha
306 .SS "#define \fBHDATE_STRING_HMONTH\fP 3"
307 .PP
308 for function hdate_string: identifies string type: hebrew_month
309 .SS "#define \fBHDATE_STRING_GMONTH\fP 4"
310 .PP
311 for function hdate_string: identifies string type: gregorian_month
312 .SS "#define \fBHDATE_STRING_HOLIDAY\fP 5"
313 .PP
314 for function hdate_string: identifies string type: holiday
315 .SS "#define \fBHDATE_STRING_OMER\fP 6"
316 .SS "#define \fBHDATE_STRING_SHORT\fP 1"
317 .PP
318 for function hdate_string: use short form, if one exists
319 .SS "#define \fBHDATE_STRING_LONG\fP 0"
320 .PP
321 for function hdate_string: use long form
322 .SS "#define \fBHDATE_STRING_HEBREW\fP 1"
323 .PP
324 for function hdate_string: use embedded hebrew string
325 .SS "#define \fBHDATE_STRING_LOCAL\fP 0"
326 .PP
327 for function hdate_string: use local locale string
328 .SH "Function Documentation"
329 .PP
330 .SS "\fBhdate_struct\fP* \fBhdate_set_gdate\fP (\fBhdate_struct\fP *h, intd, intm, inty)"
331 .PP
332 compute date structure from the Gregorian date \fBParameters:\fP
333 .RS 4
334 \fIh\fP pointer this hdate struct\&.
335 .br
336 \fId\fP Day of month 1\&.\&.31
337 .br
338 \fIm\fP Month 1\&.\&.12 if m or d is 0 return current date\&.
339 .br
340 \fIy\fP Year in 4 digits e\&.g\&. 2001
341 .RE
342 .PP
343 \fBReturns:\fP
344 .RS 4
345 pointer to this hdate struct
346 .RE
347 .PP
348
349 .SS "\fBhdate_struct\fP* \fBhdate_set_hdate\fP (\fBhdate_struct\fP *h, intd, intm, inty)"
350 .PP
351 compute date structure from the Hebrew date \fBParameters:\fP
352 .RS 4
353 \fIh\fP pointer this hdate struct\&.
354 .br
355 \fId\fP Day of month 1\&.\&.31
356 .br
357 \fIm\fP Month 1\&.\&.14 ,(13 - Adar 1, 14 - Adar 2) if m or d is 0 return current date\&.
358 .br
359 \fIy\fP Year in 4 digits e\&.g\&. 5731
360 .RE
361 .PP
362 \fBReturns:\fP
363 .RS 4
364 pointer to this hdate struct
365 .RE
366 .PP
367
368 .SS "\fBhdate_struct\fP* \fBhdate_set_jd\fP (\fBhdate_struct\fP *h, intjd)"
369 .PP
370 compute date structure from the Julian day \fBParameters:\fP
371 .RS 4
372 \fIh\fP pointer this hdate struct\&.
373 .br
374 \fIjd\fP the julian day number\&.
375 .RE
376 .PP
377 \fBReturns:\fP
378 .RS 4
379 pointer to this hdate struct
380 .RE
381 .PP
382
383 .SS "char* \fBhdate_get_format_date\fP (\fBhdate_struct\fP const *h, intdiaspora, ints)"
384 .PP
385 Return a string, with the hebrew date\&. \fBReturns:\fP
386 .RS 4
387 NULL pointer upon failure or, upon success, a pointer to a string containing the short ( e\&.g\&. '1 Tishrey' ) or long (e\&.g\&. 'Tuesday
388 18 Tishrey 5763 Hol hamoed Sukot' ) formated date\&. You must free() the pointer after use\&.
389 .RE
390 .PP
391 \fBParameters:\fP
392 .RS 4
393 \fIh\fP The \fBhdate_struct\fP of the date to print\&.
394 .br
395 \fIdiaspora\fP if true give diaspora holydays
396 .br
397 \fIshort_format\fP A short flag (true - returns a short string, false returns a long string)\&.
398 .RE
399 .PP
400 \fBWarning:\fP
401 .RS 4
402 This was originally written using a local static string, calling for output to be copied away\&.
403 .RE
404 .PP
405
406 .SS "int \fBhdate_get_parasha\fP (\fBhdate_struct\fP const *h, intdiaspora)"
407 .PP
408 get the number of hebrew parasha\&. \fBParameters:\fP
409 .RS 4
410 \fIh\fP pointer this hdate struct\&.
411 .br
412 \fIdiaspora\fP if true give diaspora readings
413 .RE
414 .PP
415 \fBReturns:\fP
416 .RS 4
417 the number of parasha 1\&. Bereshit etc\&.\&. (55 through 61 are joined strings e\&.g\&. Vayakhel Pekudei)
418 .RE
419 .PP
420
421 .SS "int \fBhdate_get_holyday\fP (\fBhdate_struct\fP const *h, intdiaspora)"
422 .PP
423 get the number of hebrew holiday\&. \fBParameters:\fP
424 .RS 4
425 \fIh\fP pointer this hdate struct\&.
426 .br
427 \fIdiaspora\fP if true give diaspora holidays
428 .RE
429 .PP
430 \fBReturns:\fP
431 .RS 4
432 the number of holiday\&.
433 .RE
434 .PP
435
436 .SS "char* \fBhdate_get_int_string\fP (intn)"
437 .PP
438 convert an integer to hebrew string\&. \fBParameters:\fP
439 .RS 4
440 \fIn\fP The int to convert ( 0 < n < 11000)
441 .RE
442 .PP
443 \fBReturns:\fP
444 .RS 4
445 a string of the hebrew number UTF-8 (logical)
446 .RE
447 .PP
448 \fBWarning:\fP
449 .RS 4
450 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]
451 .RE
452 .PP
453
454 .SS "char* \fBhdate_get_day_string\fP (intday, ints)"
455 .PP
456 Return a static string, with name of week day\&. \fBParameters:\fP
457 .RS 4
458 \fIday_of_week\fP The number of the day 1\&.\&.7 (1 - sun)\&.
459 .br
460 \fIshort_form\fP A short flag (true - sun; false - sunday)\&.
461 .RE
462 .PP
463 \fBWarning:\fP
464 .RS 4
465 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28]
466 .RE
467 .PP
468
469 .SS "char* \fBhdate_get_month_string\fP (intmonth, ints)"
470 .PP
471 Return a static string, with name of month\&. \fBParameters:\fP
472 .RS 4
473 \fImonth\fP The number of the month 1\&.\&.12 (1 - jan)\&.
474 .br
475 \fIshort_form\fP A short flag\&.
476 .RE
477 .PP
478 \fBWarning:\fP
479 .RS 4
480 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28]
481 .RE
482 .PP
483
484 .SS "char* \fBhdate_get_hebrew_month_string\fP (intmonth, ints)"
485 .PP
486 Return a static string, with name of hebrew month\&. \fBParameters:\fP
487 .RS 4
488 \fImonth\fP The number of the month 1\&.\&.14 (1 - tishre, 13 - adar 1, 14 - adar 2)\&.
489 .br
490 \fIshort_form\fP A short flag\&.
491 .RE
492 .PP
493 \fBWarning:\fP
494 .RS 4
495 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28]
496 .RE
497 .PP
498
499 .SS "char* \fBhdate_get_holyday_string\fP (intholyday, ints)"
500 .PP
501 Name of hebrew holiday\&. \fBParameters:\fP
502 .RS 4
503 \fIholiday\fP The holiday number\&.
504 .br
505 \fIshort_text\fP A short flag\&. 0=true, !0=false
506 .RE
507 .PP
508 \fBWarning:\fP
509 .RS 4
510 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28]
511 .RE
512 .PP
513
514 .SS "char* \fBhdate_get_parasha_string\fP (intparasha, ints)"
515 .PP
516 Name of Parasha\&. \fBParameters:\fP
517 .RS 4
518 \fIparasha\fP The Number of Parasha 1-Bereshit (55 through 61 are joined strings e\&.g\&. Vayakhel Pekudei)
519 .br
520 \fIshort_form\fP A short flag\&. 0=true, !0 = false
521 .RE
522 .PP
523 \fBWarning:\fP
524 .RS 4
525 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&. [deprecation date 2011-12-28]
526 .RE
527 .PP
528
529 .SS "char* \fBhdate_get_omer_string\fP (intomer_day)"
530 .PP
531 Return a static string, with the day in the omer\&. \fBParameters:\fP
532 .RS 4
533 \fIomer\fP day The day in the omer\&.
534 .RE
535 .PP
536 \fBReturns:\fP
537 .RS 4
538 a pointer to a string with the day in the omer\&. The caller must free() the pointer after use\&.
539 .RE
540 .PP
541 \fBWarning:\fP
542 .RS 4
543 DEPRECATION: This function is now just a wrapper for hdate_string, and is subject to deprecation\&.
544 .RE
545 .PP
546 \fBAttention:\fP
547 .RS 4
548 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]
549 .RE
550 .PP
551
552 .SS "int \fBhdate_get_omer_day\fP (\fBhdate_struct\fP const *h)"
553 .PP
554 Return the day in the omer of the given date\&. \fBParameters:\fP
555 .RS 4
556 \fIh\fP The \fBhdate_struct\fP of the date to use\&.
557 .RE
558 .PP
559 \fBReturns:\fP
560 .RS 4
561 The day in the omer, starting from 1 (or 0 if not in sfirat ha omer)
562 .RE
563 .PP
564
565 .SS "int \fBhdate_get_holyday_type\fP (intholyday)"
566 .PP
567 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
568 .PP
569 \fBParameters:\fP
570 .RS 4
571 \fIholyday\fP the holyday number
572 .RE
573 .PP
574 \fBReturns:\fP
575 .RS 4
576 the number of holyday type\&.
577 .RE
578 .PP
579
580 .SS "int \fBhdate_get_size_of_hebrew_year\fP (inthebrew_year)"
581 .PP
582 size of hebrew year in days\&. \fBParameters:\fP
583 .RS 4
584 \fIhebrew_year\fP the hebrew year\&.
585 .RE
586 .PP
587 \fBReturns:\fP
588 .RS 4
589 size of Hebrew year
590 .RE
591 .PP
592
593 .SS "int \fBhdate_days_from_3744\fP (inthebrew_year)"
594 .PP
595 Days since Tishrey 3744\&. \fBAuthor:\fP
596 .RS 4
597 Amos Shapir 1984 (rev\&. 1985, 1992) Yaacov Zamir 2003-2005
598 .RE
599 .PP
600 \fBParameters:\fP
601 .RS 4
602 \fIhebrew_year\fP The Hebrew year
603 .RE
604 .PP
605 \fBReturns:\fP
606 .RS 4
607 Number of days since 3,1,3744
608 .RE
609 .PP
610
611 .SS "int \fBhdate_get_year_type\fP (intsize_of_year, intnew_year_dw)"
612 .PP
613 Return Hebrew year type based on size and first week day of year\&. \fBParameters:\fP
614 .RS 4
615 \fIsize_of_year\fP Length of year in days
616 .br
617 \fInew_year_dw\fP First week day of year
618 .RE
619 .PP
620 \fBReturns:\fP
621 .RS 4
622 the number for year type (1\&.\&.14)
623 .RE
624 .PP
625
626 .SS "int \fBhdate_gdate_to_jd\fP (intday, intmonth, intyear)"
627 .PP
628 Compute Julian day from Gregorian date\&. \fBAuthor:\fP
629 .RS 4
630 Yaacov Zamir (algorithm from Henry F\&. Fliegel and Thomas C\&. Van Flandern ,1968)
631 .RE
632 .PP
633 \fBParameters:\fP
634 .RS 4
635 \fIday\fP Day of month 1\&.\&.31
636 .br
637 \fImonth\fP Month 1\&.\&.12
638 .br
639 \fIyear\fP Year in 4 digits e\&.g\&. 2001
640 .RE
641 .PP
642 \fBReturns:\fP
643 .RS 4
644 the julian day number
645 .RE
646 .PP
647
648 .SS "int \fBhdate_hdate_to_jd\fP (intday, intmonth, intyear, int *jd_tishrey1, int *jd_tishrey1_next_year)"
649 .PP
650 Compute Julian day from Hebrew day, month and year\&. \fBAuthor:\fP
651 .RS 4
652 Amos Shapir 1984 (rev\&. 1985, 1992) Yaacov Zamir 2003-2005
653 .RE
654 .PP
655 \fBParameters:\fP
656 .RS 4
657 \fIday\fP Day of month 1\&.\&.31
658 .br
659 \fImonth\fP Month 1\&.\&.14 (13 - Adar 1, 14 - Adar 2)
660 .br
661 \fIyear\fP Hebrew year in 4 digits e\&.g\&. 5753
662 .br
663 \fIjd_tishrey1\fP return the julian number of 1 Tishrey this year
664 .br
665 \fIjd_tishrey1_next_year\fP return the julian number of 1 Tishrey next year
666 .RE
667 .PP
668 \fBReturns:\fP
669 .RS 4
670 the julian day number
671 .RE
672 .PP
673
674 .SS "void \fBhdate_jd_to_gdate\fP (intjd, int *day, int *month, int *year)"
675 .PP
676 Converting from the Julian day to the Gregorian date\&. \fBAuthor:\fP
677 .RS 4
678 Yaacov Zamir (Algorithm, Henry F\&. Fliegel and Thomas C\&. Van Flandern ,1968)
679 .RE
680 .PP
681 \fBParameters:\fP
682 .RS 4
683 \fIjd\fP Julian day
684 .br
685 \fIday\fP return Day of month 1\&.\&.31
686 .br
687 \fImonth\fP return Month 1\&.\&.12
688 .br
689 \fIyear\fP return Year in 4 digits e\&.g\&. 2001
690 .RE
691 .PP
692
693 .SS "void \fBhdate_jd_to_hdate\fP (intjd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year)"
694 .PP
695 Converting from the Julian day to the Hebrew day\&. \fBAuthor:\fP
696 .RS 4
697 Yaacov Zamir 2005
698 .RE
699 .PP
700 \fBParameters:\fP
701 .RS 4
702 \fIjd\fP Julian day
703 .br
704 \fIday\fP return Day of month 1\&.\&.31
705 .br
706 \fImonth\fP return Month 1\&.\&.14 (13 - Adar 1, 14 - Adar 2)
707 .br
708 \fIyear\fP return Year in 4 digits e\&.g\&. 2001
709 .br
710 \fIjd_tishrey1\fP return the julian number of 1 Tishrey this year
711 .br
712 \fIjd_tishrey1_next_year\fP return the julian number of 1 Tishrey next year
713 .RE
714 .PP
715
716 .SS "int \fBhdate_get_day_of_year\fP (intday, intmonth, intyear)"
717 .PP
718 days from 1 january \fBParameters:\fP
719 .RS 4
720 \fIday\fP this day of month
721 .br
722 \fImonth\fP this month
723 .br
724 \fIyear\fP this year
725 .RE
726 .PP
727 \fBReturns:\fP
728 .RS 4
729 the days from 1 jan
730 .RE
731 .PP
732
733 .SS "void \fBhdate_get_utc_sun_time_deg\fP (intday, intmonth, intyear, doublelatitude, doublelongitude, doubledeg, int *sunrise, int *sunset)"
734 .PP
735 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\&.
736 .PP
737 \fBParameters:\fP
738 .RS 4
739 \fIday\fP this day of month
740 .br
741 \fImonth\fP this month
742 .br
743 \fIyear\fP this year
744 .br
745 \fIlongitude\fP longitude to use in calculations
746 .br
747 \fIlatitude\fP latitude to use in calculations
748 .br
749 \fIdeg\fP degrees of sun's altitude (0 - Zenith \&.\&. 90 - Horizon)
750 .br
751 \fIsunrise\fP return the utc sunrise in minutes
752 .br
753 \fIsunset\fP return the utc sunset in minutes
754 .RE
755 .PP
756
757 .SS "void \fBhdate_get_utc_sun_time\fP (intday, intmonth, intyear, doublelatitude, doublelongitude, int *sunrise, int *sunset)"
758 .PP
759 utc sunrise/set time for a gregorian date \fBParameters:\fP
760 .RS 4
761 \fIday\fP this day of month
762 .br
763 \fImonth\fP this month
764 .br
765 \fIyear\fP this year
766 .br
767 \fIlongitude\fP longitude to use in calculations degrees, negative values are east
768 .br
769 \fIlatitude\fP latitude to use in calculations degrees, negative values are south
770 .br
771 \fIsunrise\fP return the utc sunrise in minutes after midnight (00:00)
772 .br
773 \fIsunset\fP return the utc sunset in minutes after midnight (00:00)
774 .RE
775 .PP
776
777 .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)"
778 .PP
779 utc sunrise/set time for a gregorian date \fBParameters:\fP
780 .RS 4
781 \fIday\fP this day of month
782 .br
783 \fImonth\fP this month
784 .br
785 \fIyear\fP this year
786 .br
787 \fIlongitude\fP longitude to use in calculations
788 .br
789 \fIlatitude\fP latitude to use in calculations
790 .br
791 \fIsun_hour\fP return the length of shaa zaminit in minutes
792 .br
793 \fIfirst_light\fP return the utc alut ha-shachar in minutes
794 .br
795 \fItalit\fP return the utc tphilin and talit in minutes
796 .br
797 \fIsunrise\fP return the utc sunrise in minutes
798 .br
799 \fImidday\fP return the utc midday in minutes
800 .br
801 \fIsunset\fP return the utc sunset in minutes
802 .br
803 \fIfirst_stars\fP return the utc tzeit hacochavim in minutes
804 .br
805 \fIthree_stars\fP return the utc shlosha cochavim in minutes
806 .RE
807 .PP
808
809 .SS "int \fBhdate_get_gday\fP (\fBhdate_struct\fP const *h)"
810 .PP
811 get the Gregorian day of the month \fBParameters:\fP
812 .RS 4
813 \fIh\fP pointer this hdate struct\&.
814 .RE
815 .PP
816 \fBReturns:\fP
817 .RS 4
818 the Gregorian day of the month, 1\&.\&.31\&.
819 .RE
820 .PP
821
822 .SS "int \fBhdate_get_gmonth\fP (\fBhdate_struct\fP const *h)"
823 .PP
824 get the Gregorian month \fBParameters:\fP
825 .RS 4
826 \fIh\fP pointer this hdate struct\&.
827 .RE
828 .PP
829 \fBReturns:\fP
830 .RS 4
831 the Gregorian month, jan = 1\&.
832 .RE
833 .PP
834
835 .SS "int \fBhdate_get_gyear\fP (\fBhdate_struct\fP const *h)"
836 .PP
837 get the Gregorian year \fBParameters:\fP
838 .RS 4
839 \fIh\fP pointer this hdate struct\&.
840 .RE
841 .PP
842 \fBReturns:\fP
843 .RS 4
844 the Gregorian year\&.
845 .RE
846 .PP
847
848 .SS "int \fBhdate_get_hday\fP (\fBhdate_struct\fP const *h)"
849 .PP
850 get the Hebrew day of the month \fBParameters:\fP
851 .RS 4
852 \fIh\fP pointer this hdate struct\&.
853 .RE
854 .PP
855 \fBReturns:\fP
856 .RS 4
857 the Hebrew day of the month, 1\&.\&.30\&.
858 .RE
859 .PP
860
861 .SS "int \fBhdate_get_hmonth\fP (\fBhdate_struct\fP const *h)"
862 .PP
863 get the Hebrew month \fBParameters:\fP
864 .RS 4
865 \fIh\fP pointer this hdate struct\&.
866 .RE
867 .PP
868 \fBReturns:\fP
869 .RS 4
870 the Hebrew month, Tishery = 1 \&.\&. Adar I =13, Adar II = 14\&.
871 .RE
872 .PP
873
874 .SS "int \fBhdate_get_hyear\fP (\fBhdate_struct\fP const *h)"
875 .PP
876 get the Hebrew year \fBParameters:\fP
877 .RS 4
878 \fIh\fP pointer this hdate struct\&.
879 .RE
880 .PP
881 \fBReturns:\fP
882 .RS 4
883 the Hebrew year\&.
884 .RE
885 .PP
886
887 .SS "int \fBhdate_get_day_of_the_week\fP (\fBhdate_struct\fP const *h)"
888 .PP
889 get the day of the week \fBParameters:\fP
890 .RS 4
891 \fIh\fP pointer this hdate struct\&.
892 .RE
893 .PP
894 \fBReturns:\fP
895 .RS 4
896 the the day of the week\&.
897 .RE
898 .PP
899
900 .SS "int \fBhdate_get_size_of_year\fP (\fBhdate_struct\fP const *h)"
901 .PP
902 get the size of the hebrew year \fBParameters:\fP
903 .RS 4
904 \fIh\fP pointer this hdate struct\&.
905 .RE
906 .PP
907 \fBReturns:\fP
908 .RS 4
909 the the size of the hebrew year\&.
910 .RE
911 .PP
912
913 .SS "int \fBhdate_get_new_year_day_of_the_week\fP (\fBhdate_struct\fP const *h)"
914 .PP
915 get the new year day of the week \fBParameters:\fP
916 .RS 4
917 \fIh\fP pointer this hdate struct\&.
918 .RE
919 .PP
920 \fBReturns:\fP
921 .RS 4
922 the the new year day of the week\&.
923 .RE
924 .PP
925
926 .SS "int \fBhdate_get_julian\fP (\fBhdate_struct\fP const *h)"
927 .PP
928 get the Julian day number \fBParameters:\fP
929 .RS 4
930 \fIh\fP pointer this hdate struct\&.
931 .RE
932 .PP
933 \fBReturns:\fP
934 .RS 4
935 the Julian day number\&.
936 .RE
937 .PP
938
939 .SS "int \fBhdate_get_days\fP (\fBhdate_struct\fP const *h)"
940 .PP
941 get the number of days passed since 1 tishrey \fBParameters:\fP
942 .RS 4
943 \fIh\fP pointer this hdate struct\&.
944 .RE
945 .PP
946 \fBReturns:\fP
947 .RS 4
948 the number of days passed since 1 tishrey\&.
949 .RE
950 .PP
951
952 .SS "int \fBhdate_get_weeks\fP (\fBhdate_struct\fP const *h)"
953 .PP
954 get the number of weeks passed since 1 tishrey \fBParameters:\fP
955 .RS 4
956 \fIh\fP pointer this hdate struct\&.
957 .RE
958 .PP
959 \fBReturns:\fP
960 .RS 4
961 the number of weeks passed since 1 tishrey\&.
962 .RE
963 .PP
964
965 .SS "\fBhdate_struct\fP* \fBnew_hdate\fP ()"
966 .PP
967 creat a new hdate struct object, must be deleted using delete_hdate\&. \fBReturns:\fP
968 .RS 4
969 a new hdate object
970 .RE
971 .PP
972
973 .SS "\fBhdate_struct\fP* \fBdelete_hdate\fP (\fBhdate_struct\fP *h)"
974 .PP
975 delete an hdate struct object\&. \fBParameters:\fP
976 .RS 4
977 \fIh\fP pointer this hdate struct\&.
978 .RE
979 .PP
980
981 .SS "char* \fBhdate_get_version_string\fP ()"
982 .PP
983 Return a static string, with the package name and version\&. \fBReturns:\fP
984 .RS 4
985 a static string, with the package name and version
986 .RE
987 .PP
988
989 .SS "char* \fBhdate_get_translator_string\fP ()"
990 .PP
991 name of translator \fBReturns:\fP
992 .RS 4
993 a static string with name of translator, or NULL if none\&.
994 .RE
995 .PP
996
997 .SS "int \fBhdate_is_hebrew_locale\fP ()"
998 .PP
999 helper function to find hebrew locale \fBReturns:\fP
1000 .RS 4
1001 0 - latin locale, -1 - hebrew locale
1002 .RE
1003 .PP
1004
1005 .SS "char* \fBhdate_string\fP (inttype_of_string, intindex, intshort_form, inthebrew_form)"
1006 .PP
1007 Return string values for hdate information\&. \fBReturns:\fP
1008 .RS 4
1009 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\&.
1010 .RE
1011 .PP
1012 \fBParameters:\fP
1013 .RS 4
1014 \fItype_of_string\fP 0 = integer, 1 = day of week, 2 = parshaot, 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer
1015 .br
1016 \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 )
1017 .br
1018 \fIshort_form\fP 0 = short format
1019 .br
1020 \fIhebrew_form\fP 0 = not hebrew (native/embedded)
1021 .RE
1022 .PP
1023
1024 .SH "Author"
1025 .PP
1026 Generated automatically by Doxygen for libhdate C language from the source code\&.
0 .TH "hdate::Hdate" 3 "6 Jan 2008" "Version 1.4" "libhdate C++ language" \" -*- nroff -*-
1 .ad l
2 .nh
3 .SH NAME
4 hdate::Hdate \- \fBHdate\fP class.
5
6 .PP
7 .SH SYNOPSIS
8 .br
9 .PP
10 \fC#include <hdatepp.h>\fP
11 .PP
12 .SS "Public Member Functions"
13
14 .in +1c
15 .ti -1c
16 .RI "\fBHdate\fP ()"
17 .br
18 .RI "\fI\fBHdate\fP constructor. \fP"
19 .ti -1c
20 .RI "\fB~Hdate\fP ()"
21 .br
22 .RI "\fI\fBHdate\fP destructor. \fP"
23 .ti -1c
24 .RI "void \fBset_gdate\fP (int d, int m, int y)"
25 .br
26 .RI "\fIcompute date structure from the Gregorian date \fP"
27 .ti -1c
28 .RI "void \fBset_hdate\fP (int d, int m, int y)"
29 .br
30 .RI "\fIcompute date structure from the Hebrew date \fP"
31 .ti -1c
32 .RI "void \fBset_jd\fP (int jd)"
33 .br
34 .RI "\fIcompute date structure from the Julian day \fP"
35 .ti -1c
36 .RI "char * \fBget_format_date\fP (int s)"
37 .br
38 .RI "\fIget formated hebrew date. \fP"
39 .ti -1c
40 .RI "char * \fBget_day_of_week_string\fP (int s)"
41 .br
42 .RI "\fIget name of week day. \fP"
43 .ti -1c
44 .RI "char * \fBget_month_string\fP (int s)"
45 .br
46 .RI "\fIget name month. \fP"
47 .ti -1c
48 .RI "char * \fBget_hebrew_month_string\fP (int s)"
49 .br
50 .RI "\fIget name hebrew month. \fP"
51 .ti -1c
52 .RI "char * \fBget_holyday_string\fP (int s)"
53 .br
54 .RI "\fIget name hebrew holiday. \fP"
55 .ti -1c
56 .RI "int \fBget_holyday_type\fP ()"
57 .br
58 .RI "\fIget the hebrew holiday type. \fP"
59 .ti -1c
60 .RI "char * \fBget_parasha_string\fP (int s)"
61 .br
62 .RI "\fIget name hebrew parasha. \fP"
63 .ti -1c
64 .RI "char * \fBget_hebrew_year_string\fP ()"
65 .br
66 .RI "\fIget name hebrew year. \fP"
67 .ti -1c
68 .RI "char * \fBget_hebrew_day_string\fP ()"
69 .br
70 .RI "\fIget name hebrew hebrew day of the month \fP"
71 .ti -1c
72 .RI "int \fBget_parasha\fP ()"
73 .br
74 .RI "\fIget parash number \fP"
75 .ti -1c
76 .RI "int \fBget_holyday\fP ()"
77 .br
78 .RI "\fIget holiday number \fP"
79 .ti -1c
80 .RI "int \fBget_gday\fP ()"
81 .br
82 .RI "\fIget Gregorian day of the month \fP"
83 .ti -1c
84 .RI "int \fBget_gmonth\fP ()"
85 .br
86 .RI "\fIget Gregorian month \fP"
87 .ti -1c
88 .RI "int \fBget_gyear\fP ()"
89 .br
90 .RI "\fIget Gregorian year \fP"
91 .ti -1c
92 .RI "int \fBget_hday\fP ()"
93 .br
94 .RI "\fIget Hebrew day of the month \fP"
95 .ti -1c
96 .RI "int \fBget_hmonth\fP ()"
97 .br
98 .RI "\fIget Hebrew month \fP"
99 .ti -1c
100 .RI "int \fBget_hyear\fP ()"
101 .br
102 .RI "\fIget Hebrew year \fP"
103 .ti -1c
104 .RI "int \fBget_day_of_the_week\fP ()"
105 .br
106 .RI "\fIget the day of the week \fP"
107 .ti -1c
108 .RI "int \fBget_size_of_year\fP ()"
109 .br
110 .RI "\fIget the size of the Hebrew year in days \fP"
111 .ti -1c
112 .RI "int \fBget_new_year_day_of_the_week\fP ()"
113 .br
114 .RI "\fIget the day of the week of hebrew new years \fP"
115 .ti -1c
116 .RI "int \fBget_julian\fP ()"
117 .br
118 .RI "\fIget the Julian day number \fP"
119 .ti -1c
120 .RI "int \fBget_days\fP ()"
121 .br
122 .RI "\fIget the number of days sice Tishrey I \fP"
123 .ti -1c
124 .RI "int \fBget_weeks\fP ()"
125 .br
126 .RI "\fIget the number of weeks sice Tishrey I \fP"
127 .ti -1c
128 .RI "void \fBset_location\fP (double in_latitude, double in_longitude, int in_tz)"
129 .br
130 .RI "\fIset location \fP"
131 .ti -1c
132 .RI "int \fBget_sunrise\fP ()"
133 .br
134 .RI "\fIsunrise time \fP"
135 .ti -1c
136 .RI "int \fBget_sunset\fP ()"
137 .br
138 .RI "\fIsunset time \fP"
139 .ti -1c
140 .RI "int \fBget_first_light\fP ()"
141 .br
142 .RI "\fIfirst light time \fP"
143 .ti -1c
144 .RI "int \fBget_talit\fP ()"
145 .br
146 .RI "\fItalit time \fP"
147 .ti -1c
148 .RI "int \fBget_first_stars\fP ()"
149 .br
150 .RI "\fIfirst stars time \fP"
151 .ti -1c
152 .RI "int \fBget_three_stars\fP ()"
153 .br
154 .RI "\fIthree stars time \fP"
155 .ti -1c
156 .RI "int \fBget_sun_hour\fP ()"
157 .br
158 .RI "\fIsun light hour time \fP"
159 .ti -1c
160 .RI "int \fBget_midday\fP ()"
161 .br
162 .RI "\fImidday hour time \fP"
163 .ti -1c
164 .RI "char * \fBget_translator_string\fP ()"
165 .br
166 .RI "\fIname of translator \fP"
167 .ti -1c
168 .RI "void \fBset_diaspora\fP ()"
169 .br
170 .RI "\fIset this \fBhdate\fP object to use diaspora holidays and dates \fP"
171 .ti -1c
172 .RI "void \fBset_israel\fP ()"
173 .br
174 .RI "\fIset this \fBhdate\fP object to use israel holidays and dates \fP"
175 .in -1c
176 .SH "Detailed Description"
177 .PP
178 \fBHdate\fP class.
179
180 class for Hebrew/Gregorian date conversions
181 .SH "Constructor & Destructor Documentation"
182 .PP
183 .SS "hdate::Hdate::Hdate ()\fC [inline]\fP"
184 .PP
185 \fBHdate\fP constructor.
186 .PP
187 .SS "hdate::Hdate::~Hdate ()\fC [inline]\fP"
188 .PP
189 \fBHdate\fP destructor.
190 .PP
191 .SH "Member Function Documentation"
192 .PP
193 .SS "void hdate::Hdate::set_gdate (int d, int m, int y)\fC [inline]\fP"
194 .PP
195 compute date structure from the Gregorian date
196 .PP
197 \fBParameters:\fP
198 .RS 4
199 \fId\fP Day of month 1..31
200 .br
201 \fIm\fP Month 1..12 , if m or d is 0 return current date.
202 .br
203 \fIy\fP Year in 4 digits e.g. 2001
204 .RE
205 .PP
206
207 .SS "void hdate::Hdate::set_hdate (int d, int m, int y)\fC [inline]\fP"
208 .PP
209 compute date structure from the Hebrew date
210 .PP
211 \fBParameters:\fP
212 .RS 4
213 \fId\fP Day of month 1..31
214 .br
215 \fIm\fP Month 1..14 , if m or d is 0 return current date.
216 .br
217 \fIy\fP Year in 4 digits e.g. 5731
218 .RE
219 .PP
220
221 .SS "void hdate::Hdate::set_jd (int jd)\fC [inline]\fP"
222 .PP
223 compute date structure from the Julian day
224 .PP
225 \fBParameters:\fP
226 .RS 4
227 \fIjd\fP the julian day number.
228 .RE
229 .PP
230
231 .SS "char* hdate::Hdate::get_format_date (int s)\fC [inline]\fP"
232 .PP
233 get formated hebrew date.
234 .PP
235 return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formated date.
236 .PP
237 \fBParameters:\fP
238 .RS 4
239 \fIs\fP short flag.
240 .RE
241 .PP
242 \fBReturns:\fP
243 .RS 4
244 a static string of foramted date
245 .RE
246 .PP
247
248 .SS "char* hdate::Hdate::get_day_of_week_string (int s)\fC [inline]\fP"
249 .PP
250 get name of week day.
251 .PP
252 \fBParameters:\fP
253 .RS 4
254 \fIs\fP short flag true - returns a short string: sun, false returns: sunday.
255 .RE
256 .PP
257 \fBReturns:\fP
258 .RS 4
259 a static string of the day of the week
260 .RE
261 .PP
262
263 .SS "char* hdate::Hdate::get_month_string (int s)\fC [inline]\fP"
264 .PP
265 get name month.
266 .PP
267 \fBParameters:\fP
268 .RS 4
269 \fIs\fP short flag true - returns a short string: Mar, false returns: March.
270 .RE
271 .PP
272 \fBReturns:\fP
273 .RS 4
274 a static string of month name
275 .RE
276 .PP
277
278 .SS "char* hdate::Hdate::get_hebrew_month_string (int s)\fC [inline]\fP"
279 .PP
280 get name hebrew month.
281 .PP
282 \fBParameters:\fP
283 .RS 4
284 \fIs\fP short flag true - returns a short string.
285 .RE
286 .PP
287 \fBReturns:\fP
288 .RS 4
289 a static string of hebrew month name
290 .RE
291 .PP
292
293 .SS "char* hdate::Hdate::get_holyday_string (int s)\fC [inline]\fP"
294 .PP
295 get name hebrew holiday.
296 .PP
297 \fBParameters:\fP
298 .RS 4
299 \fIs\fP short flag true - returns a short string.
300 .RE
301 .PP
302 \fBReturns:\fP
303 .RS 4
304 a static string of hebrew holiday name
305 .RE
306 .PP
307
308 .SS "int hdate::Hdate::get_holyday_type ()\fC [inline]\fP"
309 .PP
310 get the hebrew holiday type.
311 .PP
312 \fBReturns:\fP
313 .RS 4
314 the holiday type (1- regular holyday, 2- three regels, 3- tzom, 0- no holiday)
315 .RE
316 .PP
317
318 .SS "char* hdate::Hdate::get_parasha_string (int s)\fC [inline]\fP"
319 .PP
320 get name hebrew parasha.
321 .PP
322 \fBParameters:\fP
323 .RS 4
324 \fIs\fP short flag true - returns a short string.
325 .RE
326 .PP
327 \fBReturns:\fP
328 .RS 4
329 a static string of hebrew parash name
330 .RE
331 .PP
332
333 .SS "char* hdate::Hdate::get_hebrew_year_string ()\fC [inline]\fP"
334 .PP
335 get name hebrew year.
336 .PP
337 \fBReturns:\fP
338 .RS 4
339 a static string of hebrew year
340 .RE
341 .PP
342
343 .SS "char* hdate::Hdate::get_hebrew_day_string ()\fC [inline]\fP"
344 .PP
345 get name hebrew hebrew day of the month
346 .PP
347 \fBReturns:\fP
348 .RS 4
349 a static string of hebrew day of the month
350 .RE
351 .PP
352
353 .SS "int hdate::Hdate::get_parasha ()\fC [inline]\fP"
354 .PP
355 get parash number
356 .PP
357 \fBReturns:\fP
358 .RS 4
359 the hebrew parasha number
360 .RE
361 .PP
362
363 .SS "int hdate::Hdate::get_holyday ()\fC [inline]\fP"
364 .PP
365 get holiday number
366 .PP
367 \fBReturns:\fP
368 .RS 4
369 the hebrew holiday number
370 .RE
371 .PP
372
373 .SS "int hdate::Hdate::get_gday ()\fC [inline]\fP"
374 .PP
375 get Gregorian day of the month
376 .PP
377 \fBReturns:\fP
378 .RS 4
379 the Gregorian day of the month
380 .RE
381 .PP
382
383 .SS "int hdate::Hdate::get_gmonth ()\fC [inline]\fP"
384 .PP
385 get Gregorian month
386 .PP
387 \fBReturns:\fP
388 .RS 4
389 the Gregorian month
390 .RE
391 .PP
392
393 .SS "int hdate::Hdate::get_gyear ()\fC [inline]\fP"
394 .PP
395 get Gregorian year
396 .PP
397 \fBReturns:\fP
398 .RS 4
399 the Gregorian year
400 .RE
401 .PP
402
403 .SS "int hdate::Hdate::get_hday ()\fC [inline]\fP"
404 .PP
405 get Hebrew day of the month
406 .PP
407 \fBReturns:\fP
408 .RS 4
409 the Hebrew day of the month
410 .RE
411 .PP
412
413 .SS "int hdate::Hdate::get_hmonth ()\fC [inline]\fP"
414 .PP
415 get Hebrew month
416 .PP
417 \fBReturns:\fP
418 .RS 4
419 the Hebrew month
420 .RE
421 .PP
422
423 .SS "int hdate::Hdate::get_hyear ()\fC [inline]\fP"
424 .PP
425 get Hebrew year
426 .PP
427 \fBReturns:\fP
428 .RS 4
429 the Hebrew year
430 .RE
431 .PP
432
433 .SS "int hdate::Hdate::get_day_of_the_week ()\fC [inline]\fP"
434 .PP
435 get the day of the week
436 .PP
437 \fBReturns:\fP
438 .RS 4
439 the day of the week
440 .RE
441 .PP
442
443 .SS "int hdate::Hdate::get_size_of_year ()\fC [inline]\fP"
444 .PP
445 get the size of the Hebrew year in days
446 .PP
447 \fBReturns:\fP
448 .RS 4
449 the size of the Hebrew year in days
450 .RE
451 .PP
452
453 .SS "int hdate::Hdate::get_new_year_day_of_the_week ()\fC [inline]\fP"
454 .PP
455 get the day of the week of hebrew new years
456 .PP
457 \fBReturns:\fP
458 .RS 4
459 the day of the week of hebrew new years
460 .RE
461 .PP
462
463 .SS "int hdate::Hdate::get_julian ()\fC [inline]\fP"
464 .PP
465 get the Julian day number
466 .PP
467 \fBReturns:\fP
468 .RS 4
469 the Julian day number
470 .RE
471 .PP
472
473 .SS "int hdate::Hdate::get_days ()\fC [inline]\fP"
474 .PP
475 get the number of days sice Tishrey I
476 .PP
477 \fBReturns:\fP
478 .RS 4
479 the the number of days sice Tishrey I
480 .RE
481 .PP
482
483 .SS "int hdate::Hdate::get_weeks ()\fC [inline]\fP"
484 .PP
485 get the number of weeks sice Tishrey I
486 .PP
487 \fBReturns:\fP
488 .RS 4
489 the the number of weeks sice Tishrey I
490 .RE
491 .PP
492
493 .SS "void hdate::Hdate::set_location (double in_latitude, double in_longitude, int in_tz)\fC [inline]\fP"
494 .PP
495 set location
496 .PP
497 \fBParameters:\fP
498 .RS 4
499 \fIin_longitude\fP longitude to use in calculations degrees, negative values are east
500 .br
501 \fIin_latitude\fP latitude to use in calculations degrees, negative values are south
502 .br
503 \fIin_tz\fP time zone
504 .RE
505 .PP
506
507 .SS "int hdate::Hdate::get_sunrise ()\fC [inline]\fP"
508 .PP
509 sunrise time
510 .PP
511 \fBReturns:\fP
512 .RS 4
513 sunrise in minutes after midnight (00:00)
514 .RE
515 .PP
516
517 .SS "int hdate::Hdate::get_sunset ()\fC [inline]\fP"
518 .PP
519 sunset time
520 .PP
521 \fBReturns:\fP
522 .RS 4
523 sunset in minutes after midnight (00:00)
524 .RE
525 .PP
526
527 .SS "int hdate::Hdate::get_first_light ()\fC [inline]\fP"
528 .PP
529 first light time
530 .PP
531 \fBReturns:\fP
532 .RS 4
533 first light in minutes after midnight (00:00)
534 .RE
535 .PP
536
537 .SS "int hdate::Hdate::get_talit ()\fC [inline]\fP"
538 .PP
539 talit time
540 .PP
541 \fBReturns:\fP
542 .RS 4
543 talit time in minutes after midnight (00:00)
544 .RE
545 .PP
546
547 .SS "int hdate::Hdate::get_first_stars ()\fC [inline]\fP"
548 .PP
549 first stars time
550 .PP
551 \fBReturns:\fP
552 .RS 4
553 first stars in minutes after midnight (00:00)
554 .RE
555 .PP
556
557 .SS "int hdate::Hdate::get_three_stars ()\fC [inline]\fP"
558 .PP
559 three stars time
560 .PP
561 \fBReturns:\fP
562 .RS 4
563 three stars in minutes after midnight (00:00)
564 .RE
565 .PP
566
567 .SS "int hdate::Hdate::get_sun_hour ()\fC [inline]\fP"
568 .PP
569 sun light hour time
570 .PP
571 \fBReturns:\fP
572 .RS 4
573 sun light hour in minutes
574 .RE
575 .PP
576
577 .SS "int hdate::Hdate::get_midday ()\fC [inline]\fP"
578 .PP
579 midday hour time
580 .PP
581 \fBReturns:\fP
582 .RS 4
583 midday hour in minutes
584 .RE
585 .PP
586
587 .SS "char* hdate::Hdate::get_translator_string ()\fC [inline]\fP"
588 .PP
589 name of translator
590 .PP
591 \fBReturns:\fP
592 .RS 4
593 a static string with name of translator, or NULL if none
594 .RE
595 .PP
596
597 .SS "void hdate::Hdate::set_diaspora ()\fC [inline]\fP"
598 .PP
599 set this \fBhdate\fP object to use diaspora holidays and dates
600 .PP
601 .SS "void hdate::Hdate::set_israel ()\fC [inline]\fP"
602 .PP
603 set this \fBhdate\fP object to use israel holidays and dates
604 .PP
605
606
607 .SH "Author"
608 .PP
609 Generated automatically by Doxygen for libhdate C++ language from the source code.
0 /* hcal.c http://libhdate.sourceforge.net
1 * Hebrew calendar (part of package libhdate)
2 *
3 * compile:
4 * gcc `pkg-config --libs --cflags libhdate` hcal.c -o hcal
5 *
6 * Copyright: 2011-2012 (c) Boruch Baum, 2004-2010 (c) Yaacov Zamir
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #define _GNU_SOURCE // for mempcpy
23 #include <stdio.h> // For printf
24 #include <hdate.h> // For hebrew date
25 //#include "../../src/hdate.h"
26 #include <stdlib.h> // For atoi, malloc
27 #include <locale.h> // For setlocale
28 #include <getopt.h> // For getopt_long
29 #include <string.h> // For strlen, mempcpy
30 #include <time.h> // For time, tzset
31 //#include <wchar.h> // for unicode character operations
32
33 #define FALSE 0
34 #define TRUE -1
35 #define SHABBAT 7
36
37 #define HDATE_STRING_SHORT 1
38
39 // for opt.menu[MAX_MENU_ITEMS]
40 #define MAX_MENU_ITEMS 10
41
42
43
44 // for colorization
45 #define CODE_REVERSE_VIDEO "%c[7m", 27
46 #define CODE_RESTORE_VIDEO "%c[m", 27
47 #define CODE_BLACK "%c[30m", 27
48 #define CODE_LIGHT_RED "%c[31m", 27
49 #define CODE_LIGHT_GREEN "%c[32m", 27
50 #define CODE_LIGHT_BROWN "%c[33m", 27
51 #define CODE_DARK_BLUE "%c[34m", 27
52 #define CODE_LIGHT_PURPLE "%c[35m", 27
53 #define CODE_LIGHT_AQUA "%c[36m", 27
54 #define CODE_LIGHT_GREY "%c[37m", 27
55 #define CODE_BOLD_GREY "%c[1;30m", 27
56 #define CODE_BOLD_RED "%c[1;31m", 27
57 #define CODE_BOLD_GREEN "%c[1;32m", 27
58 #define CODE_BOLD_YELLOW "%c[1;33m", 27
59 #define CODE_BOLD_BLUE "%c[1;34m", 27
60 #define CODE_BOLD_PURPLE "%c[1;35m", 27
61 #define CODE_BOLD_AQUA "%c[1;36m", 27
62 #define CODE_BOLD_WHITE "%c[1;37m", 27
63 #define ELEMENT_WEEKDAY_G 1
64 #define ELEMENT_WEEKDAY_H 2
65 #define ELEMENT_SHABBAT_DAY 3
66 #define ELEMENT_HOLIDAY_DAY 4
67 #define ELEMENT_HOLIDAY_FLAG 5
68 #define ELEMENT_SHABBAT_NAME 6
69 #define ELEMENT_WEEKDAY_NAMES 7
70 #define ELEMENT_MONTH_G 8
71 #define ELEMENT_MONTH_H 9
72 #define ELEMENT_SHABBAT_TIMES 10
73 #define ELEMENT_PARASHA 11
74 #define ELEMENT_THIS_SHABBAT_TIMES 12
75 #define ELEMENT_THIS_PARASHA 13
76 #define ELEMENT_HOLIDAY_NAME 14
77 #define ELEMENT_TODAY_HOLIDAY_DAY 15
78 #define ELEMENT_TODAY_HOLIDAY_NAME 16
79
80 /**************************************************
81 * functions to support hcal and hdate
82 **************************************************/
83 #include "./local_functions.c"
84
85
86
87 static char holiday_flag[] = { '/', '+', '*', '~', '!', '@', '#', '$', '%', '^' };
88 /* Holiday types: (reference hdate_holyday.c)
89 / - 0 - Regular day
90 + - 1 - Yom tov (plus yom kippor)
91 * - 2 - Erev yom kippur
92 ~ - 3 - Hol hamoed
93 ! - 4 - Hanuka and purim
94 @ - 5 - Tzomot
95 # - 6 - Independance day and Yom yerushalaim
96 $ - 7 - Lag baomer ,Tu beav, Tu beshvat
97 % - 8 - Tzahal and Holocaust memorial days
98 ^ - 9 - National days
99 */
100
101
102
103 typedef struct {
104 int html;
105 int external_css;
106 int diaspora;
107 int parasha;
108 int shabbat;
109 int candles;
110 int havdalah;
111 int no_reverse;
112 int three_month;
113 int colorize;
114 int footnote;
115 int jd_today_g;
116 int jd_today_h;
117 int force_hebrew;
118 int force_israel;
119 int not_sunset_aware;
120 int quiet_alerts;
121 int bidi;
122 double lat;
123 double lon;
124 int tz;
125 int menu;
126 char* menu_item[MAX_MENU_ITEMS];
127 } option_list;
128
129 typedef struct {
130 int g_month_1;
131 int g_year_1;
132 int g_month_2;
133 int g_year_2;
134 int h_month_1;
135 int h_year_1;
136 int h_month_2;
137 int h_year_2;
138 } header_info;
139
140
141 const char* hcal_config_file_text = N_("\
142 # configuration file for hcal - Hebrew calendar program\n\
143 # part of package libhdate\n\
144 #\n# Should you mangle this file and wish to restore its default content,\n\
145 # rename or delete this file and run hcal; hcal will automatically\n\
146 # regenerate the default content.\n#\n\
147 # Your system administrator can set system-wide defaults for hcal by\n\
148 # modifying file <not yet implemented>.\n\
149 # You may override all defaults by changing the contents of this file.\n\
150 #\n\
151 # Version information\n\
152 # This may be used by updates to hcal to determine how to parse the file\n\
153 # and whether additional information and options should be appended to\n\
154 # the end of this file.\n\
155 VERSION=2.00\n\
156 # Location awareness\n\
157 # hcal wants to accurately highlight the current Hebrew day, including\n\
158 # during the hours between sunset and secular midnight. If you don't\n\
159 # provide it with latitude, longitude, and time zone information, hcal\n\
160 # will try to guess the information, based upon your system timezone,\n\
161 # and its (limited, and maybe biased) of the dominant Jewish community\n\
162 # in that timezone. When hcal is forced to guess, it alerts the user\n\
163 # with a message that includes the guessed location.\n\
164 # hcal's guesses will also affect its default behaviour for ouput of\n\
165 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\
166 #SUNSET_AWARE=TRUE\n\
167 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
168 # degrees[:minutes[:seconds]] with the characters :'\" as possible\n\
169 # delimiters. Use negative values to indicate South and West, or\n\
170 # use the abbreviated compass directions N, S, E, W.\n\
171 #LATITUDE=\n\
172 #LONGITUDE=\n\
173 # TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\
174 # with the characters :'\" as possible delimiters.\n\
175 #TIMEZONE=\n\n\
176 # Israel and the diaspora\n\
177 # If hcal guesses that you're not in Israel, the DIASPORA option will be\n\
178 # set true. This will affect holiday and parasha output. FORCE_ISRAEL\n\
179 # forces hcal to display calendar information for Israel, using hcal's\n\
180 # default coordinates foe Israel, or coordinates that you provide that\n\
181 # seem legitmately within Israel.\n\
182 # Thus, if you are living in Sao Paolo, and will be visiting Israel for\n\
183 # Sukkot, set BOTH flags true in order to see holiday information for\n\
184 # a non-resident vistor to Israel. The command line options for these\n\
185 # features are --israel, -I, --diaspora, -d.\n\
186 #FORCE_DIASPORA=FALSE;\n\
187 #FORCE_ISRAEL=FALSE;\n\n\
188 # Shabbat related\n\
189 # Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\
190 # The command line options for these features are -p (--parasha), and\n\
191 # -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\
192 # before sunset). The HAVDALAH field can accept a value of 20 - 90\n\
193 # (minutes after sunset).\n\
194 #PARASHA_NAMES=FALSE\n\
195 #SHABBAT_INFO=FALSE\n\
196 #CANDLE_LIGHTING=FALSE\n\
197 #HAVDALAH=FALSE\n\n\
198 # Holiday identification\n\
199 # hcal flags holidays by replacing the gregorian/Hebrew date separator\n\
200 # with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n\
201 # will have hcal output after the month's calendar, a list of the month's\n\
202 # holidays along with the days on which they occur.\n\
203 #FOOTNOTE=FALSE\n\n\
204 # Output in hebrew characters\n\
205 # hcal defaults to output all information in your default language, so\n\
206 # if your default language is Hebrew, you're all set. Otherwise, you can\n\
207 # set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\
208 # still outputting gregorian information in your default language. To\n\
209 # output ALL information in Hebrew, run something like this:\n\
210 # LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n\
211 # If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\
212 # output, you need to install a terminal font that includes the Hebrew\n\
213 # character set (hint: unicode).\n\
214 # The command line option for FORCE_HEBREW is either --hebrew or -H\n\
215 #FORCE_HEBREW=FALSE\n\n\
216 # The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\
217 # Unfortunately, the world can not be depended upon to be either. Most\n\
218 # Xwindow applications will display the data fine with FORCE_HEBREW; most\n\
219 # xterm implementations will not. (in fact, the only xterm clone I know\n\
220 # of that comes close is mlterm). If using FORCE_HEBREW results in\n\
221 # Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\
222 # This will reverse the order of the Hebrew characters, so they will\n\
223 # display 'visual'ly correct; however, such output will not be suitable\n\
224 # for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\
225 # automatically forces hebrew.\n\
226 # The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n\
227 #OUTPUT_BIDI=FALSE\n\n\
228 # Display enhancements\n\
229 # hcal defaults to display the current day in reverse video\n\
230 # The command line option for this feature is --no-reverse\n\
231 #SUPPRESS_REVERSE_VIDEO=FALSE;\n\
232 # hcal can display its output \"calming, muted tones\". Note that piping\n\
233 # colorized output may yield unexpected results.\n\
234 #COLORIZE=FALSE\n\n\
235 # HTML OUTPUT\n\
236 #OUTPUT_HTML=FALSE\n\
237 #USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n\n\
238 # Suppress alerts and warnings\n\
239 # hcal alerts the user via STDERR when it guesses the user's location.\n\
240 #QUIET_ALERTS=FALSE\n\n\
241 # Three month display\n\
242 # hcal can display a previous, current and next month side-by-side. hcal\n\
243 # can also display a calendar for an entire year in four rows of three\n\
244 # months each. Note that this will display properly only if your console\n\
245 # is set for at least 127 columns. Note also that setting this option to\n\
246 # will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n\
247 #THREE_MONTH=FALSE\n\n\
248 # User-defined menus\n\
249 # You may specify here command-line strings to optionally be parsed\n\
250 # by hcal at execution time. To do so, use the command line option -m\n\
251 # (--menu). hcal will process first the settings of this config file,\n\
252 # then the other settings of your command line, and then will prompt\n\
253 # you for which menu item you would like to select. hcal will process\n\
254 # your menu selection as if it were a new command line, further modifying\n\
255 # all the prior settings.\n\
256 # Only the first ten \"MENU=\" entries will be read. Each line will be\n\
257 # truncated at one hundred characters\n\
258 #MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\
259 #MENU= -l 32 -L 34 -z 2 # son in bnei brak\n\
260 #MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n\
261 #MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\
262 ");
263
264
265 /**************************************************
266 * print version
267 *************************************************/
268 int print_version ()
269 {
270 printf ("%s\n", N_("hcal - Hebrew calendar\nversion 1.6"));
271 return 0;
272 }
273
274 /**************************************************
275 * print usage
276 *************************************************/
277 void print_usage_hcal ()
278 {
279 printf ("%s\n",
280 N_("Usage: hcal [options] [coordinates timezone] ] [[month] year]\n\
281 coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n\
282 -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\
283 timezone: -z nn[( .nn | :mm )]\n\
284 Try \'hcal --help\' for more information"));
285 }
286
287 /**************************************************
288 * print help
289 *************************************************/
290 void print_help ()
291 {
292 print_usage_hcal();
293 printf ("%s\n",
294 N_("Hebrew calendar\nOPTIONS:\n\
295 -1 --one-month over-ride config file setting if you had set\n\
296 option --three-month as a default there\n\
297 -3 --three-month displays previous/next months\n\
298 side by side. requires 127 columns\n\
299 -b --bidi prints hebrew in reverse (visual)\n\
300 --visual\n\
301 --no-bidi over-ride config file setting if you had set\n\
302 --no-visual option -bidi as a default there\n\
303 -c --colorize displays in calming, muted tones\n\
304 --no-color over-ride a --colorize setting in your config file\n\
305 -d --diaspora use diaspora reading and holidays.\n\
306 -f --footnote print descriptive notes of holidays\n\
307 --no-footnote over-ride a footnote setting in your config file\n\
308 -h --html output in html format to stdout\n\
309 -H --hebrew print hebrew information in Hebrew\n\
310 -i use external css file \"./hcal.css\".\n\
311 -I --israel override a diaspora default\n\
312 --no-reverse do not highlight today's date\n\
313 -m --menu prompt user-defined menu from config file\n\
314 -p --parasha print week's parasha on each calendar row\n\
315 -q --quiet-alerts suppress warning messages\n\
316 -s --shabbat print Shabbat times and parshiot\n\
317 --candles modify default minhag of 20 minutes. (17<n<91)\n\
318 --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n\
319 -z --timezone nn timezone, +/-UTC\n\
320 -l --latitude yy latitude yy degrees. Negative values are South\n\
321 -L --longitude xx longitude xx degrees. Negative values are West\n\n\
322 All options can be made default in the config file, or menu-ized for\n\
323 easy selection."));
324 }
325
326
327 /**************************************************
328 * HTML - print css section
329 *************************************************/
330 int print_css (const int external_css)
331 {
332 if (external_css) printf ("\n\t@import \"hcal.css\";\n");
333 else
334 {
335 printf ("\nbody.hebrew { direction: rtl;}\n\
336 img { margin:0; padding: 0; vertical-align: middle; border: 0;}\n\
337 p {}\n\
338 table.main { width: 90%%; table-layout: fixed; font-size: 14pt; border: solid #aaaaaa; }\n\
339 table.day { width: 100%%; height: 100%%; table-layout: fixed; font-size: 14pt; }\n\
340 th.gmonth { font-size: 30pt; font-weight: bold }\n\
341 th.gyear { font-size: 30pt; font-weight: bold}\n\
342 th.hmonth { font-size: 30pt; font-weight: bold}\n\
343 th.hyear {font-size: 30pt; font-weight: bold }\n\
344 th.week { background-color: #aaaaaa; text-align: center; }\n\
345 td.gday { font-size: 30pt; vertical-align: top; }\n\
346 td.hday { font-size: 12pt; vertical-align: top; }\n\
347 td.sat { border: solid #777777; }\n\
348 td.regular { border: solid #aaaaaa; }\n\
349 td.holiday { color: #990000; border: solid #888888; }\n\
350 td.out_of_month { color: #dddddd; border: solid #dddddd; }\n\
351 tr.line1 { height: 30%%; }\n\
352 tr.line2 { height: 50%%; font-size: 30pt; }\n\
353 tr.line3 { height: 20%%; font-size: 12pt; vertical-align: bottom; }\n\
354 span.today { }\n\
355 span.gmonth { font-size: 24pt; }\n\
356 span.gyear { font-size: 24pt; }\n\
357 span.hmonth { font-size: 24pt; }\n\
358 span.hyear { font-size: 24pt; }\n\
359 span.holiday_name { }\n");
360 }
361
362 return 0;
363 }
364
365
366
367 /**************************************************
368 * HTML - print header
369 *************************************************/
370 int print_header_html ( const int external_css, const int force_hebrew)
371 {
372 printf ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\n\
373 <html>\n\
374 <head>\n\
375 <meta name=\"generator\" content=\"hcal (libhdate)\">\n\
376 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\
377 <style title=\"Normal\" type=\"text/css\" media=\"all\">");
378
379 print_css (external_css);
380
381 printf ("</style>\n");
382
383 /* some alternative css styles */
384 printf ("\n\
385 <link rel=\"alternate stylesheet\" title=\"High contrast\" type=\"text/css\" media=\"screen\" href=\"high_contrast.css\">\n\
386 <link rel=\"alternate stylesheet\" title=\"Colorful\" type=\"text/css\" media=\"screen\" href=\"colorful.css\">\n\
387 <link rel=\"alternate stylesheet\" title=\"Print\" type=\"text/css\" media=\"all\" href=\"print.css\">\n");
388
389 if ( (force_hebrew) || (hdate_is_hebrew_locale()) )
390 printf ("<title>Hebrew Calendar</title>\n</head>\n<body class=\"hebrew\"><center>\n");
391 else
392 printf ("<title>Hebrew Calendar</title>\n</head>\n<body><center>\n");
393
394 return 0;
395 }
396
397
398
399 /**************************************************
400 * HTML - print footer
401 *************************************************/
402 int print_html_footer ()
403 {
404 printf ("<!-- <p>\n\
405 <a href=\"http://validator.w3.org/check/referer\">\n<img \
406 src=\"http://www.w3.org/Icons/valid-html401\"\n\
407 alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\" />\n</a>\n");
408 printf ("<a href=\"http://jigsaw.w3.org/css-validator\">\n\
409 <img src=\"http://www.w3.org/Icons/valid-css\" alt=\"Valid CSS!\">\n\
410 </a>\n</p> -->\n");
411
412 printf ("</body></html>\n");
413
414 return 0;
415 }
416
417
418 /**************************************************
419 * Print HTML header - month line
420 *************************************************/
421 void print_header_month_line_html( const header_info header)
422 {
423
424 // TODO - fix bug ellul xxxx - tishrei xxxx+1
425 // char *h_year_1;
426 // h_year_1 = malloc(HEBREW_NUMBER_BUFFER_SIZE);
427 // char h_year_1[HEBREW_NUMBER_BUFFER_SIZE + 1];
428 char *h_year_1 = NULL;
429
430 /**************************************************
431 * Print Gregorian month and year
432 **************************************************/
433 printf ("<table width=90%%><tr><td align=left><span class=\"gmonth\">%s <span class=\"gyear\">%d</span></td>\n",
434 hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL),
435 header.g_year_1);
436
437 h_year_1 = hdate_string(HDATE_STRING_INT, header.h_year_1, HDATE_STRING_LONG, HDATE_STRING_HEBREW);
438 /**************************************************
439 * Print Hebrew month and year
440 **************************************************/
441 printf ("<td align=right><span class=\"hmonth\">");
442 if (header.h_month_1 != header.h_month_2)
443 {
444 printf ("%s-",
445 hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
446 }
447 printf ("%s ", hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, HDATE_STRING_LOCAL));
448 printf ("</span>\n");
449 printf ("<span class=\"hyear\">%s</span></td></tr></table>\n", h_year_1);
450
451 printf ("<span class=\"month_table\">\n<table class=main>\n");
452
453
454 if (h_year_1 != NULL) free(h_year_1);
455 }
456
457
458 /**************************************************
459 * HTML - print column headings for days of weeks
460 **************************************************/
461 void print_header_dow_line_html()
462 {
463 int j;
464
465 for (j = 1; j < 8; j++)
466 printf ("<th class=\"week\">%3s</th>",
467 hdate_string( HDATE_STRING_DOW, j, TRUE, FALSE));
468 }
469
470
471
472 /**************************************************
473 * end HTML functions
474 *************************************************/
475
476
477 /*************************************************
478 * Display data in a more pleasing visual manner
479 *************************************************/
480 void colorize_element ( const int element )
481 {
482 switch (element) {
483 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
484 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_BROWN); break;
485 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
486 case ELEMENT_MONTH_H: printf(CODE_LIGHT_BROWN); break;
487 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
488 case ELEMENT_SHABBAT_NAME: printf(CODE_LIGHT_AQUA); break;
489 case ELEMENT_SHABBAT_DAY: printf(CODE_LIGHT_AQUA); break;
490 case ELEMENT_HOLIDAY_DAY: printf(CODE_LIGHT_AQUA); break;
491 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_PURPLE); break;
492 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
493 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
494 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
495 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
496 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
497 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
498 }
499 /* switch (element) {
500 case ELEMENT_WEEKDAY_G: printf(CODE_LIGHT_GREY); break;
501 case ELEMENT_WEEKDAY_H: printf(CODE_LIGHT_AQUA); break;
502 case ELEMENT_MONTH_G: printf(CODE_LIGHT_GREY); break;
503 case ELEMENT_MONTH_H: printf(CODE_LIGHT_AQUA); break;
504 case ELEMENT_WEEKDAY_NAMES: printf(CODE_LIGHT_GREEN); break;
505 case ELEMENT_SHABBAT_NAME: printf(CODE_BOLD_BLUE); break;
506 case ELEMENT_SHABBAT_DAY: printf(CODE_BOLD_BLUE); break;
507 case ELEMENT_HOLIDAY_DAY: printf(CODE_BOLD_BLUE); break;
508 case ELEMENT_SHABBAT_TIMES: printf(CODE_LIGHT_BROWN); break;
509 case ELEMENT_PARASHA: printf(CODE_LIGHT_GREEN); break;
510 case ELEMENT_THIS_SHABBAT_TIMES: printf(CODE_LIGHT_GREEN); break;
511 case ELEMENT_THIS_PARASHA: printf(CODE_LIGHT_GREEN); break;
512 case ELEMENT_HOLIDAY_NAME: printf(CODE_LIGHT_GREY); break;
513 case ELEMENT_TODAY_HOLIDAY_DAY: printf(CODE_LIGHT_GREEN); break;
514 case ELEMENT_TODAY_HOLIDAY_NAME: printf(CODE_LIGHT_GREEN); break;
515 */
516 }
517
518
519
520 /**************************************************
521 * print header - month line to stdout
522 *************************************************/
523 void print_header_month_line_stdout( const header_info header, const int colorize, const int force_hebrew, const int visual_bidi )
524 {
525 char *g_month, *h1_month, *h2_month;
526 char *h1_year = NULL;
527 char *h2_year = NULL;
528 size_t g_month_len, g_year_len, h1_month_len, h2_month_len, h1_year_len, h2_year_len;
529
530
531 char *hebrew_buffer, *hebrew_buffer_next;
532 size_t hebrew_buffer_len, literals_len;
533
534 int j;
535 size_t padding = 0;
536
537
538 /**************************************************
539 * Print Gregorian month and year
540 *************************************************/
541 g_month = hdate_string( HDATE_STRING_GMONTH, header.g_month_1, HDATE_STRING_LONG, HDATE_STRING_LOCAL);
542 if (colorize) colorize_element(ELEMENT_MONTH_G);
543 printf ("%s %d", g_month, header.g_year_1);
544 if (colorize) printf(CODE_RESTORE_VIDEO);
545
546 /**************************************************
547 * Print Hebrew month and year
548 *
549 * because we want this printed right-justified on
550 * the same line, we need to calculate how many
551 * spaces to pad.
552 *
553 * because of the possible user option --bidi, we
554 * need to buffer the entire Hebrew text in order
555 * reverse its sequence for 'visual' display.
556 *
557 * This all requires collecting the data first
558 * and determining each's length.
559 *************************************************/
560
561 #define CALENDAR_WIDTH 41
562 #define DASH_WIDTH 3 // includes surrounding spaces
563 #define SPACE_WIDTH 1
564
565
566 /*************************************************
567 * padding info for gregorian date
568 *************************************************/
569 g_month_len = strlen(g_month);
570 g_year_len = 4;
571 switch (header.g_year_1)
572 {
573 case 1-9: g_year_len = 1; break;
574 case 10-99: g_year_len = 2; break;
575 case 100-999: g_year_len = 3; break;
576 }
577
578
579 /**************************************************
580 * collect padding info for Hebrew date
581 *************************************************/
582 h1_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_1, HDATE_STRING_LONG, force_hebrew);
583 h1_year = hdate_string( HDATE_STRING_INT, header.h_year_1, HDATE_STRING_SHORT, force_hebrew);
584 //printf("\nh1_month = %s; h1_year = %s, in-year = %d\n",h1_month,h1_year, header.h_year_1);exit(0);
585
586 h1_month_len = strlen(h1_month);
587 h1_year_len = strlen(h1_year);
588 // DEBUG - printf("\nh1 year value = %d, h1 year string = %s, string length = %d\n",header.h_year_1, h1_year, h1_year_len);
589 // DEBUG - int ii; for (ii=0; ii<h1_year_len; ii++) printf("%x ",h1_year[ii]);
590
591 if (header.h_year_1 != header.h_year_2)
592 {
593
594 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
595 h2_year = hdate_string(HDATE_STRING_INT, header.h_year_2, HDATE_STRING_LONG,force_hebrew);
596
597 h2_month_len = strlen(h2_month);
598 h2_year_len = strlen(h2_year);
599 literals_len = SPACE_WIDTH + DASH_WIDTH + SPACE_WIDTH;
600
601 hebrew_buffer_len = h1_month_len + h1_year_len + h2_month_len
602 + h2_year_len + literals_len;
603
604 // printf("\nlength values = %d %d %d %d %d %d\n",h1_month_len , h1_year_len , DASH_WIDTH, h2_month_len, SPACE_WIDTH , h2_year_len);
605 hebrew_buffer = malloc(hebrew_buffer_len+1);
606 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
607 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
608 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
609 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
610 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
611 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
612 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_year, h2_year_len);
613 hebrew_buffer[hebrew_buffer_len]='\0';
614
615 // printf("\nbuffer length = %d\nbuffer contents = %s\n",hebrew_buffer_len, hebrew_buffer); exit(0);
616 // free(hebrew_buffer);
617 }
618 else if (header.h_month_1 != header.h_month_2)
619 {
620 h2_month = hdate_string( HDATE_STRING_HMONTH , header.h_month_2, HDATE_STRING_LONG, force_hebrew);
621 h2_month_len = strlen(h2_month);
622 literals_len = DASH_WIDTH + SPACE_WIDTH;
623
624 hebrew_buffer_len = h1_month_len + h2_month_len + h1_year_len + literals_len;
625 hebrew_buffer = malloc(hebrew_buffer_len+1);
626 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
627 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " - ", DASH_WIDTH);
628 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h2_month, h2_month_len);
629 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
630 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
631 hebrew_buffer[hebrew_buffer_len]='\0';
632 }
633 else
634 {
635 h2_month_len = 0;
636 h2_year_len = 0;
637 literals_len = SPACE_WIDTH;
638
639 hebrew_buffer_len = h1_month_len + h1_year_len + literals_len;
640
641 hebrew_buffer = malloc(hebrew_buffer_len+1);
642 hebrew_buffer_next = mempcpy(hebrew_buffer, h1_month, h1_month_len);
643 hebrew_buffer_next = mempcpy(hebrew_buffer_next, " ", SPACE_WIDTH);
644 hebrew_buffer_next = mempcpy(hebrew_buffer_next, h1_year, h1_year_len);
645 hebrew_buffer[hebrew_buffer_len]='\0';
646 }
647
648 if (!force_hebrew)
649 padding = CALENDAR_WIDTH - g_month_len - g_year_len - hebrew_buffer_len ;
650 else
651 padding = CALENDAR_WIDTH - g_month_len - g_year_len - (hebrew_buffer_len/2) - literals_len +1;
652
653
654
655 /**************************************************
656 * print padding
657 *************************************************/
658 for (j = 1; j < (int)padding; j++) printf(" ");
659
660
661 /**************************************************
662 * Print Hebrew month and year
663 *************************************************/
664 if (colorize) colorize_element(ELEMENT_MONTH_H);
665 if (visual_bidi) revstr(hebrew_buffer, hebrew_buffer_len);
666 printf ("%s", hebrew_buffer);
667 if (colorize) printf(CODE_RESTORE_VIDEO);
668
669
670 /**************************************************
671 * free allocated memory
672 *************************************************/
673 if (h1_year != NULL) free(h1_year);
674 // if (header.h_year_1 != header.h_year_2) free(h2_year);
675 if (h2_year != NULL) free(h2_year);
676 free(hebrew_buffer);
677 }
678
679
680 /**************************************************
681 * print column headings for days of weeks
682 **************************************************/
683 void print_header_dow_line_stdout( const int colorize )
684 {
685 int column;
686
687 void print_dow_column( int column )
688 {
689 if (hdate_is_hebrew_locale())
690 { /* Hebrew heading is a single charcter per day */
691 printf ("%s%s%s", " ",
692 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_HEBREW),
693 " ");
694 }
695 else
696 { /* presume three character heading */
697 printf ("%s%3s", " ",
698 hdate_string( HDATE_STRING_DOW, column, HDATE_STRING_SHORT, HDATE_STRING_LOCAL));
699 }
700
701 if (column != 7) printf (" ");
702 }
703
704 if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES);
705 for (column = 1; column < 7; column++) print_dow_column(column);
706 if (colorize) colorize_element(ELEMENT_SHABBAT_NAME);
707 print_dow_column(7);
708 if (colorize) printf(CODE_RESTORE_VIDEO);
709 }
710
711
712
713 /**************************************************
714 * calculate start/end month/year for a calendar
715 **************************************************/
716 header_info calculate_calendar_start_end (const int month, const int year)
717 {
718 hdate_struct h;
719 header_info header;
720
721 hdate_set_gdate (&h, 1, month, year);
722 header.g_month_1 = h.gd_mon;
723 header.g_year_1 = h.gd_year;
724 header.h_month_1 = h.hd_mon;
725 header.h_year_1 = h.hd_year;
726
727
728 hdate_set_jd ( &h, hdate_gdate_to_jd ( 1, month % 12 + 1, ((month==12) ? year+1 : year) ) - 1 );
729 header.g_month_2 = h.gd_mon;
730 header.g_year_2 = h.gd_year;
731 header.h_month_2 = h.hd_mon;
732 header.h_year_2 = h.hd_year;
733
734 return header;
735 }
736
737
738 /**************************************************
739 * print header - year and month
740 *************************************************/
741 int print_header ( const int month, const int year, const option_list opt)
742 {
743 header_info previous_month, current_month, next_month;
744
745
746 /**********************************************************
747 * Preliminary - set dates for begining and end of calendar
748 **********************************************************/
749 current_month = calculate_calendar_start_end(month, year);
750 if (opt.three_month)
751 {
752 previous_month = calculate_calendar_start_end(
753 (month==1 ? 12 : month-1), (month==1 ? year-1 : year) );
754 next_month = calculate_calendar_start_end(
755 (month==12 ? 1 : month+1), (month==12 ? year+1: year) );
756 }
757
758 /**************************************************
759 * HTML output - month header line
760 *************************************************/
761 if (opt.html) print_header_month_line_html(current_month);
762
763
764 /**************************************************
765 * STDOUT output - month header line
766 *************************************************/
767 else
768 {
769 if (opt.three_month)
770 {
771 print_header_month_line_stdout(previous_month, opt.colorize, opt.force_hebrew, opt.bidi);
772 printf(" ");
773 }
774
775 print_header_month_line_stdout(current_month, opt.colorize, opt.force_hebrew, opt.bidi);
776
777 if (opt.three_month)
778 {
779 printf(" ");
780 print_header_month_line_stdout(next_month, opt.colorize, opt.force_hebrew, opt.bidi);
781 }
782 }
783
784 /**************************************************
785 * terminate line
786 **************************************************/
787 if (opt.html) printf ("</tr>\n");
788 else printf ("\n");
789
790
791 /**************************************************
792 * print column headings for days of weeks
793 **************************************************/
794 if (opt.html) print_header_dow_line_html();
795 else
796 {
797 if (opt.three_month)
798 {
799 print_header_dow_line_stdout(opt.colorize);
800 printf(" ");
801 }
802 print_header_dow_line_stdout(opt.colorize);
803 if (opt.three_month)
804 {
805 printf(" ");
806 print_header_dow_line_stdout(opt.colorize);
807 }
808 }
809
810 /**************************************************
811 * terminate line
812 **************************************************/
813 if (opt.html) printf ("</tr>\n");
814 else printf ("\n");
815
816 return 0;
817 }
818
819
820 /**************************************************
821 * print HTML calendar entry (ie. a single day)
822 *************************************************/
823 void print_day_html ( const hdate_struct h, const int month, const option_list opt)
824 {
825
826 int holiday_type;
827 // char *hd_day;
828 // hd_day = malloc(HEBREW_NUMBER_BUFFER_SIZE);
829 // char hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
830 char *hd_day_str = NULL;
831
832 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
833
834
835 if (h.gd_mon != month) printf ("<td class=\"out_of_month\">");
836 else if (h.hd_dw == SHABBAT) printf ("<td class=\"sat\">");
837 else if (holiday_type) printf ("<td class=\"holiday\">");
838 else printf ("<td class=\"regular\">");
839
840 /* Print a day */
841 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day, HDATE_STRING_LONG,opt.force_hebrew);
842 printf ("<table class=day><tr class=line1><td class=\"gday\">%2d</td>\n\
843 <td class=\"hday\">%3s&nbsp;%s</td></tr><tr class=line2><td>&nbsp;</td></tr>",
844 h.gd_day,
845 hd_day_str,
846 hdate_string( HDATE_STRING_HMONTH , h.hd_mon, HDATE_STRING_LONG, opt.force_hebrew));
847 if (holiday_type) printf ("<tr class=line3><td class=\"holiday_name\">%s</td></tr>",
848 hdate_string( HDATE_STRING_HOLIDAY,
849 hdate_get_holyday (&h, opt.diaspora),
850 HDATE_STRING_SHORT, HDATE_STRING_LOCAL)
851 );
852 else printf ("<tr class=line3><td class=\"holiday_name\">&nbsp;</td></tr>");
853
854 printf ("</table></td>\n");
855
856 if (hd_day_str != NULL) free(hd_day_str);
857 }
858
859
860 /*************************************************
861 * print stdout calendar entry (ie. a single day)
862 *************************************************/
863 void print_day ( const hdate_struct h, const int month, const option_list opt)
864 {
865
866 // for forcing Hebrew printing of Hebrew data
867 //char *language;
868
869 // char *hd_day_buffer[HEBREW_NUMBER_BUFFER_SIZE + 1];
870 // hd_day_buffer = malloc(HEBREW_NUMBER_BUFFER_SIZE + 1);
871 char *hd_day_str = NULL;
872
873 size_t hd_day_buffer_str_len;
874
875 int holiday_type;
876 holiday_type = hdate_get_holyday_type(hdate_get_holyday(&h, opt.diaspora));
877
878 /**************************************************
879 * out of month - needs padding
880 *************************************************/
881 if (h.gd_mon != month) printf(" ");
882
883
884 /**************************************************
885 * in month - print the data
886 *************************************************/
887 else
888 {
889 /*************************************************
890 * Gregorian date entry - color prefix
891 *************************************************/
892 if (h.hd_jd == opt.jd_today_g)
893 printf (CODE_REVERSE_VIDEO);
894 else if (opt.colorize)
895 {
896 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
897 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
898 else colorize_element(ELEMENT_WEEKDAY_G);
899 }
900
901 /*************************************************
902 * Gregorian date entry - the day of the month
903 *************************************************/
904 // this next line is necessary to align numbers
905 // correctly with bidi (tested using mlterm)
906 if ( (h.gd_day < 10) && (hdate_is_hebrew_locale()) )
907 printf ("%d ", h.gd_day);
908 else printf ("%2d", h.gd_day);
909
910 /*************************************************
911 * Gregorian date entry - color cleanup
912 *************************************************/
913 if ((h.hd_jd == opt.jd_today_g) || (opt.colorize))
914 printf (CODE_RESTORE_VIDEO);
915
916
917 /*************************************************
918 * holiday flag
919 *************************************************/
920 printf ("%c", holiday_flag[holiday_type]);
921
922
923 /*************************************************
924 * Hebrew date entry - color prefix
925 *************************************************/
926 if (h.hd_jd == opt.jd_today_h)
927 printf (CODE_REVERSE_VIDEO);
928 else if (opt.colorize)
929 {
930 if (h.hd_dw==7) colorize_element(ELEMENT_SHABBAT_DAY);
931 else if (holiday_type) colorize_element(ELEMENT_HOLIDAY_DAY);
932 else colorize_element(ELEMENT_WEEKDAY_H);
933 }
934
935
936 /*************************************************
937 * Hebrew date entry - day of the month
938 *************************************************/
939 hd_day_str = hdate_string(HDATE_STRING_INT, h.hd_day,HDATE_STRING_SHORT,opt.force_hebrew);
940 if (opt.bidi)
941 {
942 hd_day_buffer_str_len = (size_t) strlen(hd_day_str);
943 if ( hd_day_buffer_str_len > HEBREW_NUMBER_BUFFER_SIZE)
944 hd_day_buffer_str_len = HEBREW_NUMBER_BUFFER_SIZE - 1;
945 revstr(hd_day_str, hd_day_buffer_str_len);
946 }
947 if ( ( (opt.force_hebrew) || (hdate_is_hebrew_locale()) ) &&
948 ( (h.hd_day < 11) || (h.hd_day == 20) || (h.hd_day == 30) ) )
949 { // need to pad Hebrew dates 1-10, 20, 30
950 printf ("%s%s"," ",hd_day_str);
951 }
952 else printf ("%2s", hd_day_str);
953
954 /*************************************************
955 * Hebrew date entry - color cleanup
956 *************************************************/
957 if ((h.hd_jd == opt.jd_today_h) || (opt.colorize))
958 printf (CODE_RESTORE_VIDEO);
959
960 }
961
962 if (hd_day_str != NULL) free(hd_day_str);
963 }
964
965
966 /*************************************************
967 * print a calendar week's entry (ie. seven columns)
968 *************************************************/
969 void print_week( int jd, const int month, const option_list opt)
970 {
971 #define long_parasha_name 0
972
973 hdate_struct h;
974
975 int calendar_column;
976
977 // for opt.shabbat
978 int sun_hour, first_light, talit, sunrise;
979 int midday, sunset, first_stars, three_stars;
980 int this_week;
981 hdate_struct yom_shishi;
982
983 // for opt.parasha
984 int shabbat_name;
985 char *shabbat_name_str, *shabbat_name_buffer;
986 size_t shabbat_name_str_len;
987
988
989 // for forcing Hebrew printing of Hebrew data
990 //char *language;
991
992
993 /**************************************************
994 * for each column of calendar
995 *************************************************/
996 for (calendar_column = 0; calendar_column < 7; calendar_column++)
997 {
998
999 /**************************************************
1000 * Get this day's information
1001 *************************************************/
1002 hdate_set_jd (&h, jd);
1003 if ( ((opt.shabbat) || (opt.parasha)) && (calendar_column == 5) )
1004 yom_shishi = h;
1005
1006
1007 /**************************************************
1008 * HTML calendar option
1009 *************************************************/
1010 if (opt.html) print_day_html ( h, month, opt );
1011
1012
1013
1014 /**************************************************
1015 * non-HTML calendar option
1016 *************************************************/
1017 else print_day ( h, month, opt);
1018
1019
1020 /**************************************************
1021 * space between days of week
1022 *************************************************/
1023 if (calendar_column != 6) printf (" ");
1024
1025 /**************************************************
1026 * advance to next day of week
1027 *************************************************/
1028 jd++;
1029 }
1030
1031 /**************************************************
1032 * print end of calendar line
1033 *************************************************/
1034 if ((!opt.html) && ( (h.gd_mon == month) || (h.gd_day < SHABBAT) ) )
1035 {
1036
1037 /********************************************************
1038 * determine whether this line gets special highlighting
1039 ********************************************************/
1040 if ((opt.colorize)
1041 && ((opt.shabbat) || (opt.parasha))
1042 && ((jd - 1) > opt.jd_today_h)
1043 && (((jd - 1) - opt.jd_today_h) < 7) )
1044 this_week = TRUE;
1045 else this_week = FALSE;
1046
1047 /*************************************************
1048 * print shabbat times
1049 *************************************************/
1050 if (opt.shabbat)
1051 {
1052 // candlelighting times
1053 /// note: compiler incorrectly issued warnings:
1054 /// "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1055 /// The initialization occurs above (~line 1005) "yom_shishi = h"
1056 hdate_get_utc_sun_time (yom_shishi.gd_day, yom_shishi.gd_mon, yom_shishi.gd_year,
1057 opt.lat, opt.lon, &sunrise, &sunset);
1058
1059 // FIXME - allow for further minhag variation
1060 if (opt.candles != 1) sunset = sunset - opt.candles + opt.tz;
1061 else sunset = sunset + opt.tz - DEFAULT_CANDLES_MINUTES;
1062
1063 if (opt.colorize)
1064 {
1065 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1066 else colorize_element(ELEMENT_SHABBAT_TIMES);
1067 }
1068 printf (" %02d:%02d", sunset / 60, sunset % 60);
1069 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1070
1071 printf(" - ");
1072
1073 // motzay shabat time
1074 hdate_get_utc_sun_time_full (h.gd_day, h.gd_mon, h.gd_year, opt.lat,
1075 opt.lon, &sun_hour, &first_light, &talit,
1076 &sunrise, &midday, &sunset,
1077 &first_stars, &three_stars);
1078
1079 // FIXME - allow for further minhag variation
1080 if (opt.havdalah != 1) three_stars = sunset + opt.havdalah + opt.tz;
1081 else three_stars = three_stars + opt.tz;
1082
1083 if (opt.colorize)
1084 {
1085 if (this_week) colorize_element(ELEMENT_THIS_SHABBAT_TIMES);
1086 else colorize_element(ELEMENT_SHABBAT_TIMES);
1087 }
1088 printf ("%02d:%02d", three_stars / 60, three_stars % 60);
1089 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1090 }
1091
1092
1093 /*************************************************
1094 * print shabbat name
1095 *************************************************/
1096 if (opt.parasha)
1097 {
1098
1099 /*************************************************
1100 * print shabbat name - force-hebrew setup
1101 *************************************************/
1102 // BUG - this isn't thread-safe
1103 /*if (opt.force_hebrew)
1104 {
1105 language=getenv("LANGUAGE");
1106 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1107 }*/
1108
1109
1110 shabbat_name = hdate_get_parasha (&h, opt.diaspora);
1111 if (shabbat_name) shabbat_name_str =
1112 hdate_string( HDATE_STRING_PARASHA, shabbat_name,
1113 HDATE_STRING_SHORT, opt.force_hebrew);
1114 else
1115 {
1116 shabbat_name = hdate_get_holyday(&h, opt.diaspora);
1117 if (shabbat_name) shabbat_name_str =
1118 hdate_string( HDATE_STRING_HOLIDAY,
1119 shabbat_name,
1120 HDATE_STRING_SHORT, opt.force_hebrew);
1121 }
1122 if (shabbat_name)
1123 {
1124 if (opt.colorize)
1125 {
1126 if (this_week) colorize_element(ELEMENT_THIS_PARASHA);
1127 else colorize_element(ELEMENT_PARASHA);
1128 }
1129 if (opt.bidi)
1130 {
1131 shabbat_name_str_len = strlen(shabbat_name_str);
1132 shabbat_name_buffer = malloc(shabbat_name_str_len+1);
1133 memcpy(shabbat_name_buffer, shabbat_name_str, shabbat_name_str_len);
1134 shabbat_name_buffer[shabbat_name_str_len] = '\0';
1135 revstr(shabbat_name_buffer, shabbat_name_str_len);
1136
1137 // padding - FIXME - spaces are single-byte, while
1138 // the Hebrew characters are two bytes
1139 const int margin_max = 15;
1140 printf("%*s%s", (int)(margin_max - shabbat_name_str_len/2)," ", shabbat_name_buffer);
1141
1142 free(shabbat_name_buffer);
1143 }
1144 else printf(" %s", shabbat_name_str);
1145 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1146 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1147 }
1148 }
1149 }
1150 }
1151
1152
1153
1154
1155 /**************************************************
1156 * print month table
1157 *************************************************/
1158 int print_calendar ( const int current_month, const int current_year, const option_list opt)
1159 {
1160 hdate_struct h;
1161 int calendar_line;
1162 int max_calendar_lines = 4;
1163 /// the initializations on next line aren't truly necessary, but they do
1164 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1165 int previous_month = 1, next_month = 1;
1166 int previous_year, next_year;
1167 /// the initializations on next line aren't truly necessary, but they do
1168 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
1169 int jd_current_month, jd_previous_month = 1, jd_next_month = 1;
1170
1171 void how_many_calendar_lines( int month, int start_dow )
1172 {
1173 switch (month)
1174 {
1175 case 4:
1176 case 6:
1177 case 9:
1178 case 11: if (start_dow == 7) max_calendar_lines = 6;
1179 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1180 break;
1181 case 1:
1182 case 3:
1183 case 5:
1184 case 7:
1185 case 8:
1186 case 10:
1187 case 12: if (start_dow > 5) max_calendar_lines = 6;
1188 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1189 break;
1190 case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5;
1191 break;
1192 }
1193 }
1194
1195 /*********************************************************
1196 * Preliminaries:
1197 * - Find the first sunday(s) of each calendar
1198 * - Find number of calendar lines
1199 *********************************************************/
1200 hdate_set_gdate (&h, 1, current_month, current_year);
1201 jd_current_month = h.hd_jd - h.hd_dw + 1;
1202 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1203
1204 /*********************************************************
1205 * three months, side-by-side
1206 *********************************************************/
1207 if (opt.three_month)
1208 {
1209 /*********************************************************
1210 * previous month
1211 *********************************************************/
1212 if (current_month == 1)
1213 {
1214 previous_month = 12;
1215 previous_year = current_year - 1;
1216 }
1217 else
1218 {
1219 previous_month = current_month - 1;
1220 previous_year = current_year;
1221 }
1222 hdate_set_gdate (&h, 1, previous_month, previous_year);
1223 jd_previous_month = h.hd_jd - h.hd_dw + 1;
1224 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1225
1226 /*********************************************************
1227 * next month
1228 *********************************************************/
1229 if (current_month == 12)
1230 {
1231 next_month = 1;
1232 next_year = current_year + 1;
1233 }
1234 else
1235 {
1236 next_month = current_month + 1;
1237 next_year = current_year;
1238 }
1239 hdate_set_gdate (&h, 1, next_month, next_year);
1240 jd_next_month = h.hd_jd - h.hd_dw + 1;
1241 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1242 }
1243
1244
1245
1246 /**************************************************
1247 * maximum six lines of calendar
1248 **************************************************/
1249 for (calendar_line = 0; calendar_line < max_calendar_lines; calendar_line++)
1250 {
1251 if (opt.html) printf ("<tr>\n");
1252
1253 if (opt.three_month)
1254 {
1255 print_week(jd_previous_month, previous_month, opt);
1256 jd_previous_month = jd_previous_month + 7;
1257 printf(" ");
1258 }
1259
1260 print_week(jd_current_month, current_month, opt);
1261 jd_current_month = jd_current_month + 7;
1262
1263
1264 if (opt.three_month)
1265 {
1266 printf(" ");
1267 print_week(jd_next_month, next_month, opt);
1268 jd_next_month = jd_next_month + 7;
1269 }
1270
1271 if (opt.html) printf ("</tr>\n");
1272 else printf ("\n");
1273 }
1274
1275
1276 /**************************************************
1277 * print end of calendar
1278 *************************************************/
1279 if (opt.html) printf ("</table>\n</span>");
1280
1281 return 0;
1282 }
1283
1284
1285
1286
1287
1288
1289 /****************************************************
1290 * print month header, month table, month footnotes
1291 ****************************************************/
1292 int print_month ( const int month, const int year, const option_list opt)
1293 {
1294 hdate_struct h;
1295
1296 // following are for opt.footnote
1297 int jd_counter, holiday;
1298 //char *language; // for forcing Hebrew printing of footnote
1299
1300
1301 /* check if hebrew year (year > 3000) */
1302 if (year > 3000) hdate_set_hdate (&h, 1, month, year);
1303 else hdate_set_gdate (&h, 1, month, year);
1304
1305
1306 print_header (h.gd_mon, h.gd_year, opt);
1307 print_calendar (h.gd_mon, h.gd_year, opt);
1308 printf("\n");
1309
1310
1311 /****************************************************
1312 * print footnotes
1313 ****************************************************/
1314 if (opt.footnote)
1315 {
1316 jd_counter = h.hd_jd;
1317 while ( month == h.gd_mon )
1318 {
1319 holiday = hdate_get_holyday(&h, opt.diaspora);
1320 if (holiday)
1321 {
1322 print_day ( h, month, opt);
1323 /*if (opt.force_hebrew)
1324 {
1325 // BUG - this isn't thread-safe
1326 // --- and it may no longer be nexessary anywhere
1327 // in the code now that I've embedded Hebrew
1328 language=getenv("LANGUAGE");
1329 setenv("LANGUAGE", "he_IL.UTF-8", 1);
1330 }*/
1331 if (opt.colorize)
1332 {
1333 if (opt.jd_today_h == h.hd_jd) colorize_element(ELEMENT_TODAY_HOLIDAY_NAME);
1334 else colorize_element(ELEMENT_HOLIDAY_NAME);
1335 }
1336
1337 if (opt.bidi)
1338 {
1339 char *holiday_str, *holiday_buffer;
1340 size_t holiday_str_len;
1341 holiday_str = hdate_string( HDATE_STRING_HOLIDAY,
1342 holiday,
1343 HDATE_STRING_LONG,
1344 opt.force_hebrew);
1345
1346 holiday_str_len = strlen(holiday_str);
1347 holiday_buffer = malloc(holiday_str_len+1);
1348 memcpy(holiday_buffer, holiday_str, holiday_str_len);
1349 holiday_buffer[holiday_str_len] = '\0';
1350 revstr(holiday_buffer, holiday_str_len);
1351
1352 // padding - FIXME - spaces are single-byte, while
1353 // the Hebrew characters are two bytes
1354 const int margin_max = 16; // 15 fails because of jabotinsky in july
1355 printf("%*s%s\n", (int)(margin_max - holiday_str_len/2)," ", holiday_buffer);
1356
1357 free(holiday_buffer);
1358 }
1359 else printf (" %s\n",
1360 hdate_string( HDATE_STRING_HOLIDAY,
1361 holiday,
1362 HDATE_STRING_LONG,
1363 opt.force_hebrew));
1364
1365 if (opt.colorize) printf (CODE_RESTORE_VIDEO);
1366 //if (opt.force_hebrew) setenv("LANGUAGE", language, 1);
1367 }
1368 jd_counter++;
1369 hdate_set_jd (&h, jd_counter);
1370 }
1371 }
1372 return 0;
1373 }
1374
1375
1376 /****************************************************
1377 * read and parse config file
1378 ****************************************************/
1379 void read_config_file( FILE *config_file,
1380 option_list *opt,
1381 double* latitude,
1382 int* opt_latitude,
1383 double* longitude,
1384 int* opt_longitude,
1385 int* tz )
1386
1387 {
1388 char *input_string;
1389 size_t input_str_len = 100; // WARNING: if you change this value
1390 // you will still have to also
1391 // change a matching value below
1392 // in the statement that includes:
1393 // match_count = sscanf(input_string
1394 char *input_key = "";
1395 char *input_value = "";
1396 int line_count = 0;
1397 int menu_item = 0;
1398 size_t menu_len = 0;
1399 int match_count;
1400 int end_of_input_file = FALSE;
1401 int i;
1402 const int num_of_keys = 20;
1403 const char* key_list[] = { "SUNSET_AWARE", // 0
1404 "LATITUDE",
1405 "LONGITUDE", // 2
1406 "TIMEZONE",
1407 "DIASPORA", // 4
1408 "FORCE_ISRAEL",
1409 "PARASHA_NAMES", // 6
1410 "SHABBAT_INFO",
1411 "FOOTNOTES", // 8
1412 "FORCE_HEBREW",
1413 "OUTPUT_BIDI", //10
1414 "SUPPRESS_REVERSE_VIDEO",
1415 "COLORIZE", //12
1416 "OUTPUT_HTML",
1417 "USE_EXTERNAL_CSS_FILE",
1418 "QUIET_ALERTS",
1419 "THREE_MONTH", //16
1420 "MENU",
1421 "CANDLE_LIGHTING", //18
1422 "HAVDALAH"
1423 };
1424
1425 input_string = malloc(input_str_len+1);
1426 input_key = malloc(input_str_len+1);
1427 input_value = malloc(input_str_len+1);
1428 while ( end_of_input_file!=TRUE )
1429 {
1430 end_of_input_file = getline(&input_string, &input_str_len, config_file);
1431 if ( end_of_input_file!=TRUE )
1432 {
1433 errno = 0;
1434 // The '100' in the next statement is inelegant; it is meant to
1435 // be the value of input_str_len. Alternatively, don't malloc
1436 // input_value above, use the 'a' specifier here, and free(input_value)
1437 // at the end of every successful read and evaluation
1438 match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value);
1439 line_count++;
1440 if (errno != 0) error(0,errno,"scan error at line %d", line_count);
1441 // DEBUG - printf("line number = %d, matches made = %d, key = %s, value = %s, string = %s",
1442 // line_count, match_count, input_key, input_value, input_string);
1443 if (match_count ==2)
1444 {
1445 for (i=0; i<num_of_keys; i++)
1446 {
1447 if (strcmp(input_key, key_list[i]) == 0)
1448 {
1449 // DEBUG - printf("match found!, %s = %s, index = %d\n",input_key,key_list[i],i);
1450 switch(i)
1451 {
1452
1453 case 0:if (strcmp(input_value,"FALSE") == 0) opt->not_sunset_aware = 1;
1454 else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0;
1455 break;
1456 case 1:
1457 parse_coordinate(1, input_value, latitude, opt_latitude);
1458 break;
1459 case 2:
1460 parse_coordinate(2, input_value, longitude, opt_longitude);
1461 break;
1462 case 3:
1463 parse_timezone(input_value, tz);
1464 break;
1465 case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0;
1466 else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1;
1467 break;
1468 case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0;
1469 else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1;
1470 break;
1471 case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0;
1472 else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1;
1473 break;
1474 case 7:if (strcmp(input_value,"FALSE") == 0) opt->shabbat = 0;
1475 else if (strcmp(input_value,"TRUE") == 0)
1476 {
1477 opt->shabbat = 1;
1478 opt->parasha = 1;
1479 }
1480 break;
1481 case 8:if (strcmp(input_value,"FALSE") == 0) opt->footnote = 0;
1482 else if (strcmp(input_value,"TRUE") == 0) opt->footnote = 1;
1483 break;
1484 case 9:if (strcmp(input_value,"FALSE") == 0) opt->force_hebrew = 0;
1485 else if (strcmp(input_value,"TRUE") == 0) opt->force_hebrew = 1;
1486 break;
1487 case 10:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0;
1488 else if (strcmp(input_value,"TRUE") == 0)
1489 {
1490 opt->bidi = 1;
1491 opt->force_hebrew = 1;
1492 }
1493 break;
1494 case 11:if (strcmp(input_value,"FALSE") == 0) opt->no_reverse = 0;
1495 else if (strcmp(input_value,"TRUE") == 0) opt->no_reverse = 1;
1496 break;
1497 case 12:if (strcmp(input_value,"FALSE") == 0) opt->colorize = 0;
1498 else if (strcmp(input_value,"TRUE") == 0) opt->colorize = 1;
1499 break;
1500 case 13:if (strcmp(input_value,"FALSE") == 0) opt->html = 0;
1501 else if (strcmp(input_value,"TRUE") == 0) opt->html = 1;
1502 break;
1503 case 14:if (strcmp(input_value,"FALSE") == 0) opt->external_css = 0;
1504 else if (strcmp(input_value,"TRUE") == 0) opt->external_css = 1;
1505 break;
1506 case 15:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0;
1507 else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1;
1508 break;
1509 case 16:if (strcmp(input_value,"FALSE") == 0) opt->three_month = 0;
1510 else if (strcmp(input_value,"TRUE") == 0) opt->three_month = 1;
1511 break;
1512
1513 // MENU
1514 case 17:if (menu_item < MAX_MENU_ITEMS)
1515 {
1516 menu_len = strlen(input_value);
1517 opt->menu_item[menu_item] = malloc(menu_len+1);
1518 memcpy(opt->menu_item[menu_item], input_value,menu_len);
1519 menu_item++;
1520 }
1521 break;
1522 // CANDLE_LIGHTING
1523 case 18:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0;
1524 else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1;
1525 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1526 {
1527 opt->candles = atoi(input_value);
1528 if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES;
1529 else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES;
1530 }
1531 break;
1532
1533 // HAVDALAH
1534 case 19:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0;
1535 else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1;
1536 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1537 {
1538 opt->havdalah = atoi(input_value);
1539 if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES;
1540 else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES;
1541 }
1542 break;
1543
1544 } // end of switch(i)
1545 break; // if found a match don't continue for loop
1546 }
1547 }
1548 }
1549 }
1550 }
1551 free(input_string);
1552 free(input_key);
1553 free(input_value);
1554 return;
1555 }
1556
1557
1558 /****************************************************
1559 * exit elegantly
1560 ****************************************************/
1561 void exit_main( option_list *opt, const int exit_code)
1562 {
1563 int i;
1564 for (i=0; i<MAX_MENU_ITEMS; i++)
1565 {
1566 if (opt->menu_item[i] == NULL) break;
1567 free(opt->menu_item[i]);
1568 }
1569 exit (exit_code);
1570 }
1571
1572
1573 /****************************************************
1574 * parse a command-line or a config-file menu line
1575 *
1576 * It was appropriate to make this a function, outside
1577 * of main, because of its dual use and dual reference
1578 ****************************************************/
1579 int hcal_parser( const int switch_arg, option_list *opt,
1580 double *lat, int *opt_latitude,
1581 double *lon, int *opt_Longitude,
1582 int *tz, int long_option_index)
1583
1584 {
1585 int error_detected = 0;
1586
1587 switch (switch_arg)
1588 {
1589
1590 case 0: /* long options */
1591 switch (long_option_index)
1592 {
1593 /* --version */ case 0: print_version (); exit_main(opt, 0); break;
1594 /* --help */ case 1: print_help (); exit_main(opt, 0); break;
1595 /* --no-reverse */ case 2: opt->no_reverse = 1; break;
1596 /* --html */ case 3: break;
1597 /* --parasha */ case 4: break;
1598 /* --shabbat */ case 5: break;
1599 /* --three-month*/ case 6: break;
1600 /* --colorize */ case 7: break;
1601 /* --footnote */ case 8: break;
1602 /* --hebrew */ case 9: break;
1603 /* --israel */ case 10:break;
1604 /* --latitude */ case 11:break;
1605 /* --longitude */ case 12:break;
1606 /* --timezone */ case 13:break;
1607 /* --not-sunset-aware */ case 14: opt->not_sunset_aware = 1; break;
1608 /* --quiet-alerts*/ case 15: break;
1609 /* --visual */ case 16:
1610 /* --bidi */ case 17: break;
1611 /* --one-month */ case 18: break;
1612 /* --no-visual */ case 19:
1613 /* --no-bidi */ case 20: opt->bidi = 0; opt->force_hebrew = 0; break;
1614 /* --no-color */ case 21: opt->colorize = 0; break;
1615 /* --no-footnote*/ case 22: opt->footnote = 0; break;
1616 /* --menu */ case 23: break;
1617 /* --candles */ case 24:
1618 if ( (optarg == NULL) && (opt->candles == 0) )opt->candles = 1;
1619 else
1620 {
1621 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1622 {
1623 opt->candles = atoi(optarg);
1624 if ( (opt->candles >= MIN_CANDLES_MINUTES) &&
1625 (opt->candles <= MAX_CANDLES_MINUTES) ) break;
1626 }
1627 print_parm_error("--candles");
1628 error_detected++;
1629 }
1630 break;
1631 /* --havdalah */ case 25:
1632 if ( (optarg == NULL) && (opt->havdalah == 0) ) opt->havdalah = 1;
1633 else
1634 {
1635 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1636 {
1637 opt->havdalah = atoi(optarg);
1638 if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) &&
1639 (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break;
1640 }
1641 print_parm_error("--havdalah");
1642 error_detected++;
1643 }
1644 break;
1645
1646 } // end switch for long_options
1647 break;
1648
1649
1650 case '1': opt->three_month = 0; break;
1651 case '3': opt->three_month = 1; break;
1652 case 'b': opt->bidi = 1; opt->force_hebrew = 1; break;
1653 case 'c': opt->colorize = 1; break;
1654 case 'd': opt->diaspora = 1; break;
1655 case 'f': opt->footnote = 1; break;
1656 case 'h': opt->html = 1; break;
1657 case 'H': opt->force_hebrew = 1; break;
1658 case 'I': opt->force_israel = 1; break;
1659 case 'i': opt->external_css = 1; break;
1660 case 'm': opt->menu = 1; break;
1661 case 'p': opt->parasha = 1; break;
1662 case 'q': opt->quiet_alerts = 1; break;
1663 case 'l':
1664 error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude);
1665 break;
1666 case 'L':
1667 error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude);
1668 break;
1669 case 's':
1670 opt->shabbat = 1;
1671 opt->parasha = 1;
1672 if (opt->candles == 0) opt->candles = 1;
1673 if (opt->havdalah == 0) opt->havdalah = 1;
1674 break;
1675 case 'z':
1676 error_detected = error_detected + parse_timezone(optarg, tz);
1677 break;
1678 case '?':
1679 // FIXME if (strchr(short_options,optopt)!=NULL)
1680 print_parm_missing_error((char*) &optopt);
1681 error_detected = TRUE;
1682 break;
1683 default: print_usage_hcal (); exit_main(opt, 0); break;
1684 }
1685 return error_detected;
1686 }
1687
1688 /**************************************************
1689 ***************************************************
1690 ***************************************************
1691 * main
1692 ***************************************************
1693 ***************************************************
1694 **************************************************/
1695 int main (int argc, char *argv[])
1696 {
1697
1698 /* date */
1699 int month, year;
1700
1701 double lat = BAD_COORDINATE; /* set to this value for error handling */
1702 double lon = BAD_COORDINATE; /* set to this value for error handling */
1703 int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */
1704
1705 int opt_latitude = 0; /* -l option latitude */
1706 int opt_Longitude = 0; /* -L option longitude */
1707
1708 int error_detected = FALSE; /* exit after reporting ALL bad parms */
1709
1710
1711 option_list opt;
1712 opt.bidi = 0; // visual bidi, implies --force-hebrew
1713 opt.html = 0; // -h html format flag
1714 opt.diaspora = 0; // -d Diaspora holidays
1715 opt.external_css = 0; // -i External css file
1716 opt.parasha = 0; // -p print parasha alongside calendar
1717 opt.shabbat = 0; // -c print candle-lighting alongside calendar
1718 opt.candles = 0;
1719 opt.havdalah = 0;
1720 opt.no_reverse = 0; // don't highlight today in reverse video
1721 opt.three_month = 0; // print previous and next months also
1722 opt.colorize = 0; // display calendar in muted, more pleasing tones
1723 opt.footnote = 0; // display description of month's holidays
1724 opt.force_hebrew = 0; // force display of Hebrew data in Hebrew
1725 opt.force_israel = 0; // override diaspora-awareness
1726 opt.not_sunset_aware = 0; // override sunset-awareness
1727 opt.quiet_alerts = 0;
1728
1729 opt.lat = BAD_COORDINATE;
1730 opt.lon = BAD_COORDINATE;
1731 opt.tz = BAD_TIMEZONE;
1732
1733 opt.menu = 0; // -m print menus for user-selection
1734 int i;
1735 for (i=0; i<MAX_MENU_ITEMS; i++) opt.menu_item[i] = NULL;
1736
1737
1738 // support for getopt short options
1739 static char * short_options = "13bcdfhHiImpqsl:L:z:";
1740
1741 /* support for long options */
1742 int long_option_index = 0;
1743 int c;
1744 static struct option long_options[] = {
1745 // name, has_arg, flag, val
1746 {"version", 0, 0, 0},
1747 {"help", 0, 0, 0},
1748 {"no-reverse", 0, 0, 0},
1749 {"html", 0, 0, 'h'},
1750 {"parasha", 0, 0, 'p'},
1751 {"shabbat", 0, 0, 's'},
1752 {"three-month", 0, 0, '3'},
1753 {"colorize", 0, 0, 'c'},
1754 {"footnote",0,0,'f'},
1755 {"hebrew",0,0,'H'},
1756 {"israel",0,0,'I'},
1757 {"latitude", 1, 0, 'l'},
1758 {"longitude", 1, 0, 'L'},
1759 {"timezone", 1, 0, 'z'},
1760 {"not-sunset-aware", 0, 0, 0},
1761 {"quiet-alerts",0,0,'q'},
1762 {"bidi",0,0,'b'},
1763 {"visual",0,0,'b'},
1764 {"one-month",0,0,'1'},
1765 {"no-bidi",0,0,0},
1766 {"no-visual",0,0,0},
1767 {"no-color",0,0,0},
1768 {"no-footnote",0,0,0},
1769 {"menu",0,0,'m'},
1770 {"candles",2,0,0},
1771 {"havdalah",2,0,0},
1772 {0, 0, 0, 0}
1773 };
1774
1775 /* hdate struct */
1776 hdate_struct h;
1777
1778 // for config file user-defined menus
1779 size_t menu_len = 0;
1780 int menu_index;
1781 char *menuptr, *optptr;
1782
1783 /************************************************************
1784 * init locale
1785 *
1786 * I'm not sure why this had to be done. Per an answer on
1787 * stackoverflow (not yet check out by me):
1788 *
1789 * "At program startup, you should call setlocale():
1790 * setlocale(LC_CTYPE, "");
1791 * This will cause the wide character functions to use the
1792 * appropriate character set defined by the environment - eg.
1793 * on Unix-like systems, the LANG environment variable. For
1794 * example, this means that if your LANG variable is set to a
1795 * UTF8 locale, the wide character functions will handle input
1796 * and output in UTF8. (This is how the POSIX wc utility is
1797 * specified to work). You can then use the wide-character
1798 * versions of all the standard functions. However, if you
1799 * really do want to count characters rather than bytes, and
1800 * can assume that your text files are encoded in UTF-8, then
1801 * the easiest approach is to count all bytes that are not
1802 * trail bytes (i.e., in the range 0x80 to 0xBF)."
1803 *
1804 * Note: the code sets LC_ALL instead of LC_CTYPE; and the
1805 * code does not use wide_char functions ...
1806 ************************************************************/
1807 setlocale (LC_ALL, "");
1808
1809 /************************************************************
1810 * parse config file
1811 ************************************************************/
1812 FILE *config_file = get_config_file("/hcal", "/hcalrc", hcal_config_file_text);
1813 if (config_file != NULL)
1814 {
1815 read_config_file(config_file, &opt, &lat, &opt_latitude, &lon, &opt_Longitude, &tz);
1816 fclose(config_file);
1817 }
1818
1819
1820
1821 /************************************************************
1822 * parse command line
1823 ************************************************************/
1824 while ((c = getopt_long(argc, argv,
1825 short_options, long_options,
1826 &long_option_index)) != -1)
1827 error_detected = error_detected
1828 + hcal_parser(c, &opt,
1829 &lat, &opt_latitude,
1830 &lon, &opt_Longitude,
1831 &tz, long_option_index);
1832
1833
1834 /**************************************************
1835 * BEGIN - enable user-defined menu
1836 *************************************************/
1837 if (opt.menu)
1838 {
1839 i = menu_select( &opt.menu_item[0], MAX_MENU_ITEMS );
1840 if (i == -1) exit_main(&opt, 0);
1841 else if ((i < MAX_MENU_ITEMS) && (opt.menu_item[i] != NULL))
1842 {
1843
1844 /**************************************************
1845 * parse user's menu selection
1846 *************************************************/
1847 menuptr = opt.menu_item[i];
1848 menu_len = strlen( menuptr );
1849 menu_index = 0;
1850 optptr = NULL;
1851 optarg = NULL;
1852
1853 while (( c = menu_item_parse( menuptr, menu_len, &menu_index,
1854 &optptr, short_options, long_options,
1855 &long_option_index, &error_detected) ) != -1)
1856 {
1857 error_detected = error_detected +
1858 hcal_parser(c, &opt,
1859 &lat, &opt_latitude,
1860 &lon, &opt_Longitude,
1861 &tz, long_option_index);
1862 }
1863 }
1864 }
1865 /**************************************************
1866 * END - enable user-defined menu
1867 *************************************************/
1868
1869
1870 /**************************************************
1871 * sanity check - options compatability
1872 *************************************************/
1873 if ( (opt.three_month) &&
1874 ((opt.parasha) || (opt.shabbat) || (opt.footnote) ) )
1875 {
1876 error(0,0,"%s", N_("ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-month' mode"));
1877 opt.parasha = 0;
1878 opt.shabbat = 0;
1879 opt.footnote = 0;
1880 }
1881
1882 /************************************************************
1883 * function validate_location is defined in the include file
1884 * ./location.include.c
1885 * It issues an exit(EXIT_CODE_BAD_PARMS) [==1]
1886 * if it discovers, um, bad parameters
1887 ************************************************************/
1888 validate_location(opt_latitude, opt_Longitude, &lat, &lon, &tz,
1889 opt.quiet_alerts, error_detected, print_usage_hcal);
1890 opt.lat = lat;
1891 opt.lon = lon;
1892 opt.tz = tz;
1893
1894 /************************************************************
1895 * determine what day to highlight (ie. what is today)
1896 ************************************************************/
1897 if ((opt.no_reverse) || (opt.html))
1898 {
1899 // user doesn't want any highlighting
1900 opt.jd_today_g = 0;
1901 opt.jd_today_h = 0;
1902 }
1903 else
1904 {
1905 hdate_set_gdate (&h, 0, 0, 0);
1906 opt.jd_today_g = h.hd_jd;
1907 if ((!opt.not_sunset_aware) &&
1908 (check_for_sunset(&h, lat, lon, tz)) )
1909 opt.jd_today_h = h.hd_jd + 1;
1910 else opt.jd_today_h = h.hd_jd;
1911 }
1912
1913 /**************************************************
1914 * parse and vaildate date parameters
1915 **************************************************/
1916
1917
1918 /**************************************************
1919 * no date parameter provided - use current mm yyyy
1920 * and no need to validate parameters
1921 **************************************************/
1922 if (argc == (optind))
1923 {
1924 if ((opt.not_sunset_aware) || (opt.no_reverse) || (opt.html))
1925 // call function only if not already called
1926 // for sunset awareness, above.
1927 hdate_set_gdate (&h, 0, 0, 0); // today
1928 month = h.gd_mon;
1929 year = h.gd_year;
1930 }
1931 else
1932 {
1933 /********************************************************
1934 * additional parameters provided - get them and validate
1935 ********************************************************/
1936 if (argc == (optind + 2))
1937 {
1938 month = atoi (argv[optind]);
1939 year = atoi (argv[optind + 1]);
1940 }
1941 else if (argc == (optind + 1))
1942 {
1943 month = 0;
1944 year = atoi (argv[optind]);
1945 }
1946 else
1947 {
1948 error(0,0,"%s: %s", N_("error"), N_("too many parameters received. expected [[mm] [yyyy]"));
1949 exit_main(&opt, 0);
1950 }
1951
1952 /********************************************************
1953 * parameter validation - year
1954 ********************************************************/
1955 if (!validate_hdate(CHECK_YEAR_PARM, 0, month, year))
1956 {
1957 print_parm_error(N_("year"));
1958 exit_main(&opt, 0);
1959 }
1960 /********************************************************
1961 * parameter validation - month
1962 ********************************************************/
1963 if ((month!=0) && (!validate_hdate(CHECK_MONTH_PARM, 0, month, year)))
1964 {
1965 print_parm_error(N_("month"));
1966 exit_main(&opt, 0);
1967 }
1968 }
1969
1970
1971 /************************************************************
1972 * begin processing the user request
1973 ************************************************************/
1974
1975 /************************************************************
1976 * diaspora awareness
1977 ************************************************************/
1978 if (opt.force_israel) opt.diaspora = 0;
1979 else
1980 {
1981 tzset();
1982 // system timezone is denominated in seconds
1983 if ( (timezone/-3600) != 2) opt.diaspora = 1;
1984 }
1985
1986 /************************************************************
1987 * print HTML header
1988 ************************************************************/
1989 if (opt.html) print_header_html (opt.external_css, opt.force_hebrew);
1990
1991
1992 /************************************************************
1993 * print one year
1994 ************************************************************/
1995 if (month == 0)
1996 {
1997 if (opt.three_month)
1998 for (month=2; month<13; month=month+3) print_month (month, year, opt);
1999 else for (month=1; month<13; month++)
2000 {
2001 print_month (month, year, opt);
2002 if ((opt.footnote) && month<12) printf("\n");
2003 }
2004 }
2005
2006
2007 /************************************************************
2008 * print only this month
2009 ************************************************************/
2010 else print_month (month, year, opt);
2011
2012
2013 /************************************************************
2014 * print HTML footer
2015 ************************************************************/
2016 if (opt.html) print_html_footer ();
2017
2018 exit_main(&opt, 0);
2019 return 0;
2020 }
0 /* hdate.c http://libhdate.sourceforge.net
1 * Hebrew date/times information(part of package libhdate)
2 *
3 * compile:
4 * gcc `pkg-config --libs --cflags libhdate` hdate.c -o hdate
5 *
6 * Copyright: 2011-2012 (c) Baruch Baum, 2004 (c) Yaacov Zamir
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #define _GNU_SOURCE // For mempcpy, asprintf
23 #include <hdate.h> // For hebrew date
24 //#include "../../src/hdate.h"
25 #include <stdlib.h> // For atoi, getenv, setenv
26 #include <locale.h> // For setlocale
27 #include <getopt.h> // For getopt_long
28 #include <string.h> // For strchr, mempcpy, asprintf
29
30 #include "./local_functions.c"
31
32 #define DATA_WAS_NOT_PRINTED 0
33 #define DATA_WAS_PRINTED 1
34
35 // for opt.menu[MAX_MENU_ITEMS]
36 #define MAX_MENU_ITEMS 10
37
38
39 char *debug_var; // system environment variable
40
41 static char * sunrise_text = N_("sunrise");
42 static char * sunset_text = N_("sunset");
43 static char * first_light_text = N_("first_light");
44 static char * talit_text = N_("talit");
45 static char * midday_text = N_("midday");
46 static char * first_stars_text = N_("first_stars");
47 static char * three_stars_text = N_("three_stars");
48 static char * sun_hour_text = N_("sun_hour");
49 static char * candles_text = N_("candle-lighting");
50 static char * havdalah_text = N_("havdalah");
51
52 typedef struct {
53 int hebrew;
54 int bidi;
55 int yom;
56 int leShabbat;
57 int leSeder;
58 int tablular_output;
59 int not_sunset_aware;
60 int print_tomorrow;
61 int quiet_alerts;
62 int sun;
63 int candles;
64 int havdalah;
65 int times;
66 int short_format;
67 int only_if_holiday;
68 int holidays;
69 int omer;
70 int only_if_parasha;
71 int parasha;
72 int julian;
73 int diaspora;
74 int iCal;
75 int menu;
76 char* menu_item[MAX_MENU_ITEMS];
77 } option_list;
78
79
80 const char* hdate_config_file_text = N_("\
81 # configuration file for hdate - Hebrew date information program\n\
82 # part of package libhdate\n\
83 #\n# Should you mangle this file and wish to restore its default content,\n\
84 # rename or delete this file and run hdate; hdate will automatically\n\
85 # regenerate the default content.\n#\n\
86 # Your system administrator can set system-wide defaults for hcal by\n\
87 # modifying file <not yet implemented>.\n\
88 # You may override all defaults by changing the contents of this file.\n\
89 #\n\
90 # Version information\n\
91 # This may be used by updates to hcal to determine how to parse the file\n\
92 # and whether additional information and options should be appended to\n\
93 # the end of this file.\n\
94 VERSION=2.00\n\
95 #\n\
96 # Location awareness\n\
97 # hdate wants to accurately highlight the current Hebrew day, including\n\
98 # during the hours between sunset and secular midnight. If you don't\n\
99 # provide it with latitude, longitude, and time zone information, hdate\n\
100 # will try to guess the information, based upon your system timezone,\n\
101 # and its (limited, and maybe biased) of the dominant Jewish community\n\
102 # in that timezone. When hdate is forced to guess, it alerts the user\n\
103 # with a message that includes the guessed location.\n\
104 # hdate's guesses will also affect its default behaviour for ouput of\n\
105 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\
106 #SUNSET_AWARE=TRUE\n\
107 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
108 # degrees[:minutes[:seconds]] with the characters :'\" as possible\n\
109 # delimiters. Use negative values to indicate South and West, or\n\
110 # use the abbreviated compass directions N, S, E, W.\n\
111 #LATITUDE=\n\
112 #LONGITUDE=\n\
113 # TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n\
114 # with the characters :'\" as possible delimiters.\n\
115 #TIMEZONE=\n\n\
116 # Output in hebrew characters\n\
117 # hdate defaults to output all information in your default language, so\n\
118 # if your default language is Hebrew, you're all set. Otherwise, you can\n\
119 # set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n\
120 # still outputting gregorian information in your default language. To\n\
121 # output ALL information in Hebrew, run something like this:\n\
122 # LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n\
123 # If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n\
124 # output, you need to install a terminal font that includes the Hebrew\n\
125 # character set (hint: unicode).\n\
126 #FORCE_HEBREW=FALSE\n\n\
127 # The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n\
128 # Unfortunately, the world can not be depended upon to be either. Most\n\
129 # Xwindow applications will display the data fine with FORCE_HEBREW; most\n\
130 # xterm implementations will not. (in fact, the only xterm clone I know\n\
131 # of that comes close is mlterm). If using FORCE_HEBREW results in\n\
132 # Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n\
133 # This will reverse the order of the Hebrew characters, so they will\n\
134 # display 'visual'ly correct; however, such output will not be suitable\n\
135 # for piping or pasting to many other applications. Setting OUTPUT_BIDI\n\
136 # automatically forces hebrew.\n\
137 #OUTPUT_BIDI=FALSE\n\n\
138 # The Hebrew language output of Hebrew information can also be 'styled'\n\
139 # in the following ways:\n\
140 # option YOM ~> yom shishi, aleph tishrei ...\n\
141 # option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n\
142 # option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n\
143 #YOM=FALSE\n\
144 #LESHABBAT=FALSE\n\
145 #LESEDER=FALSE\n\
146 \n\
147 #SUN_RISE_SET=FALSE\n\
148 #TIMES_OF_DAY=FALSE\n\
149 #SHORT_FORMAT=FALSE\n\
150 #SEFIRAT_HAOMER=FALSE\n\
151 #DIASPORA=FALSE\n\
152 \n\
153 \n\
154 # Shabbat related\n\
155 # Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n\
156 # The command line options for these features are -r (--parasha), and\n\
157 # -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n\
158 # before sunset). The HAVDALAH field can accept a value of 20 - 90\n\
159 # (minutes after sunset).\n\
160 #PARASHA_NAMES=FALSE\n\
161 #ONLY_IF_PARASHA_IS_READ=FALSE\n\
162 #SHABBAT_INFO=FALSE\n\n\
163 #CANDLE_LIGHTING=FALSE\n\
164 #HAVDALAH=FALSE\n\n\
165 # Holiday related\n\
166 #HOLIDAYS=FALSE\n\
167 #ONLY_IF_HOLIDAY=FALSE\n\n\
168 # Tabular output\n\
169 # This option has hdate output the information you request in a single\n\
170 # comma-delimited line per day, suitable for piping or import to\n\
171 # spreadsheet formatting applications, etc. To belabor the obvious,\n\
172 # try running - ./hdate 12 2011 -Rt --table |column -s, -t \n\
173 # The command line option for this feature is, um, --table\n\
174 #TABULAR=FALSE\n\n\
175 # iCal format\n\
176 # hdate can output its information in iCal-compatable format\n\
177 # ICAL=FALSE\n\
178 # Suppress alerts and warnings\n\
179 # hdate alerts the user via STDERR when it guesses the user's location.\n\
180 #QUIET_ALERTS=FALSE\n\n\
181 # Julian day number\n\
182 # The Julian day number is a .... See ... for more details.\n\
183 # setting the option JULIAN_DAY will have hdate output that number in\n\
184 # the format JDN-nnnnnnn at the beginning of its first line of output.\n\
185 #JULIAN_DAY=FALSE\n\n\
186 # User-defined menus\n\
187 # You may specify here command-line strings to optionally be parsed\n\
188 # by hcal at execution time. To do so, use the command line option -m\n\
189 # (--menu). hcal will process first the settings of this config file,\n\
190 # then the other settings of your command line, and then will prompt\n\
191 # you for which menu item you would like to select. hcal will process\n\
192 # your menu selection as if it were a new command line, further modifying\n\
193 # all the prior settings.\n\
194 # Only the first ten \"MENU=\" entries will be read. Each line will be\n\
195 # truncated at one hundred characters\n\
196 #MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n\
197 #MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n\
198 #MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n\
199 #MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n\
200 ");
201
202
203 /************************************************************
204 * print version information
205 ************************************************************/
206 int print_version ()
207 {
208 printf ("%s\n" ,N_("hdate - display Hebrew date information\nversion 1.6"));
209 return 0;
210 }
211
212 /************************************************************
213 * print usage information
214 ************************************************************/
215 void print_usage_hdate ()
216 {
217 printf ("%s\n",
218 N_("Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n\
219 hdate [options] [coordinates timezone] [julian_day]\n\n\
220 coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n\
221 -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n\
222 timezone: -z nn[( .nn | :mm )]\n\
223 Try \'hdate --help\' for more information"));
224 }
225
226
227 /************************************************************
228 * print help information
229 ************************************************************/
230 void print_help ()
231 {
232 print_usage_hdate();
233
234 printf ("%s\n", N_("hdate - display Hebrew date information\nOPTIONS:\n\
235 -b --bidi prints hebrew in reverse (visual)\n\
236 --visual\n\
237 -c print Shabbat start/end times.\n\
238 --candles modify default minhag of 20 minutes. (17<n<91)\n\
239 --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n\
240 -d --diaspora use diaspora reading and holidays.\n\
241 -h --holidays print holidays.\n\
242 -H print only it is a holiday.\n\
243 -i --ical use iCal formated output.\n\
244 -j --julian print Julian day number.\n\
245 -m --menu prompt user-defined menu from config file\n\
246 -o --omer print Sefirat Haomer.\n\
247 -q --quiet-alerts suppress warning messages\n\
248 -r --parasha print weekly reading on saturday.\n\
249 -R print only if there is a weekly reading on Shabbat.\n\
250 -s --sun print sunrise/sunset times.\n\
251 -S --short-format print using short format.\n\
252 -t print day times: first light, talit, sunrise,\n\
253 midday, sunset, first stars, three stars.\n\
254 -T --table tabular output, suitable for spreadsheets\n\n\
255 -z --timezone nn timezone, +/-UTC\n\
256 -l --latitude yy latitude yy degrees. Negative values are South\n\
257 -L --longitude xx longitude xx degrees. Negative values are West\n\n\
258 --hebrew forces Hebrew to print in Hebrew characters\n\
259 --yom force Hebrew prefix to Hebrew day of week\n\
260 --leshabbat insert parasha between day of week and day\n\
261 --leseder insert parasha between day of week and day\n\
262 --not-sunset-aware don't display next day if after sunset\n\n\
263 All options can be made default in the config file, or menu-ized for\n\
264 easy selection."));
265 }
266
267
268 /************************************************************
269 * begin - error message functions
270 ************************************************************/
271 void print_alert_sunset ()
272 {
273 error(0,0,"%s", N_("ALERT: The information displayed is for today's Hebrew date.\n \
274 Because it is now after sunset, that means the data is\n \
275 for the Gregorian day beginning at midnight."));
276 }
277 /************************************************************
278 * end - error message functions
279 ************************************************************/
280
281
282
283
284
285 /************************************************************
286 * generic print astronomical time
287 ************************************************************/
288 void print_astronomical_time( const char *description, const int timeval, const int tz)
289 {
290 if (timeval < 0) printf("%s: --:--\n", description);
291 else printf("%s: %02d:%02d\n", description,
292 (timeval+tz) / 60, (timeval+tz) % 60 );
293 return;
294 }
295
296 /************************************************************
297 * generic print astronomical time for tablular output
298 ************************************************************/
299 void print_astronomical_time_tabular( const int timeval, const int tz)
300 {
301 if (timeval < 0) printf(",--:--");
302 else printf(",%02d:%02d",
303 (timeval+tz) / 60, (timeval+tz) % 60 );
304 return;
305 }
306
307
308
309
310 /************************************************************
311 * print iCal header
312 ************************************************************/
313 int print_ical_header ()
314 {
315 /* Print start of iCal format */
316 printf ("BEGIN:VCALENDAR\n");
317 printf ("VERSION:2.0\n");
318 printf ("CALSCALE:GREGORIAN\n");
319 printf ("METHOD:PUBLISH\n");
320
321 return 0;
322 }
323
324
325
326
327 /************************************************************
328 * print iCal footer
329 ************************************************************/
330 int print_ical_footer ()
331 {
332 /* Print end of iCal format */
333 printf ("END:VCALENDAR\n");
334
335 return 0;
336 }
337
338
339
340
341
342 /************************************************************
343 * find Shabbat
344 * this function is to become obsolete - I want a feature
345 * for this standard in libhdate
346 ************************************************************/
347 int find_shabbat (hdate_struct * h, int opt_d)
348 {
349 hdate_struct coming_Shabbat;
350
351 hdate_set_jd (&coming_Shabbat, h->hd_jd+(7-h->hd_dw));
352 /* this return value is the reading number,
353 used to print parshiot */
354 return hdate_get_parasha (&coming_Shabbat, opt_d);
355 }
356
357
358
359 /************************************************************
360 * print one date - both Gregorian and Hebrew
361 ************************************************************/
362 int print_date (hdate_struct * h, hdate_struct * tomorrow, option_list opt, double lat, double lon)
363 {
364 char *motzash = ""; // prefix for Saturday night
365 char *eve_before = ""; // prefix if after sunset
366 char *for_day_of_g = ""; // Hebrew prefix for day of week
367 char *apostrophe = ""; // Hebrew suffix for day of week
368 char *bet_g = ""; // Hebrew prefix for Gregorian month
369 char *bet_h = ""; // Hebrew prefix for Hebrew month
370 char *psik_mark = ""; // --force-yom
371 char *for_day_of_h = ""; // --force-yom
372 char *for_week_of = ""; // --force-leshabbat --force-leseder
373 int is_parasha_read;
374 int h_dow_form = HDATE_STRING_SHORT;
375
376 char *hday_int_str, *hyear_int_str;
377 hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
378 hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
379
380 /*
381 #ifdef ENABLE_NLS
382 locale = setlocale (LC_MESSAGES, NULL);
383 language = getenv ("LANGUAGE");
384 #else
385 locale = NULL;
386 language = NULL;
387 #endif
388 */
389
390 /************************************************************
391 * preliminary - if it's after sunset, it's tomorrow already
392 * but we will only acknowledge this if printing in the long
393 * format (which is the default)
394 ************************************************************/
395 if (opt.print_tomorrow)
396 {
397 if (opt.hebrew)
398 {
399 if (h->hd_dw==7) motzash = "מוצ\"ש, ";
400 if (h->hd_dw==6) eve_before = "ליל";
401 else eve_before = "אור ל";
402 if (!opt.yom) for_day_of_h="-";
403 }
404 else eve_before = N_("eve of ");
405 }
406
407
408 /************************************************************
409 * preliminary - prepare Hebrew prefixes if forcing any Hebrew
410 ************************************************************/
411 if (opt.hebrew)
412 {
413 bet_h="ב";
414 /* preliminary - prepare Yom prefix */
415 if (opt.yom)
416 {
417 if ( !((opt.print_tomorrow) && (h->hd_dw==6))) for_day_of_h="יום";
418 if ( ((h->hd_dw!=7) || ((h->hd_dw==7) && (opt.print_tomorrow))) &&
419 ( !((opt.print_tomorrow) && (h->hd_dw==6))) ) apostrophe = "'";
420 if ((h->hd_dw==6) && (opt.print_tomorrow)) h_dow_form = HDATE_STRING_LONG;
421 psik_mark=",";
422
423 if (opt.leShabbat)
424 {
425 if (h->hd_dw==7) for_week_of="פרשת";
426 else for_week_of="לשבת";
427 }
428 else if (opt.leSeder) for_week_of="לסדר";
429 }
430 }
431
432 /************************************************************
433 * preliminary - prepare the Hebrew prefixes
434 * for the Gregorian month and day of week
435 ************************************************************/
436 if (hdate_is_hebrew_locale())
437 { bet_g="ב"; for_day_of_g="יום ";}
438
439
440
441 /************************************************************
442 * Three major print formats: iCal, short, long
443 ************************************************************/
444
445
446 /************************************************************
447 * iCal format
448 ************************************************************/
449 if (opt.iCal)
450 {
451 printf ("%s%s %s%s ", for_day_of_g, hday_int_str, bet_h,
452 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew));
453
454 printf ("%s", hyear_int_str);
455 }
456
457
458 /************************************************************
459 * short format
460 ************************************************************/
461 else if (opt.short_format)
462 {
463 printf ("%d.%d.%d ", h->gd_day, h->gd_mon, h->gd_year);
464
465
466 if (!hdate_is_hebrew_locale() && (!opt.hebrew))
467 {
468 printf ("%d", h->hd_day);
469 }
470 else
471 {
472 printf ("%s", hday_int_str);
473 }
474
475 printf (" %s %s\n",
476 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
477 hyear_int_str);
478 }
479
480
481 /************************************************************
482 * long (normal) format
483 ************************************************************/
484 else
485 {
486 /************************************************************
487 * Gregorian date - the easy part
488 ************************************************************/
489 printf ("%s%s, %d %s%s %d, ",
490 for_day_of_g,
491 hdate_string( HDATE_STRING_DOW, h->hd_dw, opt.short_format, HDATE_STRING_LOCAL),
492 h->gd_day,
493 bet_g,
494 hdate_string( HDATE_STRING_GMONTH, h->gd_mon, opt.short_format, HDATE_STRING_LOCAL),
495 h->gd_year);
496
497
498 /************************************************************
499 * Start of the Hebrew date
500 ************************************************************/
501 if (opt.print_tomorrow) *h = *tomorrow;
502
503
504 /************************************************************
505 * All these definitions were backports to enable bidi
506 ************************************************************/
507 char *hebrew_buffer, *hebrew_buffer1, *hebrew_buffer2, *hebrew_buffer3, *hebrew_buffer4, *hebrew_buffer_next;
508 size_t hebrew_buffer_len = 0;
509 size_t hebrew_buffer1_len = 0;
510 size_t hebrew_buffer2_len = 0;
511 size_t hebrew_buffer3_len = 0;
512 size_t hebrew_buffer4_len = 0;
513
514
515 /************************************************************
516 * prepare buffers with Hebrew day of week, including
517 * possibly Shabbat name
518 ************************************************************/
519 if (opt.hebrew)
520 {
521 if (opt.yom)
522 {
523 hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s%s%s %s%s", motzash, eve_before, for_day_of_h,
524 hdate_string( HDATE_STRING_DOW, h->hd_dw, h_dow_form, opt.hebrew), apostrophe);
525 if ((opt.leShabbat) || (opt.leSeder))
526 {
527 is_parasha_read = find_shabbat(h, opt.diaspora);
528 if (is_parasha_read)
529 hebrew_buffer2_len = asprintf(&hebrew_buffer2, " %s %s", for_week_of,
530 hdate_string( HDATE_STRING_PARASHA, is_parasha_read, opt.short_format, opt.hebrew)
531 );
532 }
533 hebrew_buffer3_len = asprintf (&hebrew_buffer3, "%s ", psik_mark);
534 }
535 }
536 else hebrew_buffer1_len = asprintf(&hebrew_buffer1, "%s", eve_before);
537
538
539 hday_int_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
540 hyear_int_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
541 /************************************************************
542 * prepare buffers with Hebrew dd mmmm yyyy
543 ************************************************************/
544 hebrew_buffer4_len =
545 asprintf (&hebrew_buffer4, "%s %s%s %s",
546 hday_int_str,
547 bet_h,
548 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
549 hyear_int_str);
550
551 /************************************************************
552 * prepare another GrUB - grand unified buffer
553 ************************************************************/
554 hebrew_buffer_len = hebrew_buffer1_len + hebrew_buffer2_len + hebrew_buffer3_len + hebrew_buffer4_len;
555 hebrew_buffer = malloc(hebrew_buffer_len+1);
556
557 hebrew_buffer_next = mempcpy(hebrew_buffer, hebrew_buffer1, hebrew_buffer1_len);
558 if (hebrew_buffer2_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer2, hebrew_buffer2_len);
559 if (hebrew_buffer3_len > 0) hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer3, hebrew_buffer3_len);
560 hebrew_buffer_next = mempcpy(hebrew_buffer_next, hebrew_buffer4, hebrew_buffer4_len);
561 hebrew_buffer[hebrew_buffer_len]='\0';
562 /************************************************************
563 * bidi support (what all the buffering was for)
564 ************************************************************/
565 if (opt.bidi) revstr(hebrew_buffer, hebrew_buffer_len);
566
567 /************************************************************
568 * Finally. print the information
569 ************************************************************/
570 printf ("%s\n", hebrew_buffer);
571
572 /************************************************************
573 * CLEANUP - free allocated memory
574 ************************************************************/
575 if (hebrew_buffer1_len > 0) free(hebrew_buffer1);
576 if (hebrew_buffer2_len > 0) free(hebrew_buffer2);
577 if (hebrew_buffer3_len > 0) free(hebrew_buffer3);
578 free(hebrew_buffer4);
579 free(hebrew_buffer);
580 }
581
582
583 /************************************************************
584 * CLEANUP - free allocated memory
585 ************************************************************/
586 if (hday_int_str != NULL) free(hday_int_str);
587 if (hyear_int_str != NULL) free(hyear_int_str);
588
589 return 0;
590 }
591
592
593
594 /************************************************************
595 * option 's' - sunrise/set times
596 ************************************************************/
597 int
598 print_sunrise (hdate_struct * h, double lat, double lon, int tz, int opt_i)
599 {
600 int sunrise, sunset;
601
602 /* get times */
603 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
604 &sunrise, &sunset);
605
606 print_astronomical_time( sunrise_text, sunrise, tz);
607 print_astronomical_time( sunset_text, sunset, tz);
608
609 return DATA_WAS_PRINTED;
610 }
611
612
613
614 /************************************************************
615 * option 't' - day times
616 ************************************************************/
617 int print_times (hdate_struct * h, double lat, double lon, int tz, int opt_i)
618 {
619 int sun_hour, first_light, talit, sunrise;
620 int midday, sunset, first_stars, three_stars;
621
622 /* get times */
623 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
624 &sun_hour, &first_light, &talit, &sunrise,
625 &midday, &sunset, &first_stars, &three_stars);
626
627 print_astronomical_time( first_light_text, first_light, tz);
628 print_astronomical_time( talit_text, talit, tz);
629 print_astronomical_time( sunrise_text, sunrise, tz);
630 print_astronomical_time( midday_text, midday, tz);
631 print_astronomical_time( sunset_text, sunset, tz);
632 print_astronomical_time( first_stars_text, first_stars, tz);
633 print_astronomical_time( three_stars_text, three_stars, tz);
634 printf("%s: %02d:%02d\n",N_("sun_hour"), sun_hour/60, sun_hour%60);
635
636 return DATA_WAS_PRINTED;
637 }
638
639
640
641 /************************************************************
642 * option 'h' - holiday identification
643 ************************************************************/
644 /* int print_holiday (hdate_struct * h, int opt.diaspora, int short_format, int opt_i)
645 {
646 int holiday;
647
648 holiday = hdate_get_holyday (h, opt.diaspora);
649 if (holiday)
650 {
651 printf ("%s\n", hdate_string (holiday, short_format));
652 return DATA_WAS_PRINTED;
653 }
654 else return DATA_WAS_NOT_PRINTED;
655 }
656 */
657
658 /************************************************************
659 * option 'o' - sefirat ha'omer
660 ************************************************************/
661 int print_omer (hdate_struct * h, int const short_form, int const hebrew_form)
662 {
663 int omer_day;
664
665 omer_day = hdate_get_omer_day(h);
666 if (omer_day != 0)
667 {
668 printf ("%s %s \n", N_("today is day"), hdate_string(HDATE_STRING_OMER, omer_day, short_form, hebrew_form));
669 return DATA_WAS_PRINTED;
670 }
671 else return DATA_WAS_NOT_PRINTED;
672 }
673
674
675
676 /************************************************************
677 * option 'r' - parashat hashavua
678 ************************************************************/
679 /* int print_reading (hdate_struct * h, int opt.diaspora, int short_format, int opt_i)
680 {
681 int reading;
682
683 reading = hdate_get_parasha (h, opt.diaspora);
684 if (reading)
685 {
686 printf ("%s %s\n", N_("Parashat"), hdate_string (reading, short_format));
687 return DATA_WAS_PRINTED;
688 }
689 else return DATA_WAS_NOT_PRINTED;
690 }
691 */
692
693
694 /************************************************************
695 * option 'c' - candle-lighting time; tzeit Shabbat
696 ************************************************************/
697 int print_candles (hdate_struct * h, double lat, double lon, int tz, option_list opt)
698 {
699 int sun_hour, first_light, talit, sunrise;
700 int midday, sunset, first_stars, three_stars;
701
702 // check for friday - print knisat shabat
703 if ( (h->hd_dw == 6) && (opt.candles) )
704 {
705 // get times
706 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
707 &sunrise, &sunset);
708
709 // FIXME - allow for further minhag variation
710 if (opt.candles != 1) sunset = sunset - opt.candles;
711 else sunset = sunset - DEFAULT_CANDLES_MINUTES;
712
713 // print candlelighting times
714 print_astronomical_time( candles_text, sunset, tz);
715 return DATA_WAS_PRINTED;
716 }
717
718 // check for saturday - print motzay shabat
719 else if ( (h->hd_dw == 7) && (opt.havdalah) )
720 {
721 // get times
722 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat,
723 lon, &sun_hour, &first_light, &talit,
724 &sunrise, &midday, &sunset,
725 &first_stars, &three_stars);
726
727 // FIXME - allow for further minhag variation
728 if (opt.havdalah != 1) three_stars = sunset + opt.havdalah;
729
730 // print motzay shabat
731 print_astronomical_time( havdalah_text, three_stars, tz);
732 return DATA_WAS_PRINTED;
733 }
734 else return DATA_WAS_NOT_PRINTED;
735 }
736
737 /************************************************************
738 * print tabular header
739 ************************************************************/
740 void print_tabular_header( option_list opt)
741 {
742 printf("%s,%s",N_("Gregorian date"), N_("Hebrew Date"));
743 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 );
744 else if (opt.sun) printf(",%s,%s",sunrise_text,sunset_text);
745 if (opt.candles) printf(",%s", candles_text);
746 if (opt.havdalah) printf(",%s", havdalah_text);
747 if (opt.holidays) printf(",%s",N_("holiday"));
748 if (opt.omer) printf(",%s",N_("omer count"));
749 if (opt.parasha) printf(",%s",N_("parashat"));
750 printf("\n");
751 return;
752 }
753
754 /************************************************************
755 * print one day - tabular output *
756 ************************************************************/
757 int print_tabular_day (hdate_struct * h, option_list opt,
758 double lat, double lon, int tz)
759 {
760 int sun_hour = -1;
761 int first_light = -1;
762 int talit = -1;
763 int sunrise = -1;
764 int midday = -1;
765 int sunset = -1;
766 int first_stars = -1;
767 int three_stars = -1;
768
769 hdate_struct tomorrow;
770 int data_printed = 0;
771
772 int parasha = 0;
773 int holiday = 0;
774 int omer_day = 0;
775
776 char *hday_str = NULL;
777 char *hyear_str = NULL;
778
779 // for bidi (revstr)
780 char *hebrew_buffer = NULL;
781 size_t hebrew_buffer_len = 0;
782
783 /************************************************************
784 * options -R, -H are restrictive filters, so if there is no
785 * parasha reading / holiday, print nothing.
786 ************************************************************/
787 parasha = hdate_get_parasha (h, opt.diaspora);
788 holiday = hdate_get_holyday (h, opt.diaspora);
789 if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday)
790 return 0;
791 if (opt.only_if_parasha && !opt.only_if_holiday && !parasha)
792 return 0;
793 if (opt.only_if_holiday && !opt.only_if_parasha && !holiday)
794 return 0;
795
796
797
798 /************************************************************
799 * print Gregorian date
800 ************************************************************/
801 printf ("%d.%d.%d,", h->gd_day, h->gd_mon, h->gd_year);
802
803
804 /************************************************************
805 * begin - print Hebrew date
806 ************************************************************/
807
808 // BUG - looks like a bug - why sunset awareness in tabular output?
809 if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1);
810
811 if (opt.bidi)
812 {
813 hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG, opt.hebrew);
814 hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG, opt.hebrew);
815 hebrew_buffer_len =
816 asprintf (&hebrew_buffer, "%s %s %s",
817 hday_str,
818 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew),
819 hyear_str);
820 revstr(hebrew_buffer, hebrew_buffer_len);
821 printf ("%s", hebrew_buffer);
822 if (hebrew_buffer != NULL) free(hebrew_buffer);
823 }
824 else
825 {
826 // review sometime whether both checks are still necessary (see below for hyear)
827 //if ((!hdate_is_hebrew_locale()) && (!opt.hebrew))
828 //{ /* non hebrew numbers */
829 // printf ("%d", h->hd_day);
830 //}
831 //else /* Hebrew */
832 //{
833 hday_str = hdate_string(HDATE_STRING_INT, h->hd_day, HDATE_STRING_LONG,opt.hebrew);
834 printf ("%s", hday_str);
835 //}
836
837 printf (" %s ",
838 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, HDATE_STRING_LONG, opt.hebrew));
839
840 hyear_str = hdate_string(HDATE_STRING_INT, h->hd_year, HDATE_STRING_LONG,opt.hebrew);
841 printf ("%s", hyear_str);
842 }
843 if (hday_str != NULL) free(hday_str);
844 if (hyear_str != NULL) free(hyear_str);
845 /************************************************************
846 * end - print Hebrew date
847 ************************************************************/
848
849
850 if (opt.times)
851 {
852 /* get astronomical times */
853 hdate_get_utc_sun_time_full (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
854 &sun_hour, &first_light, &talit, &sunrise,
855 &midday, &sunset, &first_stars, &three_stars);
856 /* print astronomical times */
857 print_astronomical_time_tabular( first_light, tz);
858 print_astronomical_time_tabular( talit, tz);
859 print_astronomical_time_tabular( sunrise, tz);
860 print_astronomical_time_tabular( midday, tz);
861 print_astronomical_time_tabular( sunset, tz);
862 print_astronomical_time_tabular( first_stars, tz);
863 print_astronomical_time_tabular( three_stars, tz);
864 printf(",%02d:%02d",sun_hour/60, sun_hour%60);
865 }
866 else if (opt.sun)
867 {
868 hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, lat, lon,
869 &sunrise, &sunset);
870 print_astronomical_time_tabular( sunrise, tz);
871 print_astronomical_time_tabular( sunset, tz);
872 }
873
874 if (opt.candles)
875 {
876 if ( (h->hd_dw != 6) && (!opt.only_if_parasha) ) sunset = -1; //printf(",");
877 else
878 {
879 if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon,
880 h->gd_year, lat, lon, &sunrise, &sunset);
881 if (opt.candles != 1) sunset = sunset - opt.candles;
882 else sunset = sunset- DEFAULT_CANDLES_MINUTES;
883 }
884 print_astronomical_time_tabular( sunset, tz);
885 }
886
887 if (opt.havdalah)
888 {
889 if ( (h->hd_dw != 7) && (!opt.only_if_parasha) ) three_stars = -1; //printf(",");
890 else
891 {
892 if (opt.havdalah != 1)
893 {
894 if (sunset == -1) hdate_get_utc_sun_time (h->gd_day, h->gd_mon,
895 h->gd_year, lat, lon, &sunrise, &sunset);
896 three_stars = sunset + opt.havdalah;
897 }
898 else
899 {
900 if(three_stars == -1) hdate_get_utc_sun_time_full (
901 h->gd_day, h->gd_mon, h->gd_year, lat,
902 lon, &sun_hour, &first_light, &talit,
903 &sunrise, &midday, &sunset,
904 &first_stars, &three_stars);
905 }
906 }
907 print_astronomical_time_tabular( three_stars, tz);
908 }
909
910 if (opt.holidays && holiday)
911 printf (",%s",
912 hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew));
913
914 if (opt.omer)
915 {
916 omer_day = hdate_get_omer_day(h);
917 if (omer_day != 0) printf (",%d", omer_day);
918 }
919
920 if (opt.parasha && parasha)
921 {
922 if (!opt.bidi) printf (",%s",
923 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
924 else
925 {
926 hebrew_buffer_len = asprintf (&hebrew_buffer, "%s",
927 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
928 revstr(hebrew_buffer, hebrew_buffer_len);
929 printf (",%s", hebrew_buffer);
930 if (hebrew_buffer != NULL) free(hebrew_buffer);
931 }
932 }
933 printf("\n");
934
935 if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset();
936
937 return 0;
938 }
939
940
941
942
943 /************************************************************
944 * print one day - regular output
945 ************************************************************/
946 int print_day (hdate_struct * h, option_list opt,
947 double lat, double lon, int tz)
948 {
949
950 time_t t;
951 hdate_struct tomorrow;
952
953 int iCal_uid_counter = 0;
954 int data_printed = 0;
955 int parasha = 0;
956 int holiday = 0;
957
958
959 /************************************************************
960 * options -R, -H are restrictive filters, so if there is no
961 * parasha reading / holiday, print nothing.
962 ************************************************************/
963 parasha = hdate_get_parasha (h, opt.diaspora);
964 holiday = hdate_get_holyday (h, opt.diaspora);
965 if (opt.only_if_parasha && opt.only_if_holiday && !parasha && !holiday)
966 return 0;
967 if (opt.only_if_parasha && !opt.only_if_holiday && !parasha)
968 return 0;
969 if (opt.only_if_holiday && !opt.only_if_parasha && !holiday)
970 return 0;
971
972
973 /************************************************************
974 * print the iCal event header
975 ************************************************************/
976 if (opt.iCal)
977 {
978 printf ("BEGIN:VEVENT\n");
979 printf ("UID:hdate-%ld-%d\n", time(&t), ++iCal_uid_counter);
980 printf ("DTSTART;VALUE=DATE:%04d%02d%02d\n", h->gd_year,
981 h->gd_mon, h->gd_day);
982 printf ("SUMMARY:");
983 }
984
985
986 /************************************************************
987 * print the Julian Day Number
988 ************************************************************/
989 if (opt.julian) printf ("JDN-%d ", h->hd_jd);
990
991
992 /************************************************************
993 * print the date
994 ************************************************************/
995 if (opt.print_tomorrow) hdate_set_jd (&tomorrow, (h->hd_jd)+1);
996 print_date (h, &tomorrow, opt, lat, lon);
997
998
999
1000 /************************************************************
1001 * begin - print additional information for day
1002 ************************************************************/
1003 if (opt.print_tomorrow) *h = tomorrow;
1004 if (opt.sun) data_printed = data_printed | print_sunrise (h, lat, lon, tz, opt.iCal);
1005 if (opt.times) data_printed = data_printed | print_times (h, lat, lon, tz, opt.iCal);
1006 if (opt.holidays && holiday)
1007 {
1008 printf ("%s\n",
1009 hdate_string( HDATE_STRING_HOLIDAY, holiday, opt.short_format, opt.hebrew));
1010 data_printed = DATA_WAS_PRINTED;
1011 }
1012 if (opt.omer) data_printed = data_printed | print_omer (h, opt.short_format, opt.hebrew);
1013 if (opt.parasha && parasha)
1014 {
1015 printf ("%s %s\n", N_("Parashat"),
1016 hdate_string( HDATE_STRING_PARASHA, parasha, opt.short_format, opt.hebrew));
1017 data_printed = DATA_WAS_PRINTED;
1018 }
1019 if (opt.candles || opt.havdalah) data_printed = data_printed | print_candles (h, lat, lon, tz, opt);
1020 if ((opt.print_tomorrow) && (data_printed) && (!opt.quiet_alerts)) print_alert_sunset();
1021 /************************************************************
1022 * end - print additional information for day
1023 ************************************************************/
1024
1025
1026
1027
1028 /************************************************************
1029 * print the iCal event footer
1030 ************************************************************/
1031 if (opt.iCal)
1032 {
1033 printf ("\nCLASS:PUBLIC\n");
1034 printf ("DTEND;VALUE=DATE:%04d%02d%02d\n", h->gd_year,
1035 h->gd_mon, h->gd_day);
1036 printf ("CATEGORIES:Holidays\n");
1037 printf ("END:VEVENT\n");
1038 }
1039
1040 return 0;
1041 }
1042
1043
1044
1045 /************************************************************
1046 * print one Gregorian month - tabular output
1047 ************************************************************/
1048 int print_tabular_gmonth( option_list opt,
1049 double lat, double lon, int tz, int month, int year)
1050 {
1051 hdate_struct h;
1052 int jd;
1053
1054 /* get date of month start */
1055 hdate_set_gdate (&h, 1, month, year);
1056 jd = h.hd_jd;
1057
1058 /* print month days */
1059 while (h.gd_mon == month)
1060 {
1061 print_tabular_day (&h, opt, lat, lon, tz);
1062 jd++;
1063 hdate_set_jd (&h, jd);
1064 }
1065
1066 return 0;
1067 }
1068
1069
1070
1071 /************************************************************
1072 * print one Gregorian month - regular output
1073 ************************************************************/
1074 int print_gmonth (option_list opt, double lat, double lon, int tz,
1075 int month, int year)
1076 {
1077 hdate_struct h;
1078 int jd;
1079
1080 /* get date of month start */
1081 hdate_set_gdate (&h, 1, month, year);
1082 jd = h.hd_jd;
1083
1084 /* print month header */
1085 if (!opt.iCal && !opt.short_format)
1086 printf ("\n%s:\n",
1087 hdate_string( HDATE_STRING_GMONTH, h.gd_mon, opt.short_format, HDATE_STRING_LOCAL));
1088
1089 /* print month days */
1090 while (h.gd_mon == month)
1091 {
1092 print_day (&h, opt, lat, lon, tz);
1093
1094 jd++;
1095 hdate_set_jd (&h, jd);
1096 }
1097
1098 return 0;
1099 }
1100
1101
1102
1103 /************************************************************
1104 * print one Hebrew month - tabular output *
1105 ************************************************************/
1106 int print_tabular_hmonth
1107 ( option_list opt, double lat, double lon, int tz,
1108 int month, int year)
1109 {
1110 hdate_struct h;
1111 int jd;
1112
1113 /* get date of month start */
1114 hdate_set_hdate (&h, 1, month, year);
1115 jd = h.hd_jd;
1116
1117 /* print month days */
1118 while (h.gd_mon == month)
1119 {
1120 print_tabular_header( opt );
1121 print_tabular_day (&h, opt, lat, lon, tz);
1122 jd++;
1123 hdate_set_jd (&h, jd);
1124 }
1125
1126 return 0;
1127 }
1128
1129
1130 /************************************************************
1131 * print one Hebrew month - regular output
1132 ************************************************************/
1133 int print_hmonth (hdate_struct * h, option_list opt,
1134 double lat, double lon, int tz, int month, int year)
1135 {
1136 int jd;
1137
1138 /* get date of month start */
1139 jd = h->hd_jd;
1140
1141 /* print month header */
1142 if (!opt.iCal && !opt.short_format)
1143 printf ("\n%s:\n",
1144 hdate_string( HDATE_STRING_HMONTH , h->hd_mon, opt.short_format, opt.hebrew));
1145
1146 /* print month days */
1147 while (h->hd_mon == month)
1148 {
1149 print_day (h, opt, lat, lon, tz);
1150
1151 jd++;
1152 hdate_set_jd (h, jd);
1153 }
1154 return 0;
1155 }
1156
1157
1158
1159 /************************************************************
1160 * print one Gregorian year - tabular output *
1161 ************************************************************/
1162 int print_tabular_gyear
1163 ( option_list opt, double lat, double lon, int tz, int year)
1164 {
1165 int month = 1;
1166 while (month < 13)
1167 {
1168 print_tabular_gmonth(opt, lat, lon, tz, month, year);
1169 month++;
1170 }
1171 return 0;
1172 }
1173
1174
1175 /************************************************************
1176 * print one Hebrew year - tabular output *
1177 ************************************************************/
1178 int print_tabular_hyear
1179 ( option_list opt, double lat, double lon, int tz, int year)
1180 {
1181 hdate_struct h;
1182 int month = 1;
1183
1184 /* print year months */
1185 while (month < 13)
1186 {
1187 /* get date of month start */
1188 hdate_set_hdate (&h, 1, month, year);
1189
1190 /* if leap year, print both Adar months */
1191 if (h.hd_size_of_year > 365 && month == 6)
1192 {
1193 hdate_set_hdate (&h, 1, 13, year);
1194 print_tabular_hmonth(opt, lat, lon, tz, 13, year);
1195 hdate_set_hdate (&h, 1, 14, year);
1196 print_tabular_hmonth(opt, lat, lon, tz, 14, year);
1197 }
1198 else
1199 {
1200 print_tabular_hmonth(opt, lat, lon, tz, month, year);
1201 }
1202 month++;
1203 }
1204 return 0;
1205 }
1206
1207
1208
1209 /************************************************************
1210 * print one Gregorian year - regular output
1211 ************************************************************/
1212 int print_gyear (option_list opt, double lat, double lon, int tz, int year)
1213 {
1214
1215 int month = 1;
1216
1217 /* print year header */
1218 if (!opt.iCal && !opt.short_format)
1219 printf ("%d:\n", year);
1220
1221 /* print year months */
1222 while (month < 13)
1223 {
1224 print_gmonth ( opt, lat, lon, tz, month, year);
1225 month++;
1226 }
1227
1228 return 0;
1229 }
1230
1231
1232
1233 /************************************************************
1234 * print one hebrew year - regular output
1235 ************************************************************/
1236 int print_hyear (option_list opt, double lat, double lon, int tz, int year)
1237 {
1238 hdate_struct h;
1239 int month = 1;
1240
1241 char *h_int_str;
1242 h_int_str = hdate_string(HDATE_STRING_INT, year,HDATE_STRING_LONG,opt.hebrew);
1243 // FIXME - error check for NULL return value
1244
1245 /* print year header */
1246 if (!opt.iCal && !opt.short_format) printf ("%s:\n", h_int_str);
1247
1248 /* print year months */
1249 while (month < 13)
1250 {
1251 /* get date of month start */
1252 hdate_set_hdate (&h, 1, month, year);
1253
1254 /* if leap year, print both Adar months */
1255 if (h.hd_size_of_year > 365 && month == 6)
1256 {
1257 hdate_set_hdate (&h, 1, 13, year);
1258 print_hmonth (&h, opt, lat, lon, tz, 13, year);
1259 hdate_set_hdate (&h, 1, 14, year);
1260 print_hmonth (&h, opt, lat, lon, tz, 14, year);
1261 }
1262 else
1263 {
1264 print_hmonth (&h, opt, lat, lon, tz, month, year);
1265 }
1266 month++;
1267 }
1268
1269 return 0;
1270 }
1271
1272
1273
1274 /****************************************************
1275 * read and parse config file
1276 ****************************************************/
1277 void read_config_file( FILE *config_file,
1278 option_list *opt,
1279 double* latitude,
1280 int* opt_latitude,
1281 double* longitude,
1282 int* opt_longitude,
1283 int* tz )
1284 {
1285 char *input_string;
1286 size_t input_str_len = 100; // WARNING: if you change this value
1287 // you will still have to also
1288 // change a matching value below
1289 // in the statement that includes:
1290 // match_count = sscanf(input_string
1291 char *input_key = "";
1292 char *input_value = "";
1293 int menu_item = 0;
1294 size_t menu_len = 0;
1295 int line_count = 0;
1296 int match_count;
1297 int end_of_input_file = FALSE;
1298 int i;
1299 const int num_of_keys = 26;
1300 const char* key_list[] = { "SUNSET_AWARE", // 0
1301 "LATITUDE",
1302 "LONGITUDE", // 2
1303 "TIMEZONE",
1304 "DIASPORA", // 4
1305 "FORCE_ISRAEL",
1306 "PARASHA_NAMES", // 6
1307 "SHABBAT_INFO",
1308 "FORCE_HEBREW", // 8
1309 "OUTPUT_BIDI",
1310 "QUIET_ALERTS", //10
1311 "YOM",
1312 "LESHABBAT", //12
1313 "LESEDER",
1314 "TABULAR", //14
1315 "ICAL",
1316 "SEFIRAT_HAOMER", //16
1317 "SHORT_FORMAT",
1318 "TIMES_OF_DAY", //18
1319 "SUN_RISE_SET",
1320 "ONLY_IF_PARASHA_IS_READ",
1321 "ONLY_IF_HOLIDAY",
1322 "JULIAN_DAY", //22
1323 "CANDLE_LIGHTING",
1324 "HAVDALAH", //24
1325 "MENU"
1326 };
1327
1328 input_string = malloc(input_str_len+1);
1329 input_key = malloc(input_str_len+1);
1330 input_value = malloc(input_str_len+1);
1331
1332 while ( end_of_input_file != TRUE )
1333 {
1334 end_of_input_file = getline(&input_string, &input_str_len, config_file);
1335 if ( end_of_input_file != TRUE )
1336 {
1337 errno = 0;
1338 // The '100' in the next statement is inelegant; it is meant to
1339 // be the value of input_str_len. Alternatively, don't malloc
1340 // input_value above, use the 'a' specifier here, and free(input_value)
1341 // at the end of every successful read and evaluation
1342 match_count = sscanf(input_string,"%[A-Z_]=%100[^\n]",input_key,input_value);
1343 line_count++;
1344 if (errno != 0) error(0,errno,"scan error at line %d", line_count);
1345 if (match_count ==2)
1346 {
1347 for (i=0; i<num_of_keys; i++)
1348 {
1349 if (strcmp(input_key, key_list[i]) == 0)
1350 {
1351 switch(i)
1352 {
1353
1354 // SUNSET_AWARE
1355 case 0:if (strcmp(input_value,"FALSE") == 0) opt->not_sunset_aware = 1;
1356 else if (strcmp(input_value,"TRUE") == 0) opt->not_sunset_aware = 0;
1357 break;
1358
1359 // LATITUDE
1360 case 1:
1361 parse_coordinate(1, input_value, latitude, opt_latitude);
1362 break;
1363
1364 // LONGITUDE
1365 case 2:
1366 parse_coordinate(2, input_value, longitude, opt_longitude);
1367 break;
1368
1369 // TIMEZONE
1370 case 3:
1371 parse_timezone(input_value, tz);
1372 break;
1373
1374 // DIASPORA
1375 case 4:if (strcmp(input_value,"FALSE") == 0) opt->diaspora = 0;
1376 else if (strcmp(input_value,"TRUE") == 0) opt->diaspora = 1;
1377 break;
1378
1379
1380 // case 5:if (strcmp(input_value,"FALSE") == 0) opt->force_israel = 0;
1381 // else if (strcmp(input_value,"TRUE") == 0) opt->force_israel = 1;
1382 break;
1383
1384 // PARASHA_NAMES
1385 case 6:if (strcmp(input_value,"FALSE") == 0) opt->parasha = 0;
1386 else if (strcmp(input_value,"TRUE") == 0) opt->parasha = 1;
1387 break;
1388
1389 // SHABBAT_INFO
1390 case 7:if (strcmp(input_value,"FALSE") == 0)
1391 {
1392 // maybe not do anything if set FALSE
1393 opt->candles = 0;
1394 opt->havdalah = 0;
1395 opt->parasha = 0;
1396 }
1397 else if (strcmp(input_value,"TRUE") == 0)
1398 {
1399 opt->candles = 1;
1400 opt->havdalah = 1;
1401 opt->parasha = 1;
1402 }
1403 break;
1404
1405 // FORCE_HEBREW
1406 case 8:if (strcmp(input_value,"FALSE") == 0) opt->hebrew = 0;
1407 else if (strcmp(input_value,"TRUE") == 0) opt->hebrew = 1;
1408 break;
1409
1410 // OUTPUT_BIDI
1411 case 9:if (strcmp(input_value,"FALSE") == 0) opt->bidi = 0;
1412 else if (strcmp(input_value,"TRUE") == 0)
1413 {
1414 opt->bidi = 1;
1415 opt->hebrew = 1;
1416 }
1417 break;
1418
1419 // QUIET_ALERTS
1420 case 10:if (strcmp(input_value,"FALSE") == 0) opt->quiet_alerts = 0;
1421 else if (strcmp(input_value,"TRUE") == 0) opt->quiet_alerts = 1;
1422 break;
1423
1424 // YOM
1425 case 11:if (strcmp(input_value,"FALSE") == 0) opt->yom = 0;
1426 else if (strcmp(input_value,"TRUE") == 0)
1427 {
1428 opt->yom = 1;
1429 opt->hebrew = 1;
1430 }
1431 break;
1432
1433 // LESHABBAT
1434 case 12:if (strcmp(input_value,"FALSE") == 0) opt->leShabbat = 0;
1435 else if (strcmp(input_value,"TRUE") == 0)
1436 {
1437 opt->leShabbat = 1;
1438 opt->yom = 1;
1439 opt->hebrew = 1;
1440 }
1441 break;
1442
1443 // LESEDER
1444 case 13:if (strcmp(input_value,"FALSE") == 0) opt->leSeder = 0;
1445 else if (strcmp(input_value,"TRUE") == 0)
1446 {
1447 opt->leSeder = 1;
1448 opt->yom = 1;
1449 opt->hebrew = 1;
1450 }
1451 break;
1452
1453 // TABULAR
1454 case 14:if (strcmp(input_value,"FALSE") == 0) opt->tablular_output = 0;
1455 else if (strcmp(input_value,"TRUE") == 0) opt->tablular_output = 1;
1456 break;
1457
1458 // ICAL
1459 case 15:if (strcmp(input_value,"FALSE") == 0) opt->iCal = 0;
1460 else if (strcmp(input_value,"TRUE") == 0) opt->iCal = 1;
1461 break;
1462
1463 // SEFIRAT_HAOMER
1464 case 16:if (strcmp(input_value,"FALSE") == 0) opt->omer = 0;
1465 else if (strcmp(input_value,"TRUE") == 0) opt->omer = 1;
1466 break;
1467
1468 // SHORT_FORMAT
1469 case 17:if (strcmp(input_value,"FALSE") == 0) opt->short_format = 0;
1470 else if (strcmp(input_value,"TRUE") == 0) opt->short_format = 1;
1471 break;
1472
1473 // TIMES_OF_DAY
1474 case 18:if (strcmp(input_value,"FALSE") == 0) opt->times = 0;
1475 else if (strcmp(input_value,"TRUE") == 0) opt->times = 1;
1476 break;
1477
1478 // SUN_RISE_SET
1479 case 19:if (strcmp(input_value,"FALSE") == 0) opt->sun = 0;
1480 else if (strcmp(input_value,"TRUE") == 0) opt->sun = 1;
1481 break;
1482
1483 // ONLY_IF_PARASHA_IS_READ
1484 case 20:if (strcmp(input_value,"FALSE") == 0) opt->only_if_parasha = 0;
1485 else if (strcmp(input_value,"TRUE") == 0) opt->only_if_parasha = 1;
1486 break;
1487
1488 // ONLY_IF_HOLIDAY
1489 case 21:if (strcmp(input_value,"FALSE") == 0) opt->only_if_holiday = 0;
1490 else if (strcmp(input_value,"TRUE") == 0) opt->only_if_holiday = 1;
1491 break;
1492
1493 // JULIAN_DAY
1494 case 22:if (strcmp(input_value,"FALSE") == 0) opt->julian = 0;
1495 else if (strcmp(input_value,"TRUE") == 0) opt->julian = 1;
1496 break;
1497
1498 // CANDLE_LIGHTING
1499 case 23:if (strcmp(input_value,"FALSE") == 0) opt->candles = 0;
1500 else if (strcmp(input_value,"TRUE") == 0) opt->candles = 1;
1501 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1502 {
1503 opt->candles = atoi(input_value);
1504 if (opt->candles < MIN_CANDLES_MINUTES) opt->candles = MIN_CANDLES_MINUTES;
1505 else if (opt->candles > MAX_CANDLES_MINUTES) opt->candles = MAX_CANDLES_MINUTES;
1506 }
1507 break;
1508
1509 // HAVDALAH
1510 case 24:if (strcmp(input_value,"FALSE") == 0) opt->havdalah = 0;
1511 else if (strcmp(input_value,"TRUE") == 0) opt->havdalah = 1;
1512 else if (fnmatch( "[[:digit:]]?([[:digit:]])", input_value, FNM_EXTMATCH) == 0)
1513 {
1514 opt->havdalah = atoi(input_value);
1515 if (opt->havdalah < MIN_MOTZASH_MINUTES) opt->havdalah = MIN_MOTZASH_MINUTES;
1516 else if (opt->havdalah > MAX_MOTZASH_MINUTES) opt->havdalah = MAX_MOTZASH_MINUTES;
1517 }
1518 break;
1519
1520 // MENU
1521 case 25:if (menu_item < MAX_MENU_ITEMS)
1522 {
1523 menu_len = strlen(input_value);
1524 opt->menu_item[menu_item] = malloc(menu_len+1);
1525 memcpy(opt->menu_item[menu_item], input_value,menu_len);
1526 menu_item++;
1527 }
1528 break;
1529
1530 } // end of switch(i)
1531 break; // if found a match don't continue for loop
1532 }
1533 }
1534 }
1535 }
1536 }
1537 free(input_string);
1538 free(input_key);
1539 free(input_value);
1540 return;
1541 }
1542
1543
1544 /****************************************************
1545 * exit elegantly
1546 ****************************************************/
1547 void exit_main( option_list *opt, int exit_code)
1548 {
1549 int i;
1550 for (i=0; i<MAX_MENU_ITEMS; i++)
1551 {
1552 if (opt->menu_item[i] == NULL) break;
1553 free(opt->menu_item[i]);
1554 }
1555 exit (exit_code);
1556 }
1557
1558
1559
1560 /****************************************************
1561 * parse a command-line or a config-file menu line
1562 *
1563 * It was appropriate to make this a function, outside
1564 * of main, because of its dual use and dual reference
1565 ****************************************************/
1566 int hdate_parser( int switch_arg, option_list *opt,
1567 double *lat, int *opt_latitude,
1568 double *lon, int *opt_Longitude,
1569 int *tz, int long_option_index)
1570 {
1571 int error_detected = 0;
1572
1573 switch (switch_arg)
1574 {
1575
1576 case 0: /* long options */
1577 switch (long_option_index)
1578 {
1579 /* --version */ case 0: print_version (); exit_main(opt,0); break;
1580 /* --help */ case 1: print_help (); exit_main(opt,0); break;
1581 /* --hebrew */ case 2: opt->hebrew = 1; break;
1582 /* --yom */ case 3:
1583 opt->yom = 1;
1584 opt->hebrew = 1;
1585 break;
1586 /* --leshabbat */ case 4:
1587 opt->leShabbat = 1;
1588 opt->yom = 1;
1589 opt->hebrew = 1;
1590 break;
1591 /* --leseder */ case 5:
1592 opt->leSeder = 1;
1593 opt->yom = 1;
1594 opt->hebrew = 1;
1595 break;
1596 /* --table */ case 6: break;
1597 /* --not-sunset-aware */case 7: opt->not_sunset_aware = 1; break;
1598 /* --quiet-alerts */ case 8: break;
1599 /* --short-format */ case 9: break;
1600 /* --parasha */ case 10:break;
1601 /* --holidays */ case 11:break;
1602 /* --shabbat-times */ case 12:break;
1603 /* --sun */ case 13:
1604 /* --sunset */ case 14:
1605 /* --sunrise */ case 15:break;
1606 /* --candle-lighting */ case 16:
1607 /* --candles */ case 17:
1608 if (optarg == NULL) opt->candles = 1;
1609 else
1610 {
1611 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1612 {
1613 opt->candles = atoi(optarg);
1614 if ( (opt->candles >= MIN_CANDLES_MINUTES) &&
1615 (opt->candles <= MAX_CANDLES_MINUTES) ) break;
1616 }
1617 print_parm_error("--candles"); // do not gettext!
1618 error_detected++;
1619 }
1620 break;
1621
1622 /* --havdalah */ case 18:
1623 if (optarg == NULL) opt->havdalah = 1;
1624 else
1625 {
1626 if (fnmatch( "[[:digit:]]?([[:digit:]])", optarg, FNM_EXTMATCH) == 0)
1627 {
1628 opt->havdalah = atoi(optarg);
1629 if ( (opt->havdalah >= MIN_MOTZASH_MINUTES) &&
1630 (opt->havdalah <= MAX_MOTZASH_MINUTES) ) break;
1631 }
1632 print_parm_error("--havdalah"); // do not gettext!
1633 error_detected++;
1634 }
1635 break;
1636
1637 /* --latitude */ case 19:break;
1638 /* --longitude */ case 20:break;
1639 /* --timezone */ case 21:break;
1640 /* --bidi */ case 22:
1641 /* --visual */ case 23:break;
1642 /* --omer */ case 24:break;
1643 /* --ical */ case 25:break;
1644 /* --julian */ case 26:break;
1645 /* --diaspora */ case 27:break;
1646 /* --menu */ case 28:break;
1647
1648 } // end switch for long_options
1649 break;
1650
1651
1652 case 'b': opt->bidi = 1; opt->hebrew = 1; break;
1653 case 'c': if (opt->candles == 0) opt->candles = 1;
1654 if (opt->havdalah == 0) opt->havdalah = 1;
1655 break;
1656 case 'd': opt->diaspora = 1; break;
1657 case 'H': opt->only_if_holiday = 1; /* why no break? */
1658 /* it seems ok 'H' is used only to abort
1659 a print, so it always needs 'h' set */
1660 case 'h': opt->holidays = 1; break;
1661 case 'i': opt->iCal = 1; break;
1662 case 'j': opt->julian = 1; break;
1663 case 'q': opt->quiet_alerts = 1; break;
1664 case 'm': opt->menu = 1; break;
1665 case 'o': opt->omer = 1; break;
1666 case 'R': opt->only_if_parasha = 1;
1667 case 'r': opt->parasha = 1; break;
1668 case 'S': opt->short_format = 1; break;
1669 case 's': opt->sun = 1; break;
1670 case 't': opt->times = 1; break;
1671 case 'T': opt->tablular_output = 1; break;
1672 case 'l':
1673 error_detected = error_detected + parse_coordinate(1, optarg, lat, opt_latitude);
1674 break;
1675 case 'L':
1676 error_detected = error_detected + parse_coordinate(2, optarg, lon, opt_Longitude);
1677 break;
1678 case 'z':
1679 error_detected = error_detected + parse_timezone(optarg, tz);
1680 break;
1681 case '?':
1682 // if (strchr(short_options,optopt)==NULL)
1683 // error(0,0,"option %c unknown",optopt);
1684 print_parm_missing_error((char*) &optopt);
1685 error_detected = TRUE;
1686 break;
1687 default:
1688 print_usage_hdate (); exit_main(opt,0); break;
1689 }
1690
1691 return error_detected;
1692 }
1693
1694
1695
1696
1697
1698 /************************************************************
1699 *************************************************************
1700 *************************************************************
1701 * main function
1702 *************************************************************
1703 *************************************************************
1704 ************************************************************/
1705 int main (int argc, char *argv[])
1706 {
1707
1708 hdate_struct h; /* The Hebrew date */
1709 int c;
1710
1711 int day; /* The Gregorian date */
1712 int month;
1713 int year;
1714
1715 double lat = BAD_COORDINATE; /* set to this value for error handling */
1716 double lon = BAD_COORDINATE; /* set to this value for error handling */
1717 int tz = BAD_TIMEZONE; /* -z option Time Zone, default to system local time */
1718
1719 int opt_latitude = 0; /* -l option latitude */
1720 int opt_Longitude = 0; /* -L option longitude */
1721
1722 int error_detected = FALSE; /* exit after reporting ALL bad parms */
1723
1724
1725 option_list opt;
1726 opt.hebrew = 0;
1727 opt.bidi = 0;
1728 opt.yom = 0;
1729 opt.leShabbat = 0;
1730 opt.leSeder = 0;
1731 opt.tablular_output = 0;
1732 opt.not_sunset_aware = 0;
1733 opt.quiet_alerts = 0;
1734 opt.print_tomorrow = 0; /* This isn't a command line option;
1735 It here to restrict sunset_aware to
1736 single-day outputs */
1737 opt.sun = 0; /* -s option sunrise/set times */
1738 opt.candles = 0;
1739 opt.havdalah = 0;
1740 opt.times = 0; /* -t option print times of day */
1741 opt.short_format = 0; /* -S Short format flag */
1742 opt.holidays = 0; /* -h option holidays */
1743 opt.only_if_holiday = 0; /* -H option just holidays */
1744 opt.parasha = 0; /* -r option reading */
1745 opt.only_if_parasha = 0; /* -R option just reading */
1746 opt.julian = 0; /* -j option Julian day number */
1747 opt.diaspora = 0; /* -d option diaspora */
1748 opt.iCal = 0; /* -i option iCal */
1749 opt.omer = 0; /* -o option Sfirat Haomer */
1750
1751 opt.menu = 0; // -m print menus for user-selection
1752 int i;
1753 for (i=0; i<MAX_MENU_ITEMS; i++) opt.menu_item[i] = NULL;
1754
1755
1756 // support for getopt short options
1757 static char * short_options = "bcdhHjimoqrRsStTl:L:z:";
1758
1759 /**********************************************
1760 * support for getopt long options
1761 * note: other (long) options will be defined
1762 * globally at beginning of this file
1763 * ********************************************/
1764 int long_option_index = 0;
1765 static struct option long_options[] = {
1766 // name, has_arg, flag, val
1767 {"version", 0, 0, 0}, // 0
1768 {"help", 0, 0, 0},
1769 {"hebrew", 0, 0, 0}, // 2
1770 {"yom", 0, 0, 0},
1771 {"leshabbat", 0, 0, 0}, // 4
1772 {"leseder", 0, 0, 0},
1773 {"table",0,0,'T'}, // 6
1774 {"not-sunset-aware",0,0,0},
1775 {"quiet-alerts",0,0,'q'}, // 8
1776 {"short_format",0,0,'S'},
1777 {"parasha",0,0,'r'}, //10
1778 {"holidays",0,0,'h'},
1779 {"shabbat-times",0,0,'c'}, //12
1780 {"sun",0,0,'s'},
1781 {"sunset",0,0,0}, //14
1782 {"sunrise",0,0,0},
1783 {"candle-lighting",0,0,0}, //16
1784 {"candles",2,0,0},
1785 {"havdalah",2,0,0}, //18
1786 {"latitude", 1, 0, 'l'},
1787 {"longitude", 1, 0, 'L'}, //20
1788 {"timezone", 1, 0, 'z'},
1789 {"bidi", 0, 0, 'b'}, //22
1790 {"visual", 0, 0, 'b'},
1791 {"omer", 0, 0, 'o'}, //24
1792 {"ical", 0, 0, 'i'},
1793 {"julian", 0, 0, 'j'}, //26
1794 {"diaspora", 0, 0, 'd'},
1795 {"menu",0,0,'m'}, //28
1796 {0, 0, 0, 0}
1797 };
1798
1799
1800 // for config file user-defined menus
1801 size_t menu_len = 0;
1802 int menu_index;
1803 char *menuptr, *optptr;
1804
1805
1806 /************************************************************
1807 * init locale
1808 *
1809 * see hcal.c for the full lecture...
1810 *
1811 ************************************************************/
1812 setlocale (LC_ALL, "");
1813
1814
1815 /************************************************************
1816 * parse config file
1817 ************************************************************/
1818 FILE *config_file = get_config_file("/hdate", "/hdaterc", hdate_config_file_text);
1819 if (config_file != NULL)
1820 {
1821 read_config_file(config_file, &opt, &lat, &opt_latitude, &lon, &opt_Longitude, &tz);
1822 fclose(config_file);
1823 }
1824
1825 /************************************************************
1826 * parse command line
1827 ************************************************************/
1828 opterr = 0; // we'll do our own error reporting
1829 while ((c = getopt_long(argc, argv,
1830 short_options, long_options,
1831 &long_option_index)) != -1)
1832 error_detected = error_detected
1833 + hdate_parser(c, &opt,
1834 &lat, &opt_latitude,
1835 &lon, &opt_Longitude,
1836 &tz, long_option_index);
1837
1838 /**************************************************
1839 * BEGIN - enable user-defined menu
1840 *************************************************/
1841 if (opt.menu)
1842 {
1843 i = menu_select( &opt.menu_item[0], MAX_MENU_ITEMS );
1844 if (i == -1) exit_main(&opt, 0);
1845 else if ((i < MAX_MENU_ITEMS) && (opt.menu_item[i] != NULL))
1846 {
1847
1848 /**************************************************
1849 * parse user's menu selection
1850 *************************************************/
1851 menuptr = opt.menu_item[i];
1852 menu_len = strlen( menuptr );
1853 menu_index = 0;
1854 optptr = NULL;
1855 optarg = NULL;
1856
1857 while (( c = menu_item_parse( menuptr, menu_len, &menu_index,
1858 &optptr, short_options, long_options,
1859 &long_option_index, &error_detected) ) != -1)
1860 {
1861 error_detected = error_detected +
1862 hdate_parser(c, &opt,
1863 &lat, &opt_latitude,
1864 &lon, &opt_Longitude,
1865 &tz, long_option_index);
1866 }
1867 }
1868 }
1869 /**************************************************
1870 * END - enable user-defined menu
1871 *************************************************/
1872
1873
1874
1875 /************************************************************
1876 * function validate_location is defined in the include file
1877 * ./location.include.c
1878 * It issues an exit(EXIT_CODE_BAD_PARMS) [==1]
1879 * if it discovers, um, bad parameters
1880 ************************************************************/
1881 validate_location(opt_latitude, opt_Longitude,
1882 &lat, &lon, &tz,
1883 opt.quiet_alerts, error_detected, print_usage_hdate);
1884
1885 /************************************************************
1886 * option "s" is a subset of option "t"
1887 ************************************************************/
1888 if (opt.sun && opt.times) opt.sun=0;
1889
1890
1891 /************************************************************
1892 * begin parse input date
1893 ************************************************************/
1894
1895 /************************************************************
1896 * parse input date - no date entered
1897 ************************************************************/
1898 if (argc == optind)
1899 {
1900
1901 /* set date for today */
1902 hdate_set_gdate (&h, 0, 0, 0);
1903
1904 if (opt.tablular_output)
1905 {
1906 print_tabular_header( opt );
1907 print_tabular_day(&h, opt, lat, lon, tz);
1908 }
1909 else
1910 {
1911 if (opt.iCal) print_ical_header ();
1912 else if (!opt.not_sunset_aware)
1913 opt.print_tomorrow = check_for_sunset(&h, lat, lon, tz);
1914 print_day (&h, opt, lat, lon, tz);
1915 if (opt.iCal) print_ical_footer ();
1916 }
1917 }
1918
1919 /************************************************************
1920 * parse input date - only year or julian day number entered
1921 ************************************************************/
1922 else if (argc == (optind + 1))
1923 {
1924 /* get year */
1925 year = atoi (argv[optind]);
1926
1927 /* handle error */
1928 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
1929
1930
1931 /************************************************************
1932 * process single Julian day
1933 ************************************************************/
1934 if (year > 348021)
1935 {
1936 hdate_set_jd (&h, year);
1937
1938 if (opt.tablular_output)
1939 {
1940 print_tabular_header( opt );
1941 print_tabular_day(&h, opt, lat, lon, tz);
1942 }
1943 else
1944 {
1945 if (opt.iCal) print_ical_header ();
1946 print_day (&h, opt, lat, lon, tz);
1947 if (opt.iCal) print_ical_footer ();
1948 }
1949 }
1950
1951
1952 /************************************************************
1953 * process entire Hebrew year
1954 ************************************************************/
1955 else if (year > 3000)
1956 {
1957 if (opt.tablular_output)
1958 {
1959 print_tabular_header( opt );
1960 print_tabular_hyear( opt, lat, lon, tz, year);
1961 }
1962 else
1963 {
1964 if (opt.iCal) print_ical_header ();
1965 print_hyear ( opt, lat, lon, tz, year);
1966 if (opt.iCal) print_ical_footer ();
1967 }
1968 }
1969 /************************************************************
1970 * process entire Gregorian year
1971 ************************************************************/
1972 else
1973 {
1974 if (opt.tablular_output)
1975 {
1976 print_tabular_header( opt );
1977 print_tabular_gyear( opt, lat, lon, tz, year);
1978 }
1979 else
1980 {
1981 if (opt.iCal) print_ical_header ();
1982
1983 print_gyear ( opt, lat, lon, tz, year);
1984
1985 if (opt.iCal) print_ical_footer ();
1986 }
1987
1988 }
1989 }
1990
1991
1992 /************************************************************
1993 * parse input date - only month and year entered
1994 ************************************************************/
1995 else if (argc == (optind + 2))
1996 {
1997
1998 year = atoi (argv[optind + 1]);
1999 month = atoi (argv[optind]);
2000
2001 /* handle errors */
2002 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
2003
2004
2005 /************************************************************
2006 * process entire Hebrew month
2007 ************************************************************/
2008 if (year > 3000)
2009 {
2010 /* begin bounds check for month */
2011 if ((month <= 0) || (month > 14))
2012 { print_parm_error(N_("month")); exit_main(&opt,0); }
2013 hdate_set_hdate (&h, 1, 1, year);
2014 if ((h.hd_size_of_year <365) && (month >12))
2015 { print_parm_error(N_("month")); exit_main(&opt,0); }
2016 /* end bounds check for month */
2017
2018
2019 if (opt.tablular_output)
2020 {
2021 print_tabular_header( opt );
2022
2023 /* get date of month start */
2024 hdate_set_hdate (&h, 1, month, year);
2025
2026 /* if leap year, print both Adar months */
2027 if (h.hd_size_of_year > 365 && month == 6)
2028 {
2029 hdate_set_hdate (&h, 1, 13, year);
2030 print_tabular_hmonth ( opt, lat, lon, tz, 13, year);
2031 hdate_set_hdate (&h, 1, 14, year);
2032 print_tabular_hmonth ( opt, lat, lon, tz, 14, year);
2033 }
2034 else
2035 {
2036 print_tabular_hmonth ( opt, lat, lon, tz, month, year);
2037 }
2038 }
2039 else
2040 {
2041 if (opt.iCal) print_ical_header ();
2042
2043 /* get date of month start */
2044 hdate_set_hdate (&h, 1, month, year);
2045
2046 /* if leap year, print both Adar months */
2047 if (h.hd_size_of_year > 365 && month == 6)
2048 {
2049 hdate_set_hdate (&h, 1, 13, year);
2050 print_hmonth (&h, opt, lat, lon, tz, 13, year);
2051 hdate_set_hdate (&h, 1, 14, year);
2052 print_hmonth (&h, opt, lat, lon, tz, 14, year);
2053 }
2054 else
2055 {
2056 print_hmonth (&h, opt, lat, lon, tz, month, year);
2057 }
2058 if (opt.iCal)
2059 print_ical_footer ();
2060 }
2061 }
2062
2063 /************************************************************
2064 * process entire Gregorian month
2065 ************************************************************/
2066 else
2067 {
2068 if ((month <= 0) || (month > 12))
2069 { print_parm_error(N_("month")); exit_main(&opt,0); }
2070
2071 if (opt.tablular_output)
2072 {
2073 print_tabular_header( opt );
2074 print_tabular_gmonth(opt, lat, lon, tz, month, year);
2075 }
2076
2077 else
2078 {
2079 if (opt.iCal)print_ical_header ();
2080
2081 print_gmonth (opt, lat, lon, tz, month, year);
2082
2083 if (opt.iCal) print_ical_footer ();
2084 }
2085 }
2086 }
2087
2088
2089 /************************************************************
2090 * parse input date - day, month and year entered
2091 ************************************************************/
2092 else if (argc == (optind + 3))
2093 {
2094 year = atoi (argv[optind + 2]);
2095 month = atoi (argv[optind + 1]);
2096 day = atoi (argv[optind]);
2097
2098 /* handle error */
2099 if (year <= 0) { print_parm_error(N_("year")); exit_main(&opt,0); }
2100
2101
2102 /************************************************************
2103 * get Hebrew date
2104 ************************************************************/
2105 if (year > 3000)
2106 {
2107 /* begin bounds check for month */
2108 if ((month <= 0) || (month > 14))
2109 { print_parm_error(N_("month")); exit_main(&opt,0); }
2110 hdate_set_hdate (&h, 1, 1, year);
2111 if ((h.hd_size_of_year <365) && (month >12))
2112 { print_parm_error(N_("month")); exit_main(&opt,0); }
2113 /* end bounds check for month */
2114
2115 if ((day <= 0) || (day > 30) ||
2116 ((day > 29) && ((month==4) || (month==6) || (month==8) || (month=10) || (month==12) || (month==14))) ||
2117 (((h.hd_size_of_year==353) || (h.hd_size_of_year==383)) && ((month==2) || (month==3)) && (day >29)) ||
2118 (((h.hd_size_of_year==354) || (h.hd_size_of_year==384)) && (month==2) && (day>29)) )
2119 { print_parm_error(N_("day")); exit_main(&opt,0); }
2120
2121
2122 hdate_set_hdate (&h, day, month, year);
2123 }
2124
2125 /************************************************************
2126 * get Gregorian date
2127 ************************************************************/
2128 else
2129 {
2130 if ((month <= 0) || (month > 12))
2131 { print_parm_error(N_("month")); exit_main(&opt,0); }
2132 if ((day <= 0) ||
2133 ((day > 31) && ((month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10) ||(month==12))) ||
2134 ((day > 30) && ((month==4) || (month==6) || (month==9) || (month==11))) ||
2135 ((day > 29) && (month==2) && ((year%4)==0)) ||
2136 ((day > 28) && (month==2) && ((year%4)!=0))
2137 )
2138 { print_parm_error(N_("day")); exit_main(&opt,0); }
2139
2140 hdate_set_gdate (&h, day, month, year);
2141 }
2142
2143 /************************************************************
2144 * process a single date
2145 ************************************************************/
2146 if (opt.tablular_output)
2147 {
2148 print_tabular_header( opt );
2149 print_tabular_day(&h, opt, lat, lon, tz);
2150 }
2151
2152 else
2153 {
2154 if (opt.iCal) print_ical_header ();
2155 print_day (&h, opt, lat, lon, tz);
2156
2157 if (opt.iCal) print_ical_footer ();
2158 }
2159 }
2160
2161
2162 /************************************************************
2163 * parse input date - too many fields were received
2164 ************************************************************/
2165 else
2166 {
2167 error(0,0,"%s", N_("too many arguments; after options max is dd mm yyyy"));
2168 exit_main(&opt,0);
2169 }
2170
2171 return 0;
2172 }
0 # translation of libhdate.po to Spanish
1 # This file is distributed under the same license as the libhdate package.
2 # Copyright (C) 2005 Yaacov Zamir, Peled Esti
3 # Peled Esti <esti@actcom.co.il>, 2005.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: es_MX\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
10 "PO-Revision-Date: 2005-03-07 12:44+0200\n"
11 "Last-Translator: Peled Esti <esti@actcom.co.il>\n"
12 "Language-Team: Spanish\n"
13 "Language: es_MX\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #: src/hdate_strings.c:186 src/hdate_strings.c:190
19 msgid "translator"
20 msgstr "Esther Peled <esti@actcom.co.il>"
21
22 #: src/hdate_strings.c:248
23 msgid "Sunday"
24 msgstr "Domingo"
25
26 #: src/hdate_strings.c:248
27 msgid "Monday"
28 msgstr "Lunes"
29
30 #: src/hdate_strings.c:248
31 msgid "Tuesday"
32 msgstr "Martes"
33
34 #: src/hdate_strings.c:248
35 msgid "Wednesday"
36 msgstr "Miercoles"
37
38 #: src/hdate_strings.c:249
39 msgid "Thursday"
40 msgstr "Jueves"
41
42 #: src/hdate_strings.c:249
43 msgid "Friday"
44 msgstr "Viernes"
45
46 #: src/hdate_strings.c:249
47 msgid "Saturday"
48 msgstr "Sabado"
49
50 #: src/hdate_strings.c:251
51 msgid "Sun"
52 msgstr "Dom"
53
54 #: src/hdate_strings.c:251
55 msgid "Mon"
56 msgstr "Lun"
57
58 #: src/hdate_strings.c:251
59 msgid "Tue"
60 msgstr "Mar"
61
62 #: src/hdate_strings.c:251
63 msgid "Wed"
64 msgstr "Mier"
65
66 #: src/hdate_strings.c:251
67 msgid "Thu"
68 msgstr "Jue"
69
70 #: src/hdate_strings.c:252
71 msgid "Fri"
72 msgstr "Vier"
73
74 #: src/hdate_strings.c:252
75 msgid "Sat"
76 msgstr "Sab"
77
78 #: src/hdate_strings.c:265 src/hdate_strings.c:288
79 msgid "none"
80 msgstr "ninguno"
81
82 #: src/hdate_strings.c:265 src/hdate_strings.c:288
83 msgid "Bereshit"
84 msgstr "Bereshit"
85
86 #: src/hdate_strings.c:265 src/hdate_strings.c:288
87 msgid "Noach"
88 msgstr "Noaj"
89
90 #: src/hdate_strings.c:266 src/hdate_strings.c:289
91 msgid "Lech-Lecha"
92 msgstr "Lej-Lejá"
93
94 #: src/hdate_strings.c:266 src/hdate_strings.c:289
95 msgid "Vayera"
96 msgstr "Vaira"
97
98 #: src/hdate_strings.c:266 src/hdate_strings.c:289
99 msgid "Chayei Sara"
100 msgstr "Jayei Sará"
101
102 #: src/hdate_strings.c:267 src/hdate_strings.c:290
103 #, fuzzy
104 msgid "Toldot"
105 msgstr "Toldot"
106
107 #: src/hdate_strings.c:267 src/hdate_strings.c:290
108 #, fuzzy
109 msgid "Vayetzei"
110 msgstr "Vayetzei"
111
112 #: src/hdate_strings.c:267 src/hdate_strings.c:290
113 #, fuzzy
114 msgid "Vayishlach"
115 msgstr "Vayishalaj"
116
117 #: src/hdate_strings.c:268 src/hdate_strings.c:291
118 #, fuzzy
119 msgid "Vayeshev"
120 msgstr "Vayeshev"
121
122 #: src/hdate_strings.c:268 src/hdate_strings.c:291
123 #, fuzzy
124 msgid "Miketz"
125 msgstr "Miketz"
126
127 #: src/hdate_strings.c:268 src/hdate_strings.c:291
128 #, fuzzy
129 msgid "Vayigash"
130 msgstr "Vayigash"
131
132 #: src/hdate_strings.c:269 src/hdate_strings.c:292
133 #, fuzzy
134 msgid "Vayechi"
135 msgstr "Vayejí"
136
137 #: src/hdate_strings.c:269 src/hdate_strings.c:292
138 msgid "Shemot"
139 msgstr "Shemot"
140
141 #: src/hdate_strings.c:269 src/hdate_strings.c:292
142 msgid "Vaera"
143 msgstr "Vaerá"
144
145 #: src/hdate_strings.c:270 src/hdate_strings.c:293
146 msgid "Bo"
147 msgstr "Bo"
148
149 #: src/hdate_strings.c:270 src/hdate_strings.c:293
150 msgid "Beshalach"
151 msgstr "Beshalaj"
152
153 #: src/hdate_strings.c:270 src/hdate_strings.c:293
154 msgid "Yitro"
155 msgstr "Yitro"
156
157 #: src/hdate_strings.c:271 src/hdate_strings.c:294
158 msgid "Mishpatim"
159 msgstr "Mishpatim"
160
161 #: src/hdate_strings.c:271 src/hdate_strings.c:294
162 msgid "Terumah"
163 msgstr "Terumá"
164
165 #: src/hdate_strings.c:271 src/hdate_strings.c:294
166 msgid "Tetzaveh"
167 msgstr "Tetzavé"
168
169 #: src/hdate_strings.c:272 src/hdate_strings.c:295
170 msgid "Ki Tisa"
171 msgstr "Ki Tisá"
172
173 #: src/hdate_strings.c:272 src/hdate_strings.c:295
174 msgid "Vayakhel"
175 msgstr "Vayajel"
176
177 #: src/hdate_strings.c:272 src/hdate_strings.c:295
178 msgid "Pekudei"
179 msgstr "Pekudei"
180
181 #: src/hdate_strings.c:273 src/hdate_strings.c:296
182 msgid "Vayikra"
183 msgstr "Vayikrá"
184
185 #: src/hdate_strings.c:273 src/hdate_strings.c:296
186 msgid "Tzav"
187 msgstr "Tzav"
188
189 #: src/hdate_strings.c:273 src/hdate_strings.c:296
190 msgid "Shmini"
191 msgstr "Shemini"
192
193 #: src/hdate_strings.c:274 src/hdate_strings.c:297
194 msgid "Tazria"
195 msgstr "Tazría"
196
197 #: src/hdate_strings.c:274 src/hdate_strings.c:297
198 msgid "Metzora"
199 msgstr "Metzorá"
200
201 #: src/hdate_strings.c:274 src/hdate_strings.c:297
202 msgid "Achrei Mot"
203 msgstr "Ajrei Mot"
204
205 #: src/hdate_strings.c:275 src/hdate_strings.c:298
206 msgid "Kedoshim"
207 msgstr "Kedoshim"
208
209 #: src/hdate_strings.c:275 src/hdate_strings.c:298
210 msgid "Emor"
211 msgstr "Emor"
212
213 #: src/hdate_strings.c:275 src/hdate_strings.c:298
214 msgid "Behar"
215 msgstr "Bejar"
216
217 #: src/hdate_strings.c:276 src/hdate_strings.c:299
218 msgid "Bechukotai"
219 msgstr "Bejukotai"
220
221 #: src/hdate_strings.c:276 src/hdate_strings.c:299
222 msgid "Bamidbar"
223 msgstr "Bamidbar"
224
225 #: src/hdate_strings.c:276 src/hdate_strings.c:299
226 #, fuzzy
227 msgid "Nasso"
228 msgstr "Nasso"
229
230 #: src/hdate_strings.c:277 src/hdate_strings.c:300
231 msgid "Beha'alotcha"
232 msgstr "Beha'alotja"
233
234 #: src/hdate_strings.c:277 src/hdate_strings.c:300
235 msgid "Sh'lach"
236 msgstr "Shalaj"
237
238 #: src/hdate_strings.c:277 src/hdate_strings.c:300
239 msgid "Korach"
240 msgstr "Koraj"
241
242 #: src/hdate_strings.c:278 src/hdate_strings.c:301
243 msgid "Chukat"
244 msgstr "Jukat"
245
246 #: src/hdate_strings.c:278 src/hdate_strings.c:301
247 msgid "Balak"
248 msgstr "Balak"
249
250 #: src/hdate_strings.c:278 src/hdate_strings.c:301
251 msgid "Pinchas"
252 msgstr "Pinjas"
253
254 #: src/hdate_strings.c:279 src/hdate_strings.c:302
255 msgid "Matot"
256 msgstr "Matot"
257
258 #: src/hdate_strings.c:279 src/hdate_strings.c:302
259 msgid "Masei"
260 msgstr "Masei"
261
262 #: src/hdate_strings.c:279 src/hdate_strings.c:302
263 msgid "Devarim"
264 msgstr "Devarim"
265
266 #: src/hdate_strings.c:280 src/hdate_strings.c:303
267 msgid "Vaetchanan"
268 msgstr "Vaetjanan"
269
270 #: src/hdate_strings.c:280 src/hdate_strings.c:303
271 msgid "Eikev"
272 msgstr "Eikev"
273
274 #: src/hdate_strings.c:280 src/hdate_strings.c:303
275 msgid "Re'eh"
276 msgstr "Re'é"
277
278 #: src/hdate_strings.c:281 src/hdate_strings.c:304
279 msgid "Shoftim"
280 msgstr "Shoftim"
281
282 #: src/hdate_strings.c:281 src/hdate_strings.c:304
283 msgid "Ki Teitzei"
284 msgstr "Ki Teitzei"
285
286 #: src/hdate_strings.c:281 src/hdate_strings.c:304
287 msgid "Ki Tavo"
288 msgstr "Ki Tavó"
289
290 #: src/hdate_strings.c:282 src/hdate_strings.c:305
291 msgid "Nitzavim"
292 msgstr "Nitzavim"
293
294 #: src/hdate_strings.c:282 src/hdate_strings.c:305
295 msgid "Vayeilech"
296 msgstr "Vayeilej"
297
298 #: src/hdate_strings.c:282 src/hdate_strings.c:305
299 msgid "Ha'Azinu"
300 msgstr "Ha'Azinu"
301
302 #: src/hdate_strings.c:283 src/hdate_strings.c:306
303 msgid "Vezot Habracha"
304 msgstr "Vezot Haberaja"
305
306 #: src/hdate_strings.c:284 src/hdate_strings.c:307
307 #, fuzzy
308 msgid "Vayakhel-Pekudei"
309 msgstr "Vayakhel-Pekudei"
310
311 #: src/hdate_strings.c:284 src/hdate_strings.c:307
312 msgid "Tazria-Metzora"
313 msgstr "Tazría-Metzora"
314
315 #: src/hdate_strings.c:284 src/hdate_strings.c:307
316 msgid "Achrei Mot-Kedoshim"
317 msgstr "Ajrei Mot-Kedoshim"
318
319 #: src/hdate_strings.c:285 src/hdate_strings.c:308
320 msgid "Behar-Bechukotai"
321 msgstr "Bejar-Bejukotai"
322
323 #: src/hdate_strings.c:285 src/hdate_strings.c:308
324 msgid "Chukat-Balak"
325 msgstr "Jukat-Balak"
326
327 #: src/hdate_strings.c:285 src/hdate_strings.c:308
328 msgid "Matot-Masei"
329 msgstr "Matot-Masei"
330
331 #: src/hdate_strings.c:286 src/hdate_strings.c:309
332 #, fuzzy
333 msgid "Nitzavim-Vayeilech"
334 msgstr "Nitzavim-Vayeilej"
335
336 #: src/hdate_strings.c:364 src/hdate_strings.c:369
337 msgid "Tishrei"
338 msgstr "Tishrei"
339
340 #: src/hdate_strings.c:364 src/hdate_strings.c:369
341 msgid "Cheshvan"
342 msgstr "Jeshván"
343
344 #: src/hdate_strings.c:364 src/hdate_strings.c:369
345 msgid "Kislev"
346 msgstr "Kislev"
347
348 #: src/hdate_strings.c:364 src/hdate_strings.c:369
349 msgid "Tevet"
350 msgstr "Tevet"
351
352 #: src/hdate_strings.c:365 src/hdate_strings.c:370
353 #, fuzzy
354 msgid "Sh'vat"
355 msgstr "Sh'vat"
356
357 #: src/hdate_strings.c:365 src/hdate_strings.c:370
358 msgid "Adar"
359 msgstr "Adar"
360
361 #: src/hdate_strings.c:365 src/hdate_strings.c:370
362 msgid "Nisan"
363 msgstr "Nisan"
364
365 #: src/hdate_strings.c:365 src/hdate_strings.c:370
366 #, fuzzy
367 msgid "Iyyar"
368 msgstr "Iyyar"
369
370 #: src/hdate_strings.c:366 src/hdate_strings.c:371
371 msgid "Sivan"
372 msgstr "Siván"
373
374 #: src/hdate_strings.c:366 src/hdate_strings.c:371
375 #, fuzzy
376 msgid "Tammuz"
377 msgstr "Ayuno de Tammuz"
378
379 #: src/hdate_strings.c:366 src/hdate_strings.c:371
380 msgid "Av"
381 msgstr "Av"
382
383 #: src/hdate_strings.c:366 src/hdate_strings.c:371
384 msgid "Elul"
385 msgstr "Elul"
386
387 #: src/hdate_strings.c:366 src/hdate_strings.c:371
388 msgid "Adar I"
389 msgstr "Adar I"
390
391 #: src/hdate_strings.c:367 src/hdate_strings.c:372
392 msgid "Adar II"
393 msgstr "Adar II"
394
395 #: src/hdate_strings.c:384
396 msgid "January"
397 msgstr "Enero"
398
399 #: src/hdate_strings.c:384
400 msgid "February"
401 msgstr "Febrero"
402
403 #: src/hdate_strings.c:384
404 msgid "March"
405 msgstr "Marzo"
406
407 #: src/hdate_strings.c:385
408 msgid "April"
409 msgstr "Abril"
410
411 #: src/hdate_strings.c:385 src/hdate_strings.c:388
412 msgid "May"
413 msgstr "May"
414
415 #: src/hdate_strings.c:385
416 msgid "June"
417 msgstr "Junio"
418
419 #: src/hdate_strings.c:386
420 msgid "July"
421 msgstr "Julio"
422
423 #: src/hdate_strings.c:386
424 msgid "August"
425 msgstr "Agosto"
426
427 #: src/hdate_strings.c:386
428 msgid "September"
429 msgstr "Septiembre"
430
431 #: src/hdate_strings.c:387
432 msgid "October"
433 msgstr "Octubre"
434
435 #: src/hdate_strings.c:387
436 msgid "November"
437 msgstr "Noviembre"
438
439 #: src/hdate_strings.c:387
440 msgid "December"
441 msgstr "Diciembre"
442
443 #: src/hdate_strings.c:388
444 msgid "Jan"
445 msgstr "Ene"
446
447 #: src/hdate_strings.c:388
448 msgid "Feb"
449 msgstr "Feb"
450
451 #: src/hdate_strings.c:388
452 msgid "Mar"
453 msgstr "Mar"
454
455 #: src/hdate_strings.c:388
456 msgid "Apr"
457 msgstr "Abr"
458
459 #: src/hdate_strings.c:389
460 msgid "Jun"
461 msgstr "Jun"
462
463 #: src/hdate_strings.c:389
464 msgid "Jul"
465 msgstr "Jul"
466
467 #: src/hdate_strings.c:389
468 msgid "Aug"
469 msgstr "Ago"
470
471 #: src/hdate_strings.c:389
472 msgid "Sep"
473 msgstr "Sep"
474
475 #: src/hdate_strings.c:389
476 msgid "Oct"
477 msgstr "Oct"
478
479 #: src/hdate_strings.c:390
480 msgid "Nov"
481 msgstr "Nov"
482
483 #: src/hdate_strings.c:390
484 msgid "Dec"
485 msgstr "Dic"
486
487 #: src/hdate_strings.c:396 src/hdate_strings.c:416
488 msgid "Rosh Hashana I"
489 msgstr "Rosh Hashana I"
490
491 #: src/hdate_strings.c:396 src/hdate_strings.c:416
492 msgid "Rosh Hashana II"
493 msgstr "Rosh Hashana II"
494
495 #: src/hdate_strings.c:397 src/hdate_strings.c:417
496 msgid "Tzom Gedaliah"
497 msgstr "Ayuno de Gedaliah"
498
499 #: src/hdate_strings.c:397 src/hdate_strings.c:417
500 msgid "Yom Kippur"
501 msgstr "Yom Kippur"
502
503 #: src/hdate_strings.c:398 src/hdate_strings.c:418
504 msgid "Sukkot"
505 msgstr "Sukkot"
506
507 #: src/hdate_strings.c:398 src/hdate_strings.c:418
508 msgid "Hol hamoed Sukkot"
509 msgstr "Hol hamoed Sukkot"
510
511 #: src/hdate_strings.c:399 src/hdate_strings.c:419
512 msgid "Hoshana raba"
513 msgstr "Hoshana raba"
514
515 #: src/hdate_strings.c:399 src/hdate_strings.c:419
516 msgid "Simchat Torah"
517 msgstr "Simjat Torah"
518
519 #: src/hdate_strings.c:400 src/hdate_strings.c:420
520 msgid "Chanukah"
521 msgstr "Januka"
522
523 #: src/hdate_strings.c:400 src/hdate_strings.c:420
524 #, fuzzy
525 msgid "Asara B'Tevet"
526 msgstr "Asara B'Tevet"
527
528 #: src/hdate_strings.c:401 src/hdate_strings.c:421
529 msgid "Tu B'Shvat"
530 msgstr "Tu B'Shvat"
531
532 #: src/hdate_strings.c:401 src/hdate_strings.c:421
533 #, fuzzy
534 msgid "Ta'anit Esther"
535 msgstr "Ta'anit Esther"
536
537 #: src/hdate_strings.c:402 src/hdate_strings.c:422
538 msgid "Purim"
539 msgstr "Purim"
540
541 #: src/hdate_strings.c:402 src/hdate_strings.c:422
542 msgid "Shushan Purim"
543 msgstr "Shushan Purim"
544
545 #: src/hdate_strings.c:403 src/hdate_strings.c:423
546 msgid "Pesach"
547 msgstr "Pesaj"
548
549 #: src/hdate_strings.c:403 src/hdate_strings.c:423
550 msgid "Hol hamoed Pesach"
551 msgstr "Jol hamoed Pesaj"
552
553 #: src/hdate_strings.c:404 src/hdate_strings.c:424
554 msgid "Yom HaAtzma'ut"
555 msgstr "Yom HaAtzma'ut"
556
557 #: src/hdate_strings.c:404 src/hdate_strings.c:424
558 msgid "Lag B'Omer"
559 msgstr "Lag B'Omer"
560
561 #: src/hdate_strings.c:405 src/hdate_strings.c:425
562 msgid "Erev Shavuot"
563 msgstr "Víspera de Shavuot"
564
565 #: src/hdate_strings.c:405 src/hdate_strings.c:425
566 msgid "Shavuot"
567 msgstr "Shavuot"
568
569 #: src/hdate_strings.c:406 src/hdate_strings.c:426
570 msgid "Tzom Tammuz"
571 msgstr "Ayuno de Tammuz"
572
573 #: src/hdate_strings.c:406 src/hdate_strings.c:426
574 msgid "Tish'a B'Av"
575 msgstr "Tish'a B'Av"
576
577 #: src/hdate_strings.c:407 src/hdate_strings.c:427
578 msgid "Tu B'Av"
579 msgstr "Tu B'Av"
580
581 #: src/hdate_strings.c:407 src/hdate_strings.c:427
582 msgid "Yom HaShoah"
583 msgstr "Día del Holocausto"
584
585 #: src/hdate_strings.c:408 src/hdate_strings.c:428
586 msgid "Yom HaZikaron"
587 msgstr "Día del Recuerdo"
588
589 #: src/hdate_strings.c:408 src/hdate_strings.c:428
590 #, fuzzy
591 msgid "Yom Yerushalayim"
592 msgstr "Yom Yerushalayim"
593
594 #: src/hdate_strings.c:409 src/hdate_strings.c:429
595 msgid "Shmini Atzeret"
596 msgstr "Shemini Atzeret"
597
598 #: src/hdate_strings.c:409 src/hdate_strings.c:429
599 msgid "Pesach VII"
600 msgstr "Pesaj VII"
601
602 #: src/hdate_strings.c:410 src/hdate_strings.c:430
603 msgid "Pesach VIII"
604 msgstr "Pesaj VIII"
605
606 #: src/hdate_strings.c:410 src/hdate_strings.c:430
607 msgid "Shavuot II"
608 msgstr "Shavuot II"
609
610 #: src/hdate_strings.c:411 src/hdate_strings.c:431
611 #, fuzzy
612 msgid "Sukkot II"
613 msgstr "Sukkot II"
614
615 #: src/hdate_strings.c:411 src/hdate_strings.c:431
616 #, fuzzy
617 msgid "Pesach II"
618 msgstr "Pesaj II"
619
620 #: src/hdate_strings.c:412 src/hdate_strings.c:432
621 msgid "Family Day"
622 msgstr ""
623
624 #: src/hdate_strings.c:412 src/hdate_strings.c:432
625 msgid "Memorial day for fallen whose place of burial is unknown"
626 msgstr ""
627
628 #: src/hdate_strings.c:413
629 msgid "Yitzhak Rabin memorial day"
630 msgstr ""
631
632 #: src/hdate_strings.c:413
633 msgid "Zeev Zhabotinsky day"
634 msgstr ""
635
636 #: src/hdate_strings.c:414 src/hdate_strings.c:434
637 #, fuzzy
638 msgid "Erev Yom Kippur"
639 msgstr "Víspera de Yom Kippur"
640
641 #: src/hdate_strings.c:433
642 msgid "Rabin memorial day"
643 msgstr ""
644
645 #: src/hdate_strings.c:433
646 msgid "Zhabotinsky day"
647 msgstr ""
648
649 #: src/hdate_strings.c:514
650 msgid "in the Omer"
651 msgstr ""
652
653 #: examples/hcal/hcal.c:142
654 msgid ""
655 "# configuration file for hcal - Hebrew calendar program\n"
656 "# part of package libhdate\n"
657 "#\n"
658 "# Should you mangle this file and wish to restore its default content,\n"
659 "# rename or delete this file and run hcal; hcal will automatically\n"
660 "# regenerate the default content.\n"
661 "#\n"
662 "# Your system administrator can set system-wide defaults for hcal by\n"
663 "# modifying file <not yet implemented>.\n"
664 "# You may override all defaults by changing the contents of this file.\n"
665 "#\n"
666 "# Version information\n"
667 "# This may be used by updates to hcal to determine how to parse the file\n"
668 "# and whether additional information and options should be appended to\n"
669 "# the end of this file.\n"
670 "VERSION=2.00\n"
671 "# Location awareness\n"
672 "# hcal wants to accurately highlight the current Hebrew day, including\n"
673 "# during the hours between sunset and secular midnight. If you don't\n"
674 "# provide it with latitude, longitude, and time zone information, hcal\n"
675 "# will try to guess the information, based upon your system timezone,\n"
676 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
677 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
678 "# with a message that includes the guessed location.\n"
679 "# hcal's guesses will also affect its default behaviour for ouput of\n"
680 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
681 "#SUNSET_AWARE=TRUE\n"
682 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
683 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
684 "# delimiters. Use negative values to indicate South and West, or\n"
685 "# use the abbreviated compass directions N, S, E, W.\n"
686 "#LATITUDE=\n"
687 "#LONGITUDE=\n"
688 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
689 "# with the characters :'\" as possible delimiters.\n"
690 "#TIMEZONE=\n"
691 "\n"
692 "# Israel and the diaspora\n"
693 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
694 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
695 "# forces hcal to display calendar information for Israel, using hcal's\n"
696 "# default coordinates foe Israel, or coordinates that you provide that\n"
697 "# seem legitmately within Israel.\n"
698 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
699 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
700 "# a non-resident vistor to Israel. The command line options for these\n"
701 "# features are --israel, -I, --diaspora, -d.\n"
702 "#FORCE_DIASPORA=FALSE;\n"
703 "#FORCE_ISRAEL=FALSE;\n"
704 "\n"
705 "# Shabbat related\n"
706 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
707 "# The command line options for these features are -p (--parasha), and\n"
708 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
709 "(minutes\n"
710 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
711 "# (minutes after sunset).\n"
712 "#PARASHA_NAMES=FALSE\n"
713 "#SHABBAT_INFO=FALSE\n"
714 "#CANDLE_LIGHTING=FALSE\n"
715 "#HAVDALAH=FALSE\n"
716 "\n"
717 "# Holiday identification\n"
718 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
719 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
720 "# will have hcal output after the month's calendar, a list of the month's\n"
721 "# holidays along with the days on which they occur.\n"
722 "#FOOTNOTE=FALSE\n"
723 "\n"
724 "# Output in hebrew characters\n"
725 "# hcal defaults to output all information in your default language, so\n"
726 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
727 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
728 "# still outputting gregorian information in your default language. To\n"
729 "# output ALL information in Hebrew, run something like this:\n"
730 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
731 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
732 "# output, you need to install a terminal font that includes the Hebrew\n"
733 "# character set (hint: unicode).\n"
734 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
735 "#FORCE_HEBREW=FALSE\n"
736 "\n"
737 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
738 "# Unfortunately, the world can not be depended upon to be either. Most\n"
739 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
740 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
741 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
742 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
743 "# This will reverse the order of the Hebrew characters, so they will\n"
744 "# display 'visual'ly correct; however, such output will not be suitable\n"
745 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
746 "# automatically forces hebrew.\n"
747 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
748 "#OUTPUT_BIDI=FALSE\n"
749 "\n"
750 "# Display enhancements\n"
751 "# hcal defaults to display the current day in reverse video\n"
752 "# The command line option for this feature is --no-reverse\n"
753 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
754 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
755 "# colorized output may yield unexpected results.\n"
756 "#COLORIZE=FALSE\n"
757 "\n"
758 "# HTML OUTPUT\n"
759 "#OUTPUT_HTML=FALSE\n"
760 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
761 "\n"
762 "# Suppress alerts and warnings\n"
763 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
764 "#QUIET_ALERTS=FALSE\n"
765 "\n"
766 "# Three month display\n"
767 "# hcal can display a previous, current and next month side-by-side. hcal\n"
768 "# can also display a calendar for an entire year in four rows of three\n"
769 "# months each. Note that this will display properly only if your console\n"
770 "# is set for at least 127 columns. Note also that setting this option to\n"
771 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
772 "#THREE_MONTH=FALSE\n"
773 "\n"
774 "# User-defined menus\n"
775 "# You may specify here command-line strings to optionally be parsed\n"
776 "# by hcal at execution time. To do so, use the command line option -m\n"
777 "# (--menu). hcal will process first the settings of this config file,\n"
778 "# then the other settings of your command line, and then will prompt\n"
779 "# you for which menu item you would like to select. hcal will process\n"
780 "# your menu selection as if it were a new command line, further modifying\n"
781 "# all the prior settings.\n"
782 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
783 "# truncated at one hundred characters\n"
784 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
785 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
786 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
787 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
788 msgstr ""
789
790 #: examples/hcal/hcal.c:271
791 msgid ""
792 "hcal - Hebrew calendar\n"
793 "version 1.6"
794 msgstr ""
795
796 #: examples/hcal/hcal.c:281
797 msgid ""
798 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
799 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
800 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
801 " timezone: -z nn[( .nn | :mm )]\n"
802 "Try 'hcal --help' for more information"
803 msgstr ""
804
805 #: examples/hcal/hcal.c:295
806 msgid ""
807 "Hebrew calendar\n"
808 "OPTIONS:\n"
809 " -1 --one-month over-ride config file setting if you had set\n"
810 " option --three-month as a default there\n"
811 " -3 --three-month displays previous/next months\n"
812 " side by side. requires 127 columns\n"
813 " -b --bidi prints hebrew in reverse (visual)\n"
814 " --visual\n"
815 " --no-bidi over-ride config file setting if you had set\n"
816 " --no-visual option -bidi as a default there\n"
817 " -c --colorize displays in calming, muted tones\n"
818 " --no-color over-ride a --colorize setting in your config file\n"
819 " -d --diaspora use diaspora reading and holidays.\n"
820 " -f --footnote print descriptive notes of holidays\n"
821 " --no-footnote over-ride a footnote setting in your config file\n"
822 " -h --html output in html format to stdout\n"
823 " -H --hebrew print hebrew information in Hebrew\n"
824 " -i use external css file \"./hcal.css\".\n"
825 " -I --israel override a diaspora default\n"
826 " --no-reverse do not highlight today's date\n"
827 " -m --menu prompt user-defined menu from config file\n"
828 " -p --parasha print week's parasha on each calendar row\n"
829 " -q --quiet-alerts suppress warning messages\n"
830 " -s --shabbat print Shabbat times and parshiot\n"
831 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
832 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
833 " -z --timezone nn timezone, +/-UTC\n"
834 " -l --latitude yy latitude yy degrees. Negative values are South\n"
835 " -L --longitude xx longitude xx degrees. Negative values are West\n"
836 "\n"
837 "All options can be made default in the config file, or menu-ized for\n"
838 "easy selection."
839 msgstr ""
840
841 #: examples/hcal/hcal.c:1877
842 msgid ""
843 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
844 "month' mode"
845 msgstr ""
846
847 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
848 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
849 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
850 msgid "error"
851 msgstr ""
852
853 #: examples/hcal/hcal.c:1949
854 msgid "too many parameters received. expected [[mm] [yyyy]"
855 msgstr ""
856
857 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
858 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
859 msgid "year"
860 msgstr ""
861
862 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
863 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
864 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
865 #: examples/hcal/hdate.c:2132
866 msgid "month"
867 msgstr ""
868
869 #: examples/hcal/hdate.c:42
870 msgid "sunrise"
871 msgstr ""
872
873 #: examples/hcal/hdate.c:43
874 msgid "sunset"
875 msgstr ""
876
877 #: examples/hcal/hdate.c:44
878 msgid "first_light"
879 msgstr ""
880
881 #: examples/hcal/hdate.c:45
882 msgid "talit"
883 msgstr ""
884
885 #: examples/hcal/hdate.c:46
886 msgid "midday"
887 msgstr ""
888
889 #: examples/hcal/hdate.c:47
890 msgid "first_stars"
891 msgstr ""
892
893 #: examples/hcal/hdate.c:48
894 msgid "three_stars"
895 msgstr ""
896
897 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
898 msgid "sun_hour"
899 msgstr ""
900
901 #: examples/hcal/hdate.c:50
902 msgid "candle-lighting"
903 msgstr ""
904
905 #: examples/hcal/hdate.c:51
906 msgid "havdalah"
907 msgstr ""
908
909 #: examples/hcal/hdate.c:81
910 msgid ""
911 "# configuration file for hdate - Hebrew date information program\n"
912 "# part of package libhdate\n"
913 "#\n"
914 "# Should you mangle this file and wish to restore its default content,\n"
915 "# rename or delete this file and run hdate; hdate will automatically\n"
916 "# regenerate the default content.\n"
917 "#\n"
918 "# Your system administrator can set system-wide defaults for hcal by\n"
919 "# modifying file <not yet implemented>.\n"
920 "# You may override all defaults by changing the contents of this file.\n"
921 "#\n"
922 "# Version information\n"
923 "# This may be used by updates to hcal to determine how to parse the file\n"
924 "# and whether additional information and options should be appended to\n"
925 "# the end of this file.\n"
926 "VERSION=2.00\n"
927 "#\n"
928 "# Location awareness\n"
929 "# hdate wants to accurately highlight the current Hebrew day, including\n"
930 "# during the hours between sunset and secular midnight. If you don't\n"
931 "# provide it with latitude, longitude, and time zone information, hdate\n"
932 "# will try to guess the information, based upon your system timezone,\n"
933 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
934 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
935 "# with a message that includes the guessed location.\n"
936 "# hdate's guesses will also affect its default behaviour for ouput of\n"
937 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
938 "#SUNSET_AWARE=TRUE\n"
939 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
940 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
941 "# delimiters. Use negative values to indicate South and West, or\n"
942 "# use the abbreviated compass directions N, S, E, W.\n"
943 "#LATITUDE=\n"
944 "#LONGITUDE=\n"
945 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
946 "# with the characters :'\" as possible delimiters.\n"
947 "#TIMEZONE=\n"
948 "\n"
949 "# Output in hebrew characters\n"
950 "# hdate defaults to output all information in your default language, so\n"
951 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
952 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
953 "# still outputting gregorian information in your default language. To\n"
954 "# output ALL information in Hebrew, run something like this:\n"
955 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
956 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
957 "# output, you need to install a terminal font that includes the Hebrew\n"
958 "# character set (hint: unicode).\n"
959 "#FORCE_HEBREW=FALSE\n"
960 "\n"
961 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
962 "# Unfortunately, the world can not be depended upon to be either. Most\n"
963 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
964 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
965 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
966 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
967 "# This will reverse the order of the Hebrew characters, so they will\n"
968 "# display 'visual'ly correct; however, such output will not be suitable\n"
969 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
970 "# automatically forces hebrew.\n"
971 "#OUTPUT_BIDI=FALSE\n"
972 "\n"
973 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
974 "# in the following ways:\n"
975 "# option YOM ~> yom shishi, aleph tishrei ...\n"
976 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
977 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
978 "#YOM=FALSE\n"
979 "#LESHABBAT=FALSE\n"
980 "#LESEDER=FALSE\n"
981 "\n"
982 "#SUN_RISE_SET=FALSE\n"
983 "#TIMES_OF_DAY=FALSE\n"
984 "#SHORT_FORMAT=FALSE\n"
985 "#SEFIRAT_HAOMER=FALSE\n"
986 "#DIASPORA=FALSE\n"
987 "\n"
988 "\n"
989 "# Shabbat related\n"
990 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
991 "# The command line options for these features are -r (--parasha), and\n"
992 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
993 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
994 "# (minutes after sunset).\n"
995 "#PARASHA_NAMES=FALSE\n"
996 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
997 "#SHABBAT_INFO=FALSE\n"
998 "\n"
999 "#CANDLE_LIGHTING=FALSE\n"
1000 "#HAVDALAH=FALSE\n"
1001 "\n"
1002 "# Holiday related\n"
1003 "#HOLIDAYS=FALSE\n"
1004 "#ONLY_IF_HOLIDAY=FALSE\n"
1005 "\n"
1006 "# Tabular output\n"
1007 "# This option has hdate output the information you request in a single\n"
1008 "# comma-delimited line per day, suitable for piping or import to\n"
1009 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
1010 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
1011 "# The command line option for this feature is, um, --table\n"
1012 "#TABULAR=FALSE\n"
1013 "\n"
1014 "# iCal format\n"
1015 "# hdate can output its information in iCal-compatable format\n"
1016 "# ICAL=FALSE\n"
1017 "# Suppress alerts and warnings\n"
1018 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1019 "#QUIET_ALERTS=FALSE\n"
1020 "\n"
1021 "# Julian day number\n"
1022 "# The Julian day number is a .... See ... for more details.\n"
1023 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1024 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1025 "#JULIAN_DAY=FALSE\n"
1026 "\n"
1027 "# User-defined menus\n"
1028 "# You may specify here command-line strings to optionally be parsed\n"
1029 "# by hcal at execution time. To do so, use the command line option -m\n"
1030 "# (--menu). hcal will process first the settings of this config file,\n"
1031 "# then the other settings of your command line, and then will prompt\n"
1032 "# you for which menu item you would like to select. hcal will process\n"
1033 "# your menu selection as if it were a new command line, further modifying\n"
1034 "# all the prior settings.\n"
1035 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1036 "# truncated at one hundred characters\n"
1037 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1038 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1039 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1040 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1041 msgstr ""
1042
1043 #: examples/hcal/hdate.c:209
1044 msgid ""
1045 "hdate - display Hebrew date information\n"
1046 "version 1.6"
1047 msgstr ""
1048
1049 #: examples/hcal/hdate.c:219
1050 msgid ""
1051 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1052 " hdate [options] [coordinates timezone] [julian_day]\n"
1053 "\n"
1054 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1055 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1056 " timezone: -z nn[( .nn | :mm )]\n"
1057 "Try 'hdate --help' for more information"
1058 msgstr ""
1059
1060 #: examples/hcal/hdate.c:235
1061 msgid ""
1062 "hdate - display Hebrew date information\n"
1063 "OPTIONS:\n"
1064 " -b --bidi prints hebrew in reverse (visual)\n"
1065 " --visual\n"
1066 " -c print Shabbat start/end times.\n"
1067 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1068 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1069 " -d --diaspora use diaspora reading and holidays.\n"
1070 " -h --holidays print holidays.\n"
1071 " -H print only it is a holiday.\n"
1072 " -i --ical use iCal formated output.\n"
1073 " -j --julian print Julian day number.\n"
1074 " -m --menu prompt user-defined menu from config file\n"
1075 " -o --omer print Sefirat Haomer.\n"
1076 " -q --quiet-alerts suppress warning messages\n"
1077 " -r --parasha print weekly reading on saturday.\n"
1078 " -R print only if there is a weekly reading on Shabbat.\n"
1079 " -s --sun print sunrise/sunset times.\n"
1080 " -S --short-format print using short format.\n"
1081 " -t print day times: first light, talit, sunrise,\n"
1082 " midday, sunset, first stars, three stars.\n"
1083 " -T --table tabular output, suitable for spreadsheets\n"
1084 "\n"
1085 " -z --timezone nn timezone, +/-UTC\n"
1086 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1087 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1088 "\n"
1089 " --hebrew forces Hebrew to print in Hebrew characters\n"
1090 " --yom force Hebrew prefix to Hebrew day of week\n"
1091 " --leshabbat insert parasha between day of week and day\n"
1092 " --leseder insert parasha between day of week and day\n"
1093 " --not-sunset-aware don't display next day if after sunset\n"
1094 "\n"
1095 "All options can be made default in the config file, or menu-ized for\n"
1096 "easy selection."
1097 msgstr ""
1098
1099 #: examples/hcal/hdate.c:274
1100 msgid ""
1101 "ALERT: The information displayed is for today's Hebrew date.\n"
1102 " Because it is now after sunset, that means the data is\n"
1103 " for the Gregorian day beginning at midnight."
1104 msgstr ""
1105
1106 #: examples/hcal/hdate.c:405
1107 msgid "eve of "
1108 msgstr ""
1109
1110 #: examples/hcal/hdate.c:669
1111 msgid "today is day"
1112 msgstr ""
1113
1114 #: examples/hcal/hdate.c:743
1115 msgid "Gregorian date"
1116 msgstr ""
1117
1118 #: examples/hcal/hdate.c:743
1119 msgid "Hebrew Date"
1120 msgstr ""
1121
1122 #: examples/hcal/hdate.c:748
1123 #, fuzzy
1124 msgid "holiday"
1125 msgstr "Viernes"
1126
1127 #: examples/hcal/hdate.c:749
1128 msgid "omer count"
1129 msgstr ""
1130
1131 #: examples/hcal/hdate.c:750
1132 msgid "parashat"
1133 msgstr ""
1134
1135 #: examples/hcal/hdate.c:1016
1136 msgid "Parashat"
1137 msgstr ""
1138
1139 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1140 #, fuzzy
1141 msgid "day"
1142 msgstr "May"
1143
1144 #: examples/hcal/hdate.c:2168
1145 msgid "too many arguments; after options max is dd mm yyyy"
1146 msgstr ""
1147
1148 #: examples/hcal/local_functions.c:97
1149 msgid "parameter"
1150 msgstr ""
1151
1152 #: examples/hcal/local_functions.c:98
1153 msgid "is non-numeric or out of bounds"
1154 msgstr ""
1155
1156 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1157 msgid "option"
1158 msgstr ""
1159
1160 #: examples/hcal/local_functions.c:104
1161 msgid "missing parameter"
1162 msgstr ""
1163
1164 #: examples/hcal/local_functions.c:110
1165 msgid "ALERT: time zone not entered, using system local time zone"
1166 msgstr ""
1167
1168 #: examples/hcal/local_functions.c:117
1169 msgid "is not a valid option"
1170 msgstr ""
1171
1172 #: examples/hcal/local_functions.c:134
1173 msgid "ALERT: guessing... will use co-ordinates for"
1174 msgstr ""
1175
1176 #: examples/hcal/local_functions.c:142
1177 msgid "Los Angeles"
1178 msgstr ""
1179
1180 #: examples/hcal/local_functions.c:143
1181 msgid "Mexico City"
1182 msgstr ""
1183
1184 #: examples/hcal/local_functions.c:144
1185 msgid "New York City"
1186 msgstr ""
1187
1188 #: examples/hcal/local_functions.c:147
1189 msgid "Buenos Aires"
1190 msgstr ""
1191
1192 #: examples/hcal/local_functions.c:148
1193 msgid "London"
1194 msgstr ""
1195
1196 #: examples/hcal/local_functions.c:149
1197 msgid "Paris"
1198 msgstr ""
1199
1200 #: examples/hcal/local_functions.c:150
1201 msgid "Tel-Aviv"
1202 msgstr ""
1203
1204 #: examples/hcal/local_functions.c:151
1205 msgid "Moscow"
1206 msgstr ""
1207
1208 #: examples/hcal/local_functions.c:152
1209 msgid "Tashkent"
1210 msgstr ""
1211
1212 #: examples/hcal/local_functions.c:153
1213 msgid "Beijing"
1214 msgstr ""
1215
1216 #: examples/hcal/local_functions.c:155
1217 msgid "Honolulu"
1218 msgstr ""
1219
1220 #: examples/hcal/local_functions.c:156
1221 msgid "Hmmm, ... hate to do this, really ..."
1222 msgstr ""
1223
1224 #: examples/hcal/local_functions.c:156
1225 msgid "using co-ordinates for the equator, at the center of time zone"
1226 msgstr ""
1227
1228 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1229 #: examples/hcal/local_functions.c:337
1230 msgid "l (latitude)"
1231 msgstr ""
1232
1233 #: examples/hcal/local_functions.c:323
1234 msgid "L (Longitue)"
1235 msgstr ""
1236
1237 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1238 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1239 msgid "L (Longitude)"
1240 msgstr ""
1241
1242 #: examples/hcal/local_functions.c:446
1243 msgid "z (time zone)"
1244 msgstr ""
1245
1246 #: examples/hcal/local_functions.c:466
1247 msgid "z (timezone)"
1248 msgstr ""
1249
1250 #: examples/hcal/local_functions.c:490
1251 msgid "valid longitude parameter missing for given latitude"
1252 msgstr ""
1253
1254 #: examples/hcal/local_functions.c:495
1255 msgid "valid latitude parameter missing for given longitude"
1256 msgstr ""
1257
1258 #: examples/hcal/local_functions.c:533
1259 msgid "time zone value of"
1260 msgstr ""
1261
1262 #: examples/hcal/local_functions.c:534
1263 msgid "is incompatible with a longitude of"
1264 msgstr ""
1265
1266 #: examples/hcal/local_functions.c:534
1267 msgid "degrees"
1268 msgstr ""
1269
1270 #: examples/hcal/local_functions.c:642
1271 msgid ""
1272 "This seems to be to be your first time using this version.\n"
1273 "Please read the new documentation in the man page and config\n"
1274 "file. Attempting to create a config file ..."
1275 msgstr ""
1276
1277 #: examples/hcal/local_functions.c:676
1278 msgid "failure attempting to create config file"
1279 msgstr ""
1280
1281 #: examples/hcal/local_functions.c:680
1282 msgid "config file created"
1283 msgstr ""
1284
1285 #: examples/hcal/local_functions.c:681
1286 msgid "failure closing"
1287 msgstr ""
1288
1289 #: examples/hcal/local_functions.c:701
1290 msgid "memory allocation failure"
1291 msgstr ""
1292
1293 #: examples/hcal/local_functions.c:915
1294 msgid "your custom menu options (from your config file)"
1295 msgstr ""
1296
1297 #: examples/hcal/local_functions.c:921
1298 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1299 msgstr ""
1300
1301 #: examples/hcal/local_functions.c:924
1302 msgid "enter your selection, or <return> to continue"
1303 msgstr ""
1304
1305 #: examples/hcal/local_functions.c:928
1306 msgid "menu selection received was out of bounds"
1307 msgstr ""
1308
1309 #~ msgid "Tamuz"
1310 #~ msgstr "Tamuz"
0 # translation of libhdate.po to French
1 # This file is distributed under the same license as the libhdate package.
2 # Copyright (C) 2005 Yaacov Zamir
3 # Yaacov Zamir, 2005.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: fr\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
10 "PO-Revision-Date: 2005-03-07 12:44+0200\n"
11 "Last-Translator: Yaacov Zamir\n"
12 "Language-Team: Franch\n"
13 "Language: fr\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #: src/hdate_strings.c:186 src/hdate_strings.c:190
19 msgid "translator"
20 msgstr "Yaacov Zamir"
21
22 #: src/hdate_strings.c:248
23 msgid "Sunday"
24 msgstr "Dimanche"
25
26 #: src/hdate_strings.c:248
27 msgid "Monday"
28 msgstr "Lundi"
29
30 #: src/hdate_strings.c:248
31 msgid "Tuesday"
32 msgstr "Mardi"
33
34 #: src/hdate_strings.c:248
35 msgid "Wednesday"
36 msgstr "Mercredi"
37
38 #: src/hdate_strings.c:249
39 msgid "Thursday"
40 msgstr "Jeudi"
41
42 #: src/hdate_strings.c:249
43 msgid "Friday"
44 msgstr "Vendredi"
45
46 #: src/hdate_strings.c:249
47 msgid "Saturday"
48 msgstr "Samedi"
49
50 #: src/hdate_strings.c:251
51 msgid "Sun"
52 msgstr "Dim"
53
54 #: src/hdate_strings.c:251
55 msgid "Mon"
56 msgstr "Lun"
57
58 #: src/hdate_strings.c:251
59 msgid "Tue"
60 msgstr "Mar"
61
62 #: src/hdate_strings.c:251
63 msgid "Wed"
64 msgstr "Mer"
65
66 #: src/hdate_strings.c:251
67 msgid "Thu"
68 msgstr "Jeu"
69
70 #: src/hdate_strings.c:252
71 msgid "Fri"
72 msgstr "Ven"
73
74 #: src/hdate_strings.c:252
75 msgid "Sat"
76 msgstr "Sam"
77
78 #: src/hdate_strings.c:265 src/hdate_strings.c:288
79 msgid "none"
80 msgstr "nulle"
81
82 #: src/hdate_strings.c:265 src/hdate_strings.c:288
83 msgid "Bereshit"
84 msgstr "Bereshit"
85
86 #: src/hdate_strings.c:265 src/hdate_strings.c:288
87 msgid "Noach"
88 msgstr "Noach"
89
90 #: src/hdate_strings.c:266 src/hdate_strings.c:289
91 msgid "Lech-Lecha"
92 msgstr "Lech-Lecha"
93
94 #: src/hdate_strings.c:266 src/hdate_strings.c:289
95 msgid "Vayera"
96 msgstr "Vaira"
97
98 #: src/hdate_strings.c:266 src/hdate_strings.c:289
99 msgid "Chayei Sara"
100 msgstr "Chayei Sará"
101
102 #: src/hdate_strings.c:267 src/hdate_strings.c:290
103 msgid "Toldot"
104 msgstr "Toldot"
105
106 #: src/hdate_strings.c:267 src/hdate_strings.c:290
107 msgid "Vayetzei"
108 msgstr "Vayetzei"
109
110 #: src/hdate_strings.c:267 src/hdate_strings.c:290
111 msgid "Vayishlach"
112 msgstr "Vayishlach"
113
114 #: src/hdate_strings.c:268 src/hdate_strings.c:291
115 msgid "Vayeshev"
116 msgstr "Vayeshev"
117
118 #: src/hdate_strings.c:268 src/hdate_strings.c:291
119 msgid "Miketz"
120 msgstr "Miketz"
121
122 #: src/hdate_strings.c:268 src/hdate_strings.c:291
123 msgid "Vayigash"
124 msgstr "Vayigash"
125
126 #: src/hdate_strings.c:269 src/hdate_strings.c:292
127 msgid "Vayechi"
128 msgstr "Vayechí"
129
130 #: src/hdate_strings.c:269 src/hdate_strings.c:292
131 msgid "Shemot"
132 msgstr "Shemot"
133
134 #: src/hdate_strings.c:269 src/hdate_strings.c:292
135 msgid "Vaera"
136 msgstr "Vaerá"
137
138 #: src/hdate_strings.c:270 src/hdate_strings.c:293
139 msgid "Bo"
140 msgstr "Bo"
141
142 #: src/hdate_strings.c:270 src/hdate_strings.c:293
143 msgid "Beshalach"
144 msgstr "Beshalach"
145
146 #: src/hdate_strings.c:270 src/hdate_strings.c:293
147 msgid "Yitro"
148 msgstr "Yitro"
149
150 #: src/hdate_strings.c:271 src/hdate_strings.c:294
151 msgid "Mishpatim"
152 msgstr "Mishpatim"
153
154 #: src/hdate_strings.c:271 src/hdate_strings.c:294
155 msgid "Terumah"
156 msgstr "Terumá"
157
158 #: src/hdate_strings.c:271 src/hdate_strings.c:294
159 msgid "Tetzaveh"
160 msgstr "Tetzavé"
161
162 #: src/hdate_strings.c:272 src/hdate_strings.c:295
163 msgid "Ki Tisa"
164 msgstr "Ki Tisá"
165
166 #: src/hdate_strings.c:272 src/hdate_strings.c:295
167 msgid "Vayakhel"
168 msgstr "Vayakhel"
169
170 #: src/hdate_strings.c:272 src/hdate_strings.c:295
171 msgid "Pekudei"
172 msgstr "Pekudei"
173
174 #: src/hdate_strings.c:273 src/hdate_strings.c:296
175 msgid "Vayikra"
176 msgstr "Vayikrá"
177
178 #: src/hdate_strings.c:273 src/hdate_strings.c:296
179 msgid "Tzav"
180 msgstr "Tzav"
181
182 #: src/hdate_strings.c:273 src/hdate_strings.c:296
183 msgid "Shmini"
184 msgstr "Shemini"
185
186 #: src/hdate_strings.c:274 src/hdate_strings.c:297
187 msgid "Tazria"
188 msgstr "Tazría"
189
190 #: src/hdate_strings.c:274 src/hdate_strings.c:297
191 msgid "Metzora"
192 msgstr "Metzorá"
193
194 #: src/hdate_strings.c:274 src/hdate_strings.c:297
195 msgid "Achrei Mot"
196 msgstr "Achrei Mot"
197
198 #: src/hdate_strings.c:275 src/hdate_strings.c:298
199 msgid "Kedoshim"
200 msgstr "Kedoshim"
201
202 #: src/hdate_strings.c:275 src/hdate_strings.c:298
203 msgid "Emor"
204 msgstr "Emor"
205
206 #: src/hdate_strings.c:275 src/hdate_strings.c:298
207 msgid "Behar"
208 msgstr "Bechar"
209
210 #: src/hdate_strings.c:276 src/hdate_strings.c:299
211 msgid "Bechukotai"
212 msgstr "Bechukotai"
213
214 #: src/hdate_strings.c:276 src/hdate_strings.c:299
215 msgid "Bamidbar"
216 msgstr "Bamidbar"
217
218 #: src/hdate_strings.c:276 src/hdate_strings.c:299
219 msgid "Nasso"
220 msgstr "Nasso"
221
222 #: src/hdate_strings.c:277 src/hdate_strings.c:300
223 msgid "Beha'alotcha"
224 msgstr "Beha'alotcha"
225
226 #: src/hdate_strings.c:277 src/hdate_strings.c:300
227 msgid "Sh'lach"
228 msgstr "Shalach"
229
230 #: src/hdate_strings.c:277 src/hdate_strings.c:300
231 msgid "Korach"
232 msgstr "Korach"
233
234 #: src/hdate_strings.c:278 src/hdate_strings.c:301
235 msgid "Chukat"
236 msgstr "Chukat"
237
238 #: src/hdate_strings.c:278 src/hdate_strings.c:301
239 msgid "Balak"
240 msgstr "Balak"
241
242 #: src/hdate_strings.c:278 src/hdate_strings.c:301
243 msgid "Pinchas"
244 msgstr "Pinchas"
245
246 #: src/hdate_strings.c:279 src/hdate_strings.c:302
247 msgid "Matot"
248 msgstr "Matot"
249
250 #: src/hdate_strings.c:279 src/hdate_strings.c:302
251 msgid "Masei"
252 msgstr "Masei"
253
254 #: src/hdate_strings.c:279 src/hdate_strings.c:302
255 msgid "Devarim"
256 msgstr "Devarim"
257
258 #: src/hdate_strings.c:280 src/hdate_strings.c:303
259 msgid "Vaetchanan"
260 msgstr "Vaetchanan"
261
262 #: src/hdate_strings.c:280 src/hdate_strings.c:303
263 msgid "Eikev"
264 msgstr "Eikev"
265
266 #: src/hdate_strings.c:280 src/hdate_strings.c:303
267 msgid "Re'eh"
268 msgstr "Re'é"
269
270 #: src/hdate_strings.c:281 src/hdate_strings.c:304
271 msgid "Shoftim"
272 msgstr "Shoftim"
273
274 #: src/hdate_strings.c:281 src/hdate_strings.c:304
275 msgid "Ki Teitzei"
276 msgstr "Ki Teitzei"
277
278 #: src/hdate_strings.c:281 src/hdate_strings.c:304
279 msgid "Ki Tavo"
280 msgstr "Ki Tavó"
281
282 #: src/hdate_strings.c:282 src/hdate_strings.c:305
283 msgid "Nitzavim"
284 msgstr "Nitzavim"
285
286 #: src/hdate_strings.c:282 src/hdate_strings.c:305
287 msgid "Vayeilech"
288 msgstr "Vayeilech"
289
290 #: src/hdate_strings.c:282 src/hdate_strings.c:305
291 msgid "Ha'Azinu"
292 msgstr "Ha'Azinu"
293
294 #: src/hdate_strings.c:283 src/hdate_strings.c:306
295 msgid "Vezot Habracha"
296 msgstr "Vezot Haberacha"
297
298 #: src/hdate_strings.c:284 src/hdate_strings.c:307
299 msgid "Vayakhel-Pekudei"
300 msgstr "Vayakhel-Pekudei"
301
302 #: src/hdate_strings.c:284 src/hdate_strings.c:307
303 msgid "Tazria-Metzora"
304 msgstr "Tazría-Metzora"
305
306 #: src/hdate_strings.c:284 src/hdate_strings.c:307
307 msgid "Achrei Mot-Kedoshim"
308 msgstr "Achrei Mot-Kedoshim"
309
310 #: src/hdate_strings.c:285 src/hdate_strings.c:308
311 msgid "Behar-Bechukotai"
312 msgstr "Bechar-Bechukotai"
313
314 #: src/hdate_strings.c:285 src/hdate_strings.c:308
315 msgid "Chukat-Balak"
316 msgstr "Chukat-Balak"
317
318 #: src/hdate_strings.c:285 src/hdate_strings.c:308
319 msgid "Matot-Masei"
320 msgstr "Matot-Masei"
321
322 #: src/hdate_strings.c:286 src/hdate_strings.c:309
323 msgid "Nitzavim-Vayeilech"
324 msgstr "Nitzavim-Vayeilech"
325
326 #: src/hdate_strings.c:364 src/hdate_strings.c:369
327 msgid "Tishrei"
328 msgstr "Tishrei"
329
330 #: src/hdate_strings.c:364 src/hdate_strings.c:369
331 msgid "Cheshvan"
332 msgstr "Cheshván"
333
334 #: src/hdate_strings.c:364 src/hdate_strings.c:369
335 msgid "Kislev"
336 msgstr "Kislev"
337
338 #: src/hdate_strings.c:364 src/hdate_strings.c:369
339 msgid "Tevet"
340 msgstr "Tevet"
341
342 #: src/hdate_strings.c:365 src/hdate_strings.c:370
343 msgid "Sh'vat"
344 msgstr "Sh'vat"
345
346 #: src/hdate_strings.c:365 src/hdate_strings.c:370
347 msgid "Adar"
348 msgstr "Adar"
349
350 #: src/hdate_strings.c:365 src/hdate_strings.c:370
351 msgid "Nisan"
352 msgstr "Nisan"
353
354 #: src/hdate_strings.c:365 src/hdate_strings.c:370
355 msgid "Iyyar"
356 msgstr "Iyyar"
357
358 #: src/hdate_strings.c:366 src/hdate_strings.c:371
359 msgid "Sivan"
360 msgstr "Siván"
361
362 #: src/hdate_strings.c:366 src/hdate_strings.c:371
363 #, fuzzy
364 msgid "Tammuz"
365 msgstr "Tzom Tammuz"
366
367 #: src/hdate_strings.c:366 src/hdate_strings.c:371
368 msgid "Av"
369 msgstr "Av"
370
371 #: src/hdate_strings.c:366 src/hdate_strings.c:371
372 msgid "Elul"
373 msgstr "Elul"
374
375 #: src/hdate_strings.c:366 src/hdate_strings.c:371
376 msgid "Adar I"
377 msgstr "Adar I"
378
379 #: src/hdate_strings.c:367 src/hdate_strings.c:372
380 msgid "Adar II"
381 msgstr "Adar II"
382
383 #: src/hdate_strings.c:384
384 msgid "January"
385 msgstr "Janvier"
386
387 #: src/hdate_strings.c:384
388 msgid "February"
389 msgstr "Février"
390
391 #: src/hdate_strings.c:384
392 msgid "March"
393 msgstr "Mars"
394
395 #: src/hdate_strings.c:385
396 msgid "April"
397 msgstr "Avril"
398
399 #: src/hdate_strings.c:385 src/hdate_strings.c:388
400 msgid "May"
401 msgstr "mai"
402
403 #: src/hdate_strings.c:385
404 msgid "June"
405 msgstr "Juin"
406
407 #: src/hdate_strings.c:386
408 msgid "July"
409 msgstr "Juillet"
410
411 #: src/hdate_strings.c:386
412 msgid "August"
413 msgstr "Août"
414
415 #: src/hdate_strings.c:386
416 msgid "September"
417 msgstr "Septembre"
418
419 #: src/hdate_strings.c:387
420 msgid "October"
421 msgstr "Octobre"
422
423 #: src/hdate_strings.c:387
424 msgid "November"
425 msgstr "Novembre"
426
427 #: src/hdate_strings.c:387
428 msgid "December"
429 msgstr "Décembre"
430
431 #: src/hdate_strings.c:388
432 msgid "Jan"
433 msgstr "Jan"
434
435 #: src/hdate_strings.c:388
436 msgid "Feb"
437 msgstr "Fév"
438
439 #: src/hdate_strings.c:388
440 msgid "Mar"
441 msgstr "Mar"
442
443 #: src/hdate_strings.c:388
444 msgid "Apr"
445 msgstr "Avr"
446
447 #: src/hdate_strings.c:389
448 msgid "Jun"
449 msgstr "Juin"
450
451 #: src/hdate_strings.c:389
452 msgid "Jul"
453 msgstr "Juil"
454
455 #: src/hdate_strings.c:389
456 msgid "Aug"
457 msgstr "Août"
458
459 #: src/hdate_strings.c:389
460 msgid "Sep"
461 msgstr "Sep"
462
463 #: src/hdate_strings.c:389
464 msgid "Oct"
465 msgstr "Oct"
466
467 #: src/hdate_strings.c:390
468 msgid "Nov"
469 msgstr "Nov"
470
471 #: src/hdate_strings.c:390
472 msgid "Dec"
473 msgstr "Déc"
474
475 #: src/hdate_strings.c:396 src/hdate_strings.c:416
476 msgid "Rosh Hashana I"
477 msgstr "Rosh Hashana I"
478
479 #: src/hdate_strings.c:396 src/hdate_strings.c:416
480 msgid "Rosh Hashana II"
481 msgstr "Rosh Hashana II"
482
483 #: src/hdate_strings.c:397 src/hdate_strings.c:417
484 msgid "Tzom Gedaliah"
485 msgstr "Tzom Gedaliah"
486
487 #: src/hdate_strings.c:397 src/hdate_strings.c:417
488 msgid "Yom Kippur"
489 msgstr "Yom Kippur"
490
491 #: src/hdate_strings.c:398 src/hdate_strings.c:418
492 msgid "Sukkot"
493 msgstr "Sukkot"
494
495 #: src/hdate_strings.c:398 src/hdate_strings.c:418
496 msgid "Hol hamoed Sukkot"
497 msgstr "Hol hamoed Sukkot"
498
499 #: src/hdate_strings.c:399 src/hdate_strings.c:419
500 msgid "Hoshana raba"
501 msgstr "Hoshana raba"
502
503 #: src/hdate_strings.c:399 src/hdate_strings.c:419
504 msgid "Simchat Torah"
505 msgstr "Simchat Torah"
506
507 #: src/hdate_strings.c:400 src/hdate_strings.c:420
508 msgid "Chanukah"
509 msgstr "Chanuka"
510
511 #: src/hdate_strings.c:400 src/hdate_strings.c:420
512 msgid "Asara B'Tevet"
513 msgstr "Asara B'Tevet"
514
515 #: src/hdate_strings.c:401 src/hdate_strings.c:421
516 msgid "Tu B'Shvat"
517 msgstr "Tu B'Shvat"
518
519 #: src/hdate_strings.c:401 src/hdate_strings.c:421
520 msgid "Ta'anit Esther"
521 msgstr "Ta'anit Esther"
522
523 #: src/hdate_strings.c:402 src/hdate_strings.c:422
524 msgid "Purim"
525 msgstr "Purim"
526
527 #: src/hdate_strings.c:402 src/hdate_strings.c:422
528 msgid "Shushan Purim"
529 msgstr "Shushan Purim"
530
531 #: src/hdate_strings.c:403 src/hdate_strings.c:423
532 msgid "Pesach"
533 msgstr "Pesach"
534
535 #: src/hdate_strings.c:403 src/hdate_strings.c:423
536 msgid "Hol hamoed Pesach"
537 msgstr "Chol hamoed Pesach"
538
539 #: src/hdate_strings.c:404 src/hdate_strings.c:424
540 msgid "Yom HaAtzma'ut"
541 msgstr "Yom HaAtzma'ut"
542
543 #: src/hdate_strings.c:404 src/hdate_strings.c:424
544 msgid "Lag B'Omer"
545 msgstr "Lag B'Omer"
546
547 #: src/hdate_strings.c:405 src/hdate_strings.c:425
548 msgid "Erev Shavuot"
549 msgstr "veille de Shavuot"
550
551 #: src/hdate_strings.c:405 src/hdate_strings.c:425
552 msgid "Shavuot"
553 msgstr "Shavuot"
554
555 #: src/hdate_strings.c:406 src/hdate_strings.c:426
556 msgid "Tzom Tammuz"
557 msgstr "Tzom Tammuz"
558
559 #: src/hdate_strings.c:406 src/hdate_strings.c:426
560 msgid "Tish'a B'Av"
561 msgstr "Tish'a B'Av"
562
563 #: src/hdate_strings.c:407 src/hdate_strings.c:427
564 msgid "Tu B'Av"
565 msgstr "Tu B'Av"
566
567 #: src/hdate_strings.c:407 src/hdate_strings.c:427
568 msgid "Yom HaShoah"
569 msgstr "Jour des Holocausto"
570
571 #: src/hdate_strings.c:408 src/hdate_strings.c:428
572 msgid "Yom HaZikaron"
573 msgstr "Jour des Recuerdo"
574
575 #: src/hdate_strings.c:408 src/hdate_strings.c:428
576 #, fuzzy
577 msgid "Yom Yerushalayim"
578 msgstr "Jour des Yerushalayim"
579
580 #: src/hdate_strings.c:409 src/hdate_strings.c:429
581 msgid "Shmini Atzeret"
582 msgstr "Shemini Atzeret"
583
584 #: src/hdate_strings.c:409 src/hdate_strings.c:429
585 msgid "Pesach VII"
586 msgstr "Pesach VII"
587
588 #: src/hdate_strings.c:410 src/hdate_strings.c:430
589 msgid "Pesach VIII"
590 msgstr "Pesach VIII"
591
592 #: src/hdate_strings.c:410 src/hdate_strings.c:430
593 msgid "Shavuot II"
594 msgstr "Shavuot II"
595
596 #: src/hdate_strings.c:411 src/hdate_strings.c:431
597 msgid "Sukkot II"
598 msgstr "Sukkot II"
599
600 #: src/hdate_strings.c:411 src/hdate_strings.c:431
601 msgid "Pesach II"
602 msgstr "Pesach II"
603
604 #: src/hdate_strings.c:412 src/hdate_strings.c:432
605 msgid "Family Day"
606 msgstr "Jour de famille"
607
608 #: src/hdate_strings.c:412 src/hdate_strings.c:432
609 msgid "Memorial day for fallen whose place of burial is unknown"
610 msgstr ""
611
612 #: src/hdate_strings.c:413
613 msgid "Yitzhak Rabin memorial day"
614 msgstr "Jour commémoratif de Yitzhak Rabin"
615
616 #: src/hdate_strings.c:413
617 msgid "Zeev Zhabotinsky day"
618 msgstr "Jour commémoratif de Zeev Zhabotinsky"
619
620 #: src/hdate_strings.c:414 src/hdate_strings.c:434
621 #, fuzzy
622 msgid "Erev Yom Kippur"
623 msgstr "veille de Yom Kippur"
624
625 #: src/hdate_strings.c:433
626 msgid "Rabin memorial day"
627 msgstr "Jour commémoratif de Rabin"
628
629 #: src/hdate_strings.c:433
630 msgid "Zhabotinsky day"
631 msgstr "Jour commémoratif de Zhabotinsky"
632
633 #: src/hdate_strings.c:514
634 msgid "in the Omer"
635 msgstr ""
636
637 #: examples/hcal/hcal.c:142
638 msgid ""
639 "# configuration file for hcal - Hebrew calendar program\n"
640 "# part of package libhdate\n"
641 "#\n"
642 "# Should you mangle this file and wish to restore its default content,\n"
643 "# rename or delete this file and run hcal; hcal will automatically\n"
644 "# regenerate the default content.\n"
645 "#\n"
646 "# Your system administrator can set system-wide defaults for hcal by\n"
647 "# modifying file <not yet implemented>.\n"
648 "# You may override all defaults by changing the contents of this file.\n"
649 "#\n"
650 "# Version information\n"
651 "# This may be used by updates to hcal to determine how to parse the file\n"
652 "# and whether additional information and options should be appended to\n"
653 "# the end of this file.\n"
654 "VERSION=2.00\n"
655 "# Location awareness\n"
656 "# hcal wants to accurately highlight the current Hebrew day, including\n"
657 "# during the hours between sunset and secular midnight. If you don't\n"
658 "# provide it with latitude, longitude, and time zone information, hcal\n"
659 "# will try to guess the information, based upon your system timezone,\n"
660 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
661 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
662 "# with a message that includes the guessed location.\n"
663 "# hcal's guesses will also affect its default behaviour for ouput of\n"
664 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
665 "#SUNSET_AWARE=TRUE\n"
666 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
667 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
668 "# delimiters. Use negative values to indicate South and West, or\n"
669 "# use the abbreviated compass directions N, S, E, W.\n"
670 "#LATITUDE=\n"
671 "#LONGITUDE=\n"
672 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
673 "# with the characters :'\" as possible delimiters.\n"
674 "#TIMEZONE=\n"
675 "\n"
676 "# Israel and the diaspora\n"
677 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
678 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
679 "# forces hcal to display calendar information for Israel, using hcal's\n"
680 "# default coordinates foe Israel, or coordinates that you provide that\n"
681 "# seem legitmately within Israel.\n"
682 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
683 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
684 "# a non-resident vistor to Israel. The command line options for these\n"
685 "# features are --israel, -I, --diaspora, -d.\n"
686 "#FORCE_DIASPORA=FALSE;\n"
687 "#FORCE_ISRAEL=FALSE;\n"
688 "\n"
689 "# Shabbat related\n"
690 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
691 "# The command line options for these features are -p (--parasha), and\n"
692 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
693 "(minutes\n"
694 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
695 "# (minutes after sunset).\n"
696 "#PARASHA_NAMES=FALSE\n"
697 "#SHABBAT_INFO=FALSE\n"
698 "#CANDLE_LIGHTING=FALSE\n"
699 "#HAVDALAH=FALSE\n"
700 "\n"
701 "# Holiday identification\n"
702 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
703 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
704 "# will have hcal output after the month's calendar, a list of the month's\n"
705 "# holidays along with the days on which they occur.\n"
706 "#FOOTNOTE=FALSE\n"
707 "\n"
708 "# Output in hebrew characters\n"
709 "# hcal defaults to output all information in your default language, so\n"
710 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
711 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
712 "# still outputting gregorian information in your default language. To\n"
713 "# output ALL information in Hebrew, run something like this:\n"
714 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
715 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
716 "# output, you need to install a terminal font that includes the Hebrew\n"
717 "# character set (hint: unicode).\n"
718 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
719 "#FORCE_HEBREW=FALSE\n"
720 "\n"
721 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
722 "# Unfortunately, the world can not be depended upon to be either. Most\n"
723 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
724 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
725 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
726 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
727 "# This will reverse the order of the Hebrew characters, so they will\n"
728 "# display 'visual'ly correct; however, such output will not be suitable\n"
729 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
730 "# automatically forces hebrew.\n"
731 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
732 "#OUTPUT_BIDI=FALSE\n"
733 "\n"
734 "# Display enhancements\n"
735 "# hcal defaults to display the current day in reverse video\n"
736 "# The command line option for this feature is --no-reverse\n"
737 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
738 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
739 "# colorized output may yield unexpected results.\n"
740 "#COLORIZE=FALSE\n"
741 "\n"
742 "# HTML OUTPUT\n"
743 "#OUTPUT_HTML=FALSE\n"
744 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
745 "\n"
746 "# Suppress alerts and warnings\n"
747 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
748 "#QUIET_ALERTS=FALSE\n"
749 "\n"
750 "# Three month display\n"
751 "# hcal can display a previous, current and next month side-by-side. hcal\n"
752 "# can also display a calendar for an entire year in four rows of three\n"
753 "# months each. Note that this will display properly only if your console\n"
754 "# is set for at least 127 columns. Note also that setting this option to\n"
755 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
756 "#THREE_MONTH=FALSE\n"
757 "\n"
758 "# User-defined menus\n"
759 "# You may specify here command-line strings to optionally be parsed\n"
760 "# by hcal at execution time. To do so, use the command line option -m\n"
761 "# (--menu). hcal will process first the settings of this config file,\n"
762 "# then the other settings of your command line, and then will prompt\n"
763 "# you for which menu item you would like to select. hcal will process\n"
764 "# your menu selection as if it were a new command line, further modifying\n"
765 "# all the prior settings.\n"
766 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
767 "# truncated at one hundred characters\n"
768 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
769 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
770 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
771 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
772 msgstr ""
773
774 #: examples/hcal/hcal.c:271
775 msgid ""
776 "hcal - Hebrew calendar\n"
777 "version 1.6"
778 msgstr ""
779
780 #: examples/hcal/hcal.c:281
781 msgid ""
782 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
783 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
784 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
785 " timezone: -z nn[( .nn | :mm )]\n"
786 "Try 'hcal --help' for more information"
787 msgstr ""
788
789 #: examples/hcal/hcal.c:295
790 msgid ""
791 "Hebrew calendar\n"
792 "OPTIONS:\n"
793 " -1 --one-month over-ride config file setting if you had set\n"
794 " option --three-month as a default there\n"
795 " -3 --three-month displays previous/next months\n"
796 " side by side. requires 127 columns\n"
797 " -b --bidi prints hebrew in reverse (visual)\n"
798 " --visual\n"
799 " --no-bidi over-ride config file setting if you had set\n"
800 " --no-visual option -bidi as a default there\n"
801 " -c --colorize displays in calming, muted tones\n"
802 " --no-color over-ride a --colorize setting in your config file\n"
803 " -d --diaspora use diaspora reading and holidays.\n"
804 " -f --footnote print descriptive notes of holidays\n"
805 " --no-footnote over-ride a footnote setting in your config file\n"
806 " -h --html output in html format to stdout\n"
807 " -H --hebrew print hebrew information in Hebrew\n"
808 " -i use external css file \"./hcal.css\".\n"
809 " -I --israel override a diaspora default\n"
810 " --no-reverse do not highlight today's date\n"
811 " -m --menu prompt user-defined menu from config file\n"
812 " -p --parasha print week's parasha on each calendar row\n"
813 " -q --quiet-alerts suppress warning messages\n"
814 " -s --shabbat print Shabbat times and parshiot\n"
815 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
816 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
817 " -z --timezone nn timezone, +/-UTC\n"
818 " -l --latitude yy latitude yy degrees. Negative values are South\n"
819 " -L --longitude xx longitude xx degrees. Negative values are West\n"
820 "\n"
821 "All options can be made default in the config file, or menu-ized for\n"
822 "easy selection."
823 msgstr ""
824
825 #: examples/hcal/hcal.c:1877
826 msgid ""
827 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
828 "month' mode"
829 msgstr ""
830
831 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
832 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
833 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
834 msgid "error"
835 msgstr ""
836
837 #: examples/hcal/hcal.c:1949
838 msgid "too many parameters received. expected [[mm] [yyyy]"
839 msgstr ""
840
841 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
842 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
843 msgid "year"
844 msgstr ""
845
846 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
847 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
848 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
849 #: examples/hcal/hdate.c:2132
850 msgid "month"
851 msgstr ""
852
853 #: examples/hcal/hdate.c:42
854 msgid "sunrise"
855 msgstr ""
856
857 #: examples/hcal/hdate.c:43
858 msgid "sunset"
859 msgstr ""
860
861 #: examples/hcal/hdate.c:44
862 msgid "first_light"
863 msgstr ""
864
865 #: examples/hcal/hdate.c:45
866 msgid "talit"
867 msgstr ""
868
869 #: examples/hcal/hdate.c:46
870 msgid "midday"
871 msgstr ""
872
873 #: examples/hcal/hdate.c:47
874 msgid "first_stars"
875 msgstr ""
876
877 #: examples/hcal/hdate.c:48
878 msgid "three_stars"
879 msgstr ""
880
881 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
882 msgid "sun_hour"
883 msgstr ""
884
885 #: examples/hcal/hdate.c:50
886 msgid "candle-lighting"
887 msgstr ""
888
889 #: examples/hcal/hdate.c:51
890 msgid "havdalah"
891 msgstr ""
892
893 #: examples/hcal/hdate.c:81
894 msgid ""
895 "# configuration file for hdate - Hebrew date information program\n"
896 "# part of package libhdate\n"
897 "#\n"
898 "# Should you mangle this file and wish to restore its default content,\n"
899 "# rename or delete this file and run hdate; hdate will automatically\n"
900 "# regenerate the default content.\n"
901 "#\n"
902 "# Your system administrator can set system-wide defaults for hcal by\n"
903 "# modifying file <not yet implemented>.\n"
904 "# You may override all defaults by changing the contents of this file.\n"
905 "#\n"
906 "# Version information\n"
907 "# This may be used by updates to hcal to determine how to parse the file\n"
908 "# and whether additional information and options should be appended to\n"
909 "# the end of this file.\n"
910 "VERSION=2.00\n"
911 "#\n"
912 "# Location awareness\n"
913 "# hdate wants to accurately highlight the current Hebrew day, including\n"
914 "# during the hours between sunset and secular midnight. If you don't\n"
915 "# provide it with latitude, longitude, and time zone information, hdate\n"
916 "# will try to guess the information, based upon your system timezone,\n"
917 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
918 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
919 "# with a message that includes the guessed location.\n"
920 "# hdate's guesses will also affect its default behaviour for ouput of\n"
921 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
922 "#SUNSET_AWARE=TRUE\n"
923 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
924 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
925 "# delimiters. Use negative values to indicate South and West, or\n"
926 "# use the abbreviated compass directions N, S, E, W.\n"
927 "#LATITUDE=\n"
928 "#LONGITUDE=\n"
929 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
930 "# with the characters :'\" as possible delimiters.\n"
931 "#TIMEZONE=\n"
932 "\n"
933 "# Output in hebrew characters\n"
934 "# hdate defaults to output all information in your default language, so\n"
935 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
936 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
937 "# still outputting gregorian information in your default language. To\n"
938 "# output ALL information in Hebrew, run something like this:\n"
939 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
940 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
941 "# output, you need to install a terminal font that includes the Hebrew\n"
942 "# character set (hint: unicode).\n"
943 "#FORCE_HEBREW=FALSE\n"
944 "\n"
945 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
946 "# Unfortunately, the world can not be depended upon to be either. Most\n"
947 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
948 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
949 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
950 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
951 "# This will reverse the order of the Hebrew characters, so they will\n"
952 "# display 'visual'ly correct; however, such output will not be suitable\n"
953 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
954 "# automatically forces hebrew.\n"
955 "#OUTPUT_BIDI=FALSE\n"
956 "\n"
957 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
958 "# in the following ways:\n"
959 "# option YOM ~> yom shishi, aleph tishrei ...\n"
960 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
961 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
962 "#YOM=FALSE\n"
963 "#LESHABBAT=FALSE\n"
964 "#LESEDER=FALSE\n"
965 "\n"
966 "#SUN_RISE_SET=FALSE\n"
967 "#TIMES_OF_DAY=FALSE\n"
968 "#SHORT_FORMAT=FALSE\n"
969 "#SEFIRAT_HAOMER=FALSE\n"
970 "#DIASPORA=FALSE\n"
971 "\n"
972 "\n"
973 "# Shabbat related\n"
974 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
975 "# The command line options for these features are -r (--parasha), and\n"
976 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
977 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
978 "# (minutes after sunset).\n"
979 "#PARASHA_NAMES=FALSE\n"
980 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
981 "#SHABBAT_INFO=FALSE\n"
982 "\n"
983 "#CANDLE_LIGHTING=FALSE\n"
984 "#HAVDALAH=FALSE\n"
985 "\n"
986 "# Holiday related\n"
987 "#HOLIDAYS=FALSE\n"
988 "#ONLY_IF_HOLIDAY=FALSE\n"
989 "\n"
990 "# Tabular output\n"
991 "# This option has hdate output the information you request in a single\n"
992 "# comma-delimited line per day, suitable for piping or import to\n"
993 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
994 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
995 "# The command line option for this feature is, um, --table\n"
996 "#TABULAR=FALSE\n"
997 "\n"
998 "# iCal format\n"
999 "# hdate can output its information in iCal-compatable format\n"
1000 "# ICAL=FALSE\n"
1001 "# Suppress alerts and warnings\n"
1002 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1003 "#QUIET_ALERTS=FALSE\n"
1004 "\n"
1005 "# Julian day number\n"
1006 "# The Julian day number is a .... See ... for more details.\n"
1007 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1008 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1009 "#JULIAN_DAY=FALSE\n"
1010 "\n"
1011 "# User-defined menus\n"
1012 "# You may specify here command-line strings to optionally be parsed\n"
1013 "# by hcal at execution time. To do so, use the command line option -m\n"
1014 "# (--menu). hcal will process first the settings of this config file,\n"
1015 "# then the other settings of your command line, and then will prompt\n"
1016 "# you for which menu item you would like to select. hcal will process\n"
1017 "# your menu selection as if it were a new command line, further modifying\n"
1018 "# all the prior settings.\n"
1019 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1020 "# truncated at one hundred characters\n"
1021 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1022 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1023 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1024 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1025 msgstr ""
1026
1027 #: examples/hcal/hdate.c:209
1028 msgid ""
1029 "hdate - display Hebrew date information\n"
1030 "version 1.6"
1031 msgstr ""
1032
1033 #: examples/hcal/hdate.c:219
1034 msgid ""
1035 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1036 " hdate [options] [coordinates timezone] [julian_day]\n"
1037 "\n"
1038 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1039 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1040 " timezone: -z nn[( .nn | :mm )]\n"
1041 "Try 'hdate --help' for more information"
1042 msgstr ""
1043
1044 #: examples/hcal/hdate.c:235
1045 msgid ""
1046 "hdate - display Hebrew date information\n"
1047 "OPTIONS:\n"
1048 " -b --bidi prints hebrew in reverse (visual)\n"
1049 " --visual\n"
1050 " -c print Shabbat start/end times.\n"
1051 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1052 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1053 " -d --diaspora use diaspora reading and holidays.\n"
1054 " -h --holidays print holidays.\n"
1055 " -H print only it is a holiday.\n"
1056 " -i --ical use iCal formated output.\n"
1057 " -j --julian print Julian day number.\n"
1058 " -m --menu prompt user-defined menu from config file\n"
1059 " -o --omer print Sefirat Haomer.\n"
1060 " -q --quiet-alerts suppress warning messages\n"
1061 " -r --parasha print weekly reading on saturday.\n"
1062 " -R print only if there is a weekly reading on Shabbat.\n"
1063 " -s --sun print sunrise/sunset times.\n"
1064 " -S --short-format print using short format.\n"
1065 " -t print day times: first light, talit, sunrise,\n"
1066 " midday, sunset, first stars, three stars.\n"
1067 " -T --table tabular output, suitable for spreadsheets\n"
1068 "\n"
1069 " -z --timezone nn timezone, +/-UTC\n"
1070 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1071 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1072 "\n"
1073 " --hebrew forces Hebrew to print in Hebrew characters\n"
1074 " --yom force Hebrew prefix to Hebrew day of week\n"
1075 " --leshabbat insert parasha between day of week and day\n"
1076 " --leseder insert parasha between day of week and day\n"
1077 " --not-sunset-aware don't display next day if after sunset\n"
1078 "\n"
1079 "All options can be made default in the config file, or menu-ized for\n"
1080 "easy selection."
1081 msgstr ""
1082
1083 #: examples/hcal/hdate.c:274
1084 msgid ""
1085 "ALERT: The information displayed is for today's Hebrew date.\n"
1086 " Because it is now after sunset, that means the data is\n"
1087 " for the Gregorian day beginning at midnight."
1088 msgstr ""
1089
1090 #: examples/hcal/hdate.c:405
1091 msgid "eve of "
1092 msgstr ""
1093
1094 #: examples/hcal/hdate.c:669
1095 msgid "today is day"
1096 msgstr ""
1097
1098 #: examples/hcal/hdate.c:743
1099 msgid "Gregorian date"
1100 msgstr ""
1101
1102 #: examples/hcal/hdate.c:743
1103 msgid "Hebrew Date"
1104 msgstr ""
1105
1106 #: examples/hcal/hdate.c:748
1107 #, fuzzy
1108 msgid "holiday"
1109 msgstr "Vendredi"
1110
1111 #: examples/hcal/hdate.c:749
1112 msgid "omer count"
1113 msgstr ""
1114
1115 #: examples/hcal/hdate.c:750
1116 msgid "parashat"
1117 msgstr ""
1118
1119 #: examples/hcal/hdate.c:1016
1120 msgid "Parashat"
1121 msgstr ""
1122
1123 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1124 #, fuzzy
1125 msgid "day"
1126 msgstr "mai"
1127
1128 #: examples/hcal/hdate.c:2168
1129 msgid "too many arguments; after options max is dd mm yyyy"
1130 msgstr ""
1131
1132 #: examples/hcal/local_functions.c:97
1133 msgid "parameter"
1134 msgstr ""
1135
1136 #: examples/hcal/local_functions.c:98
1137 msgid "is non-numeric or out of bounds"
1138 msgstr ""
1139
1140 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1141 msgid "option"
1142 msgstr ""
1143
1144 #: examples/hcal/local_functions.c:104
1145 msgid "missing parameter"
1146 msgstr ""
1147
1148 #: examples/hcal/local_functions.c:110
1149 msgid "ALERT: time zone not entered, using system local time zone"
1150 msgstr ""
1151
1152 #: examples/hcal/local_functions.c:117
1153 msgid "is not a valid option"
1154 msgstr ""
1155
1156 #: examples/hcal/local_functions.c:134
1157 msgid "ALERT: guessing... will use co-ordinates for"
1158 msgstr ""
1159
1160 #: examples/hcal/local_functions.c:142
1161 msgid "Los Angeles"
1162 msgstr ""
1163
1164 #: examples/hcal/local_functions.c:143
1165 msgid "Mexico City"
1166 msgstr ""
1167
1168 #: examples/hcal/local_functions.c:144
1169 msgid "New York City"
1170 msgstr ""
1171
1172 #: examples/hcal/local_functions.c:147
1173 msgid "Buenos Aires"
1174 msgstr ""
1175
1176 #: examples/hcal/local_functions.c:148
1177 msgid "London"
1178 msgstr ""
1179
1180 #: examples/hcal/local_functions.c:149
1181 msgid "Paris"
1182 msgstr ""
1183
1184 #: examples/hcal/local_functions.c:150
1185 msgid "Tel-Aviv"
1186 msgstr ""
1187
1188 #: examples/hcal/local_functions.c:151
1189 msgid "Moscow"
1190 msgstr ""
1191
1192 #: examples/hcal/local_functions.c:152
1193 msgid "Tashkent"
1194 msgstr ""
1195
1196 #: examples/hcal/local_functions.c:153
1197 msgid "Beijing"
1198 msgstr ""
1199
1200 #: examples/hcal/local_functions.c:155
1201 msgid "Honolulu"
1202 msgstr ""
1203
1204 #: examples/hcal/local_functions.c:156
1205 msgid "Hmmm, ... hate to do this, really ..."
1206 msgstr ""
1207
1208 #: examples/hcal/local_functions.c:156
1209 msgid "using co-ordinates for the equator, at the center of time zone"
1210 msgstr ""
1211
1212 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1213 #: examples/hcal/local_functions.c:337
1214 msgid "l (latitude)"
1215 msgstr ""
1216
1217 #: examples/hcal/local_functions.c:323
1218 msgid "L (Longitue)"
1219 msgstr ""
1220
1221 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1222 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1223 msgid "L (Longitude)"
1224 msgstr ""
1225
1226 #: examples/hcal/local_functions.c:446
1227 msgid "z (time zone)"
1228 msgstr ""
1229
1230 #: examples/hcal/local_functions.c:466
1231 msgid "z (timezone)"
1232 msgstr ""
1233
1234 #: examples/hcal/local_functions.c:490
1235 msgid "valid longitude parameter missing for given latitude"
1236 msgstr ""
1237
1238 #: examples/hcal/local_functions.c:495
1239 msgid "valid latitude parameter missing for given longitude"
1240 msgstr ""
1241
1242 #: examples/hcal/local_functions.c:533
1243 msgid "time zone value of"
1244 msgstr ""
1245
1246 #: examples/hcal/local_functions.c:534
1247 msgid "is incompatible with a longitude of"
1248 msgstr ""
1249
1250 #: examples/hcal/local_functions.c:534
1251 msgid "degrees"
1252 msgstr ""
1253
1254 #: examples/hcal/local_functions.c:642
1255 msgid ""
1256 "This seems to be to be your first time using this version.\n"
1257 "Please read the new documentation in the man page and config\n"
1258 "file. Attempting to create a config file ..."
1259 msgstr ""
1260
1261 #: examples/hcal/local_functions.c:676
1262 msgid "failure attempting to create config file"
1263 msgstr ""
1264
1265 #: examples/hcal/local_functions.c:680
1266 msgid "config file created"
1267 msgstr ""
1268
1269 #: examples/hcal/local_functions.c:681
1270 msgid "failure closing"
1271 msgstr ""
1272
1273 #: examples/hcal/local_functions.c:701
1274 msgid "memory allocation failure"
1275 msgstr ""
1276
1277 #: examples/hcal/local_functions.c:915
1278 msgid "your custom menu options (from your config file)"
1279 msgstr ""
1280
1281 #: examples/hcal/local_functions.c:921
1282 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1283 msgstr ""
1284
1285 #: examples/hcal/local_functions.c:924
1286 msgid "enter your selection, or <return> to continue"
1287 msgstr ""
1288
1289 #: examples/hcal/local_functions.c:928
1290 msgid "menu selection received was out of bounds"
1291 msgstr ""
1292
1293 #~ msgid "Tamuz"
1294 #~ msgstr "Tamuz"
0 # Hebrew translations for libhdate strings
1 # Copyright (C) 2011 Boruch baum
2 # This file is distributed under the same license as the PACKAGE package.
3 # Koby Zamir <EMAIL@ADDRESS>, 1994.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: PACKAGE VERSION\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
10 "PO-Revision-Date: 2010-10-26 16:11+0200\n"
11 "Last-Translator: Boruch Baum\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: he\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=utf-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #: src/hdate_strings.c:186 src/hdate_strings.c:190
19 msgid "translator"
20 msgstr "יעקב זמיר"
21
22 #: src/hdate_strings.c:248
23 msgid "Sunday"
24 msgstr "ראשון"
25
26 #: src/hdate_strings.c:248
27 msgid "Monday"
28 msgstr "שני"
29
30 #: src/hdate_strings.c:248
31 msgid "Tuesday"
32 msgstr "שלישי"
33
34 #: src/hdate_strings.c:248
35 msgid "Wednesday"
36 msgstr "רביעי"
37
38 #: src/hdate_strings.c:249
39 msgid "Thursday"
40 msgstr "חמישי"
41
42 #: src/hdate_strings.c:249
43 msgid "Friday"
44 msgstr "שישי"
45
46 #: src/hdate_strings.c:249
47 msgid "Saturday"
48 msgstr "שבת"
49
50 #: src/hdate_strings.c:251
51 msgid "Sun"
52 msgstr "א"
53
54 #: src/hdate_strings.c:251
55 msgid "Mon"
56 msgstr "ב"
57
58 #: src/hdate_strings.c:251
59 msgid "Tue"
60 msgstr "ג"
61
62 #: src/hdate_strings.c:251
63 msgid "Wed"
64 msgstr "ד"
65
66 #: src/hdate_strings.c:251
67 msgid "Thu"
68 msgstr "ה"
69
70 #: src/hdate_strings.c:252
71 msgid "Fri"
72 msgstr "ו"
73
74 #: src/hdate_strings.c:252
75 msgid "Sat"
76 msgstr "ש"
77
78 #: src/hdate_strings.c:265 src/hdate_strings.c:288
79 msgid "none"
80 msgstr "חסר"
81
82 #: src/hdate_strings.c:265 src/hdate_strings.c:288
83 msgid "Bereshit"
84 msgstr "בראשית"
85
86 #: src/hdate_strings.c:265 src/hdate_strings.c:288
87 msgid "Noach"
88 msgstr "נח"
89
90 #: src/hdate_strings.c:266 src/hdate_strings.c:289
91 msgid "Lech-Lecha"
92 msgstr "לך לך"
93
94 #: src/hdate_strings.c:266 src/hdate_strings.c:289
95 msgid "Vayera"
96 msgstr "וירא"
97
98 #: src/hdate_strings.c:266 src/hdate_strings.c:289
99 msgid "Chayei Sara"
100 msgstr "חיי שרה"
101
102 #: src/hdate_strings.c:267 src/hdate_strings.c:290
103 msgid "Toldot"
104 msgstr "תולדות"
105
106 #: src/hdate_strings.c:267 src/hdate_strings.c:290
107 msgid "Vayetzei"
108 msgstr "ויצא"
109
110 #: src/hdate_strings.c:267 src/hdate_strings.c:290
111 msgid "Vayishlach"
112 msgstr "וישלח"
113
114 #: src/hdate_strings.c:268 src/hdate_strings.c:291
115 msgid "Vayeshev"
116 msgstr "וישב"
117
118 #: src/hdate_strings.c:268 src/hdate_strings.c:291
119 msgid "Miketz"
120 msgstr "מקץ"
121
122 #: src/hdate_strings.c:268 src/hdate_strings.c:291
123 msgid "Vayigash"
124 msgstr "ויגש"
125
126 #: src/hdate_strings.c:269 src/hdate_strings.c:292
127 msgid "Vayechi"
128 msgstr "ויחי"
129
130 #: src/hdate_strings.c:269 src/hdate_strings.c:292
131 msgid "Shemot"
132 msgstr "שמות"
133
134 #: src/hdate_strings.c:269 src/hdate_strings.c:292
135 msgid "Vaera"
136 msgstr "וארא"
137
138 #: src/hdate_strings.c:270 src/hdate_strings.c:293
139 msgid "Bo"
140 msgstr "בא"
141
142 #: src/hdate_strings.c:270 src/hdate_strings.c:293
143 msgid "Beshalach"
144 msgstr "בשלח"
145
146 #: src/hdate_strings.c:270 src/hdate_strings.c:293
147 msgid "Yitro"
148 msgstr "יתרו"
149
150 #: src/hdate_strings.c:271 src/hdate_strings.c:294
151 msgid "Mishpatim"
152 msgstr "משפטים"
153
154 #: src/hdate_strings.c:271 src/hdate_strings.c:294
155 msgid "Terumah"
156 msgstr "תרומה"
157
158 #: src/hdate_strings.c:271 src/hdate_strings.c:294
159 msgid "Tetzaveh"
160 msgstr "תצווה"
161
162 #: src/hdate_strings.c:272 src/hdate_strings.c:295
163 msgid "Ki Tisa"
164 msgstr "כי תשא"
165
166 #: src/hdate_strings.c:272 src/hdate_strings.c:295
167 msgid "Vayakhel"
168 msgstr "ויקהל"
169
170 #: src/hdate_strings.c:272 src/hdate_strings.c:295
171 msgid "Pekudei"
172 msgstr "פקודי"
173
174 #: src/hdate_strings.c:273 src/hdate_strings.c:296
175 msgid "Vayikra"
176 msgstr "ויקרא"
177
178 #: src/hdate_strings.c:273 src/hdate_strings.c:296
179 msgid "Tzav"
180 msgstr "צו"
181
182 #: src/hdate_strings.c:273 src/hdate_strings.c:296
183 msgid "Shmini"
184 msgstr "שמיני"
185
186 #: src/hdate_strings.c:274 src/hdate_strings.c:297
187 msgid "Tazria"
188 msgstr "תזריע"
189
190 #: src/hdate_strings.c:274 src/hdate_strings.c:297
191 msgid "Metzora"
192 msgstr "מצורע"
193
194 #: src/hdate_strings.c:274 src/hdate_strings.c:297
195 msgid "Achrei Mot"
196 msgstr "אחרי מות"
197
198 #: src/hdate_strings.c:275 src/hdate_strings.c:298
199 msgid "Kedoshim"
200 msgstr "קדושים"
201
202 #: src/hdate_strings.c:275 src/hdate_strings.c:298
203 msgid "Emor"
204 msgstr "אמור"
205
206 #: src/hdate_strings.c:275 src/hdate_strings.c:298
207 msgid "Behar"
208 msgstr "בהר"
209
210 #: src/hdate_strings.c:276 src/hdate_strings.c:299
211 msgid "Bechukotai"
212 msgstr "בחוקותי"
213
214 #: src/hdate_strings.c:276 src/hdate_strings.c:299
215 msgid "Bamidbar"
216 msgstr "במדבר"
217
218 #: src/hdate_strings.c:276 src/hdate_strings.c:299
219 msgid "Nasso"
220 msgstr "נשא"
221
222 #: src/hdate_strings.c:277 src/hdate_strings.c:300
223 msgid "Beha'alotcha"
224 msgstr "בהעלותך"
225
226 #: src/hdate_strings.c:277 src/hdate_strings.c:300
227 msgid "Sh'lach"
228 msgstr "שלח"
229
230 #: src/hdate_strings.c:277 src/hdate_strings.c:300
231 msgid "Korach"
232 msgstr "קרח"
233
234 #: src/hdate_strings.c:278 src/hdate_strings.c:301
235 msgid "Chukat"
236 msgstr "חוקת"
237
238 #: src/hdate_strings.c:278 src/hdate_strings.c:301
239 msgid "Balak"
240 msgstr "בלק"
241
242 #: src/hdate_strings.c:278 src/hdate_strings.c:301
243 msgid "Pinchas"
244 msgstr "פינחס"
245
246 #: src/hdate_strings.c:279 src/hdate_strings.c:302
247 msgid "Matot"
248 msgstr "מטות"
249
250 #: src/hdate_strings.c:279 src/hdate_strings.c:302
251 msgid "Masei"
252 msgstr "מסעי"
253
254 #: src/hdate_strings.c:279 src/hdate_strings.c:302
255 msgid "Devarim"
256 msgstr "דברים"
257
258 #: src/hdate_strings.c:280 src/hdate_strings.c:303
259 msgid "Vaetchanan"
260 msgstr "ואתחנן"
261
262 #: src/hdate_strings.c:280 src/hdate_strings.c:303
263 msgid "Eikev"
264 msgstr "עקב"
265
266 #: src/hdate_strings.c:280 src/hdate_strings.c:303
267 msgid "Re'eh"
268 msgstr "ראה"
269
270 #: src/hdate_strings.c:281 src/hdate_strings.c:304
271 msgid "Shoftim"
272 msgstr "שופטים"
273
274 #: src/hdate_strings.c:281 src/hdate_strings.c:304
275 msgid "Ki Teitzei"
276 msgstr "כי תצא"
277
278 #: src/hdate_strings.c:281 src/hdate_strings.c:304
279 msgid "Ki Tavo"
280 msgstr "כי תבוא"
281
282 #: src/hdate_strings.c:282 src/hdate_strings.c:305
283 msgid "Nitzavim"
284 msgstr "נצבים"
285
286 #: src/hdate_strings.c:282 src/hdate_strings.c:305
287 msgid "Vayeilech"
288 msgstr "וילך"
289
290 #: src/hdate_strings.c:282 src/hdate_strings.c:305
291 msgid "Ha'Azinu"
292 msgstr "האזינו"
293
294 #: src/hdate_strings.c:283 src/hdate_strings.c:306
295 msgid "Vezot Habracha"
296 msgstr "וזאת הברכה"
297
298 #: src/hdate_strings.c:284 src/hdate_strings.c:307
299 msgid "Vayakhel-Pekudei"
300 msgstr "ויקהל פקודי"
301
302 #: src/hdate_strings.c:284 src/hdate_strings.c:307
303 msgid "Tazria-Metzora"
304 msgstr "תזריע מצורע"
305
306 #: src/hdate_strings.c:284 src/hdate_strings.c:307
307 msgid "Achrei Mot-Kedoshim"
308 msgstr "אחרי מות קדושים"
309
310 #: src/hdate_strings.c:285 src/hdate_strings.c:308
311 msgid "Behar-Bechukotai"
312 msgstr "בהר בחוקותי"
313
314 #: src/hdate_strings.c:285 src/hdate_strings.c:308
315 msgid "Chukat-Balak"
316 msgstr "חוקת בלק"
317
318 #: src/hdate_strings.c:285 src/hdate_strings.c:308
319 msgid "Matot-Masei"
320 msgstr "מטות מסעי"
321
322 #: src/hdate_strings.c:286 src/hdate_strings.c:309
323 msgid "Nitzavim-Vayeilech"
324 msgstr "נצבים וילך"
325
326 #: src/hdate_strings.c:364 src/hdate_strings.c:369
327 msgid "Tishrei"
328 msgstr "תשרי"
329
330 #: src/hdate_strings.c:364 src/hdate_strings.c:369
331 msgid "Cheshvan"
332 msgstr "חשון"
333
334 #: src/hdate_strings.c:364 src/hdate_strings.c:369
335 msgid "Kislev"
336 msgstr "כסלו"
337
338 #: src/hdate_strings.c:364 src/hdate_strings.c:369
339 msgid "Tevet"
340 msgstr "טבת"
341
342 #: src/hdate_strings.c:365 src/hdate_strings.c:370
343 msgid "Sh'vat"
344 msgstr "שבט"
345
346 #: src/hdate_strings.c:365 src/hdate_strings.c:370
347 msgid "Adar"
348 msgstr "אדר"
349
350 #: src/hdate_strings.c:365 src/hdate_strings.c:370
351 msgid "Nisan"
352 msgstr "ניסן"
353
354 #: src/hdate_strings.c:365 src/hdate_strings.c:370
355 msgid "Iyyar"
356 msgstr "אייר"
357
358 #: src/hdate_strings.c:366 src/hdate_strings.c:371
359 msgid "Sivan"
360 msgstr "סיון"
361
362 #: src/hdate_strings.c:366 src/hdate_strings.c:371
363 msgid "Tammuz"
364 msgstr "תמוז"
365
366 #: src/hdate_strings.c:366 src/hdate_strings.c:371
367 msgid "Av"
368 msgstr "אב"
369
370 #: src/hdate_strings.c:366 src/hdate_strings.c:371
371 msgid "Elul"
372 msgstr "אלול"
373
374 #: src/hdate_strings.c:366 src/hdate_strings.c:371
375 msgid "Adar I"
376 msgstr "אדר א"
377
378 #: src/hdate_strings.c:367 src/hdate_strings.c:372
379 msgid "Adar II"
380 msgstr "אדר ב"
381
382 #: src/hdate_strings.c:384
383 msgid "January"
384 msgstr "ינואר"
385
386 #: src/hdate_strings.c:384
387 msgid "February"
388 msgstr "פברואר"
389
390 #: src/hdate_strings.c:384
391 msgid "March"
392 msgstr "מרץ"
393
394 #: src/hdate_strings.c:385
395 msgid "April"
396 msgstr "אפריל"
397
398 #: src/hdate_strings.c:385 src/hdate_strings.c:388
399 msgid "May"
400 msgstr "מאי"
401
402 #: src/hdate_strings.c:385
403 msgid "June"
404 msgstr "יוני"
405
406 #: src/hdate_strings.c:386
407 msgid "July"
408 msgstr "יולי"
409
410 #: src/hdate_strings.c:386
411 msgid "August"
412 msgstr "אוגוסט"
413
414 #: src/hdate_strings.c:386
415 msgid "September"
416 msgstr "ספטמבר"
417
418 #: src/hdate_strings.c:387
419 msgid "October"
420 msgstr "אוקטובר"
421
422 #: src/hdate_strings.c:387
423 msgid "November"
424 msgstr "נובמבר"
425
426 #: src/hdate_strings.c:387
427 msgid "December"
428 msgstr "דצמבר"
429
430 #: src/hdate_strings.c:388
431 msgid "Jan"
432 msgstr "ינו"
433
434 #: src/hdate_strings.c:388
435 msgid "Feb"
436 msgstr "פבר"
437
438 #: src/hdate_strings.c:388
439 msgid "Mar"
440 msgstr "מרץ"
441
442 #: src/hdate_strings.c:388
443 msgid "Apr"
444 msgstr "אפר"
445
446 #: src/hdate_strings.c:389
447 msgid "Jun"
448 msgstr "יוני"
449
450 #: src/hdate_strings.c:389
451 msgid "Jul"
452 msgstr "יולי"
453
454 #: src/hdate_strings.c:389
455 msgid "Aug"
456 msgstr "אוג"
457
458 #: src/hdate_strings.c:389
459 msgid "Sep"
460 msgstr "ספט"
461
462 #: src/hdate_strings.c:389
463 msgid "Oct"
464 msgstr "אוקט"
465
466 #: src/hdate_strings.c:390
467 msgid "Nov"
468 msgstr "נוב"
469
470 #: src/hdate_strings.c:390
471 msgid "Dec"
472 msgstr "דצמ"
473
474 #: src/hdate_strings.c:396 src/hdate_strings.c:416
475 msgid "Rosh Hashana I"
476 msgstr "א ראש השנה"
477
478 #: src/hdate_strings.c:396 src/hdate_strings.c:416
479 msgid "Rosh Hashana II"
480 msgstr "ב ראש השנה"
481
482 #: src/hdate_strings.c:397 src/hdate_strings.c:417
483 msgid "Tzom Gedaliah"
484 msgstr "צום גדליה"
485
486 #: src/hdate_strings.c:397 src/hdate_strings.c:417
487 msgid "Yom Kippur"
488 msgstr "יום כיפור"
489
490 #: src/hdate_strings.c:398 src/hdate_strings.c:418
491 msgid "Sukkot"
492 msgstr "סוכות"
493
494 #: src/hdate_strings.c:398 src/hdate_strings.c:418
495 msgid "Hol hamoed Sukkot"
496 msgstr "חול המועד סוכות"
497
498 #: src/hdate_strings.c:399 src/hdate_strings.c:419
499 msgid "Hoshana raba"
500 msgstr "הושענא רבה"
501
502 #: src/hdate_strings.c:399 src/hdate_strings.c:419
503 msgid "Simchat Torah"
504 msgstr "שמחת תורה"
505
506 #: src/hdate_strings.c:400 src/hdate_strings.c:420
507 msgid "Chanukah"
508 msgstr "חנוכה"
509
510 #: src/hdate_strings.c:400 src/hdate_strings.c:420
511 msgid "Asara B'Tevet"
512 msgstr "עשרה בטבת"
513
514 #: src/hdate_strings.c:401 src/hdate_strings.c:421
515 msgid "Tu B'Shvat"
516 msgstr "ט\"ו בשבט"
517
518 #: src/hdate_strings.c:401 src/hdate_strings.c:421
519 msgid "Ta'anit Esther"
520 msgstr "תענית אסתר"
521
522 #: src/hdate_strings.c:402 src/hdate_strings.c:422
523 msgid "Purim"
524 msgstr "פורים"
525
526 #: src/hdate_strings.c:402 src/hdate_strings.c:422
527 msgid "Shushan Purim"
528 msgstr "שושן פורים"
529
530 #: src/hdate_strings.c:403 src/hdate_strings.c:423
531 msgid "Pesach"
532 msgstr "פסח"
533
534 #: src/hdate_strings.c:403 src/hdate_strings.c:423
535 msgid "Hol hamoed Pesach"
536 msgstr "חול המועד פסח"
537
538 #: src/hdate_strings.c:404 src/hdate_strings.c:424
539 msgid "Yom HaAtzma'ut"
540 msgstr "יום העצמאות"
541
542 #: src/hdate_strings.c:404 src/hdate_strings.c:424
543 msgid "Lag B'Omer"
544 msgstr "ל\"ג בעומר"
545
546 #: src/hdate_strings.c:405 src/hdate_strings.c:425
547 msgid "Erev Shavuot"
548 msgstr "ערב שבועות"
549
550 #: src/hdate_strings.c:405 src/hdate_strings.c:425
551 msgid "Shavuot"
552 msgstr "שבועות"
553
554 #: src/hdate_strings.c:406 src/hdate_strings.c:426
555 msgid "Tzom Tammuz"
556 msgstr "י\"ז תמוז"
557
558 #: src/hdate_strings.c:406 src/hdate_strings.c:426
559 msgid "Tish'a B'Av"
560 msgstr "תשעה באב"
561
562 #: src/hdate_strings.c:407 src/hdate_strings.c:427
563 msgid "Tu B'Av"
564 msgstr "ט\"ו באב"
565
566 #: src/hdate_strings.c:407 src/hdate_strings.c:427
567 msgid "Yom HaShoah"
568 msgstr "יום השואה"
569
570 #: src/hdate_strings.c:408 src/hdate_strings.c:428
571 msgid "Yom HaZikaron"
572 msgstr "יום הזכרון"
573
574 #: src/hdate_strings.c:408 src/hdate_strings.c:428
575 msgid "Yom Yerushalayim"
576 msgstr "יום ירושלים"
577
578 #: src/hdate_strings.c:409 src/hdate_strings.c:429
579 msgid "Shmini Atzeret"
580 msgstr "שמיני עצרת"
581
582 #: src/hdate_strings.c:409 src/hdate_strings.c:429
583 msgid "Pesach VII"
584 msgstr "שביעי של פסח"
585
586 #: src/hdate_strings.c:410 src/hdate_strings.c:430
587 msgid "Pesach VIII"
588 msgstr "אחרון של פסח"
589
590 #: src/hdate_strings.c:410 src/hdate_strings.c:430
591 msgid "Shavuot II"
592 msgstr "שני של שבועות"
593
594 #: src/hdate_strings.c:411 src/hdate_strings.c:431
595 msgid "Sukkot II"
596 msgstr "סוכות שני"
597
598 #: src/hdate_strings.c:411 src/hdate_strings.c:431
599 msgid "Pesach II"
600 msgstr "שני של פסח"
601
602 #: src/hdate_strings.c:412 src/hdate_strings.c:432
603 msgid "Family Day"
604 msgstr "יום המשפחה"
605
606 #: src/hdate_strings.c:412 src/hdate_strings.c:432
607 msgid "Memorial day for fallen whose place of burial is unknown"
608 msgstr "יום הזכרון לחללי מלחמות ישראל שמקום קבורתם לא נודע"
609
610 #: src/hdate_strings.c:413
611 msgid "Yitzhak Rabin memorial day"
612 msgstr "יום הזכרון ליצחק רבין"
613
614 #: src/hdate_strings.c:413
615 msgid "Zeev Zhabotinsky day"
616 msgstr "יום זאב זבוטינסקי"
617
618 #: src/hdate_strings.c:414 src/hdate_strings.c:434
619 msgid "Erev Yom Kippur"
620 msgstr "ערב יום כיפור"
621
622 #: src/hdate_strings.c:433
623 msgid "Rabin memorial day"
624 msgstr "יום הזכרון ליצחק רבין"
625
626 #: src/hdate_strings.c:433
627 msgid "Zhabotinsky day"
628 msgstr "יום זבוטינסקי"
629
630 #: src/hdate_strings.c:514
631 msgid "in the Omer"
632 msgstr "לספירת העומר"
633
634 #: examples/hcal/hcal.c:142
635 msgid ""
636 "# configuration file for hcal - Hebrew calendar program\n"
637 "# part of package libhdate\n"
638 "#\n"
639 "# Should you mangle this file and wish to restore its default content,\n"
640 "# rename or delete this file and run hcal; hcal will automatically\n"
641 "# regenerate the default content.\n"
642 "#\n"
643 "# Your system administrator can set system-wide defaults for hcal by\n"
644 "# modifying file <not yet implemented>.\n"
645 "# You may override all defaults by changing the contents of this file.\n"
646 "#\n"
647 "# Version information\n"
648 "# This may be used by updates to hcal to determine how to parse the file\n"
649 "# and whether additional information and options should be appended to\n"
650 "# the end of this file.\n"
651 "VERSION=2.00\n"
652 "# Location awareness\n"
653 "# hcal wants to accurately highlight the current Hebrew day, including\n"
654 "# during the hours between sunset and secular midnight. If you don't\n"
655 "# provide it with latitude, longitude, and time zone information, hcal\n"
656 "# will try to guess the information, based upon your system timezone,\n"
657 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
658 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
659 "# with a message that includes the guessed location.\n"
660 "# hcal's guesses will also affect its default behaviour for ouput of\n"
661 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
662 "#SUNSET_AWARE=TRUE\n"
663 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
664 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
665 "# delimiters. Use negative values to indicate South and West, or\n"
666 "# use the abbreviated compass directions N, S, E, W.\n"
667 "#LATITUDE=\n"
668 "#LONGITUDE=\n"
669 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
670 "# with the characters :'\" as possible delimiters.\n"
671 "#TIMEZONE=\n"
672 "\n"
673 "# Israel and the diaspora\n"
674 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
675 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
676 "# forces hcal to display calendar information for Israel, using hcal's\n"
677 "# default coordinates foe Israel, or coordinates that you provide that\n"
678 "# seem legitmately within Israel.\n"
679 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
680 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
681 "# a non-resident vistor to Israel. The command line options for these\n"
682 "# features are --israel, -I, --diaspora, -d.\n"
683 "#FORCE_DIASPORA=FALSE;\n"
684 "#FORCE_ISRAEL=FALSE;\n"
685 "\n"
686 "# Shabbat related\n"
687 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
688 "# The command line options for these features are -p (--parasha), and\n"
689 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
690 "(minutes\n"
691 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
692 "# (minutes after sunset).\n"
693 "#PARASHA_NAMES=FALSE\n"
694 "#SHABBAT_INFO=FALSE\n"
695 "#CANDLE_LIGHTING=FALSE\n"
696 "#HAVDALAH=FALSE\n"
697 "\n"
698 "# Holiday identification\n"
699 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
700 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
701 "# will have hcal output after the month's calendar, a list of the month's\n"
702 "# holidays along with the days on which they occur.\n"
703 "#FOOTNOTE=FALSE\n"
704 "\n"
705 "# Output in hebrew characters\n"
706 "# hcal defaults to output all information in your default language, so\n"
707 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
708 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
709 "# still outputting gregorian information in your default language. To\n"
710 "# output ALL information in Hebrew, run something like this:\n"
711 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
712 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
713 "# output, you need to install a terminal font that includes the Hebrew\n"
714 "# character set (hint: unicode).\n"
715 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
716 "#FORCE_HEBREW=FALSE\n"
717 "\n"
718 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
719 "# Unfortunately, the world can not be depended upon to be either. Most\n"
720 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
721 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
722 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
723 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
724 "# This will reverse the order of the Hebrew characters, so they will\n"
725 "# display 'visual'ly correct; however, such output will not be suitable\n"
726 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
727 "# automatically forces hebrew.\n"
728 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
729 "#OUTPUT_BIDI=FALSE\n"
730 "\n"
731 "# Display enhancements\n"
732 "# hcal defaults to display the current day in reverse video\n"
733 "# The command line option for this feature is --no-reverse\n"
734 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
735 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
736 "# colorized output may yield unexpected results.\n"
737 "#COLORIZE=FALSE\n"
738 "\n"
739 "# HTML OUTPUT\n"
740 "#OUTPUT_HTML=FALSE\n"
741 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
742 "\n"
743 "# Suppress alerts and warnings\n"
744 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
745 "#QUIET_ALERTS=FALSE\n"
746 "\n"
747 "# Three month display\n"
748 "# hcal can display a previous, current and next month side-by-side. hcal\n"
749 "# can also display a calendar for an entire year in four rows of three\n"
750 "# months each. Note that this will display properly only if your console\n"
751 "# is set for at least 127 columns. Note also that setting this option to\n"
752 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
753 "#THREE_MONTH=FALSE\n"
754 "\n"
755 "# User-defined menus\n"
756 "# You may specify here command-line strings to optionally be parsed\n"
757 "# by hcal at execution time. To do so, use the command line option -m\n"
758 "# (--menu). hcal will process first the settings of this config file,\n"
759 "# then the other settings of your command line, and then will prompt\n"
760 "# you for which menu item you would like to select. hcal will process\n"
761 "# your menu selection as if it were a new command line, further modifying\n"
762 "# all the prior settings.\n"
763 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
764 "# truncated at one hundred characters\n"
765 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
766 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
767 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
768 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
769 msgstr ""
770
771 #: examples/hcal/hcal.c:271
772 msgid ""
773 "hcal - Hebrew calendar\n"
774 "version 1.6"
775 msgstr ""
776
777 #: examples/hcal/hcal.c:281
778 msgid ""
779 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
780 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
781 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
782 " timezone: -z nn[( .nn | :mm )]\n"
783 "Try 'hcal --help' for more information"
784 msgstr ""
785
786 #: examples/hcal/hcal.c:295
787 msgid ""
788 "Hebrew calendar\n"
789 "OPTIONS:\n"
790 " -1 --one-month over-ride config file setting if you had set\n"
791 " option --three-month as a default there\n"
792 " -3 --three-month displays previous/next months\n"
793 " side by side. requires 127 columns\n"
794 " -b --bidi prints hebrew in reverse (visual)\n"
795 " --visual\n"
796 " --no-bidi over-ride config file setting if you had set\n"
797 " --no-visual option -bidi as a default there\n"
798 " -c --colorize displays in calming, muted tones\n"
799 " --no-color over-ride a --colorize setting in your config file\n"
800 " -d --diaspora use diaspora reading and holidays.\n"
801 " -f --footnote print descriptive notes of holidays\n"
802 " --no-footnote over-ride a footnote setting in your config file\n"
803 " -h --html output in html format to stdout\n"
804 " -H --hebrew print hebrew information in Hebrew\n"
805 " -i use external css file \"./hcal.css\".\n"
806 " -I --israel override a diaspora default\n"
807 " --no-reverse do not highlight today's date\n"
808 " -m --menu prompt user-defined menu from config file\n"
809 " -p --parasha print week's parasha on each calendar row\n"
810 " -q --quiet-alerts suppress warning messages\n"
811 " -s --shabbat print Shabbat times and parshiot\n"
812 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
813 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
814 " -z --timezone nn timezone, +/-UTC\n"
815 " -l --latitude yy latitude yy degrees. Negative values are South\n"
816 " -L --longitude xx longitude xx degrees. Negative values are West\n"
817 "\n"
818 "All options can be made default in the config file, or menu-ized for\n"
819 "easy selection."
820 msgstr ""
821
822 #: examples/hcal/hcal.c:1877
823 msgid ""
824 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
825 "month' mode"
826 msgstr ""
827
828 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
829 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
830 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
831 msgid "error"
832 msgstr ""
833
834 #: examples/hcal/hcal.c:1949
835 msgid "too many parameters received. expected [[mm] [yyyy]"
836 msgstr ""
837
838 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
839 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
840 msgid "year"
841 msgstr ""
842
843 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
844 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
845 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
846 #: examples/hcal/hdate.c:2132
847 msgid "month"
848 msgstr ""
849
850 #: examples/hcal/hdate.c:42
851 msgid "sunrise"
852 msgstr ""
853
854 #: examples/hcal/hdate.c:43
855 msgid "sunset"
856 msgstr ""
857
858 #: examples/hcal/hdate.c:44
859 msgid "first_light"
860 msgstr ""
861
862 #: examples/hcal/hdate.c:45
863 msgid "talit"
864 msgstr ""
865
866 #: examples/hcal/hdate.c:46
867 msgid "midday"
868 msgstr ""
869
870 #: examples/hcal/hdate.c:47
871 msgid "first_stars"
872 msgstr ""
873
874 #: examples/hcal/hdate.c:48
875 msgid "three_stars"
876 msgstr ""
877
878 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
879 msgid "sun_hour"
880 msgstr ""
881
882 #: examples/hcal/hdate.c:50
883 msgid "candle-lighting"
884 msgstr ""
885
886 #: examples/hcal/hdate.c:51
887 msgid "havdalah"
888 msgstr ""
889
890 #: examples/hcal/hdate.c:81
891 msgid ""
892 "# configuration file for hdate - Hebrew date information program\n"
893 "# part of package libhdate\n"
894 "#\n"
895 "# Should you mangle this file and wish to restore its default content,\n"
896 "# rename or delete this file and run hdate; hdate will automatically\n"
897 "# regenerate the default content.\n"
898 "#\n"
899 "# Your system administrator can set system-wide defaults for hcal by\n"
900 "# modifying file <not yet implemented>.\n"
901 "# You may override all defaults by changing the contents of this file.\n"
902 "#\n"
903 "# Version information\n"
904 "# This may be used by updates to hcal to determine how to parse the file\n"
905 "# and whether additional information and options should be appended to\n"
906 "# the end of this file.\n"
907 "VERSION=2.00\n"
908 "#\n"
909 "# Location awareness\n"
910 "# hdate wants to accurately highlight the current Hebrew day, including\n"
911 "# during the hours between sunset and secular midnight. If you don't\n"
912 "# provide it with latitude, longitude, and time zone information, hdate\n"
913 "# will try to guess the information, based upon your system timezone,\n"
914 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
915 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
916 "# with a message that includes the guessed location.\n"
917 "# hdate's guesses will also affect its default behaviour for ouput of\n"
918 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
919 "#SUNSET_AWARE=TRUE\n"
920 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
921 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
922 "# delimiters. Use negative values to indicate South and West, or\n"
923 "# use the abbreviated compass directions N, S, E, W.\n"
924 "#LATITUDE=\n"
925 "#LONGITUDE=\n"
926 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
927 "# with the characters :'\" as possible delimiters.\n"
928 "#TIMEZONE=\n"
929 "\n"
930 "# Output in hebrew characters\n"
931 "# hdate defaults to output all information in your default language, so\n"
932 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
933 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
934 "# still outputting gregorian information in your default language. To\n"
935 "# output ALL information in Hebrew, run something like this:\n"
936 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
937 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
938 "# output, you need to install a terminal font that includes the Hebrew\n"
939 "# character set (hint: unicode).\n"
940 "#FORCE_HEBREW=FALSE\n"
941 "\n"
942 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
943 "# Unfortunately, the world can not be depended upon to be either. Most\n"
944 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
945 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
946 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
947 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
948 "# This will reverse the order of the Hebrew characters, so they will\n"
949 "# display 'visual'ly correct; however, such output will not be suitable\n"
950 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
951 "# automatically forces hebrew.\n"
952 "#OUTPUT_BIDI=FALSE\n"
953 "\n"
954 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
955 "# in the following ways:\n"
956 "# option YOM ~> yom shishi, aleph tishrei ...\n"
957 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
958 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
959 "#YOM=FALSE\n"
960 "#LESHABBAT=FALSE\n"
961 "#LESEDER=FALSE\n"
962 "\n"
963 "#SUN_RISE_SET=FALSE\n"
964 "#TIMES_OF_DAY=FALSE\n"
965 "#SHORT_FORMAT=FALSE\n"
966 "#SEFIRAT_HAOMER=FALSE\n"
967 "#DIASPORA=FALSE\n"
968 "\n"
969 "\n"
970 "# Shabbat related\n"
971 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
972 "# The command line options for these features are -r (--parasha), and\n"
973 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
974 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
975 "# (minutes after sunset).\n"
976 "#PARASHA_NAMES=FALSE\n"
977 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
978 "#SHABBAT_INFO=FALSE\n"
979 "\n"
980 "#CANDLE_LIGHTING=FALSE\n"
981 "#HAVDALAH=FALSE\n"
982 "\n"
983 "# Holiday related\n"
984 "#HOLIDAYS=FALSE\n"
985 "#ONLY_IF_HOLIDAY=FALSE\n"
986 "\n"
987 "# Tabular output\n"
988 "# This option has hdate output the information you request in a single\n"
989 "# comma-delimited line per day, suitable for piping or import to\n"
990 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
991 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
992 "# The command line option for this feature is, um, --table\n"
993 "#TABULAR=FALSE\n"
994 "\n"
995 "# iCal format\n"
996 "# hdate can output its information in iCal-compatable format\n"
997 "# ICAL=FALSE\n"
998 "# Suppress alerts and warnings\n"
999 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1000 "#QUIET_ALERTS=FALSE\n"
1001 "\n"
1002 "# Julian day number\n"
1003 "# The Julian day number is a .... See ... for more details.\n"
1004 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1005 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1006 "#JULIAN_DAY=FALSE\n"
1007 "\n"
1008 "# User-defined menus\n"
1009 "# You may specify here command-line strings to optionally be parsed\n"
1010 "# by hcal at execution time. To do so, use the command line option -m\n"
1011 "# (--menu). hcal will process first the settings of this config file,\n"
1012 "# then the other settings of your command line, and then will prompt\n"
1013 "# you for which menu item you would like to select. hcal will process\n"
1014 "# your menu selection as if it were a new command line, further modifying\n"
1015 "# all the prior settings.\n"
1016 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1017 "# truncated at one hundred characters\n"
1018 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1019 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1020 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1021 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1022 msgstr ""
1023
1024 #: examples/hcal/hdate.c:209
1025 msgid ""
1026 "hdate - display Hebrew date information\n"
1027 "version 1.6"
1028 msgstr ""
1029
1030 #: examples/hcal/hdate.c:219
1031 msgid ""
1032 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1033 " hdate [options] [coordinates timezone] [julian_day]\n"
1034 "\n"
1035 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1036 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1037 " timezone: -z nn[( .nn | :mm )]\n"
1038 "Try 'hdate --help' for more information"
1039 msgstr ""
1040
1041 #: examples/hcal/hdate.c:235
1042 msgid ""
1043 "hdate - display Hebrew date information\n"
1044 "OPTIONS:\n"
1045 " -b --bidi prints hebrew in reverse (visual)\n"
1046 " --visual\n"
1047 " -c print Shabbat start/end times.\n"
1048 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1049 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1050 " -d --diaspora use diaspora reading and holidays.\n"
1051 " -h --holidays print holidays.\n"
1052 " -H print only it is a holiday.\n"
1053 " -i --ical use iCal formated output.\n"
1054 " -j --julian print Julian day number.\n"
1055 " -m --menu prompt user-defined menu from config file\n"
1056 " -o --omer print Sefirat Haomer.\n"
1057 " -q --quiet-alerts suppress warning messages\n"
1058 " -r --parasha print weekly reading on saturday.\n"
1059 " -R print only if there is a weekly reading on Shabbat.\n"
1060 " -s --sun print sunrise/sunset times.\n"
1061 " -S --short-format print using short format.\n"
1062 " -t print day times: first light, talit, sunrise,\n"
1063 " midday, sunset, first stars, three stars.\n"
1064 " -T --table tabular output, suitable for spreadsheets\n"
1065 "\n"
1066 " -z --timezone nn timezone, +/-UTC\n"
1067 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1068 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1069 "\n"
1070 " --hebrew forces Hebrew to print in Hebrew characters\n"
1071 " --yom force Hebrew prefix to Hebrew day of week\n"
1072 " --leshabbat insert parasha between day of week and day\n"
1073 " --leseder insert parasha between day of week and day\n"
1074 " --not-sunset-aware don't display next day if after sunset\n"
1075 "\n"
1076 "All options can be made default in the config file, or menu-ized for\n"
1077 "easy selection."
1078 msgstr ""
1079
1080 #: examples/hcal/hdate.c:274
1081 msgid ""
1082 "ALERT: The information displayed is for today's Hebrew date.\n"
1083 " Because it is now after sunset, that means the data is\n"
1084 " for the Gregorian day beginning at midnight."
1085 msgstr ""
1086
1087 #: examples/hcal/hdate.c:405
1088 msgid "eve of "
1089 msgstr ""
1090
1091 #: examples/hcal/hdate.c:669
1092 msgid "today is day"
1093 msgstr ""
1094
1095 #: examples/hcal/hdate.c:743
1096 msgid "Gregorian date"
1097 msgstr ""
1098
1099 #: examples/hcal/hdate.c:743
1100 msgid "Hebrew Date"
1101 msgstr ""
1102
1103 #: examples/hcal/hdate.c:748
1104 #, fuzzy
1105 msgid "holiday"
1106 msgstr "שישי"
1107
1108 #: examples/hcal/hdate.c:749
1109 msgid "omer count"
1110 msgstr ""
1111
1112 #: examples/hcal/hdate.c:750
1113 msgid "parashat"
1114 msgstr ""
1115
1116 #: examples/hcal/hdate.c:1016
1117 msgid "Parashat"
1118 msgstr ""
1119
1120 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1121 #, fuzzy
1122 msgid "day"
1123 msgstr "מאי"
1124
1125 #: examples/hcal/hdate.c:2168
1126 msgid "too many arguments; after options max is dd mm yyyy"
1127 msgstr ""
1128
1129 #: examples/hcal/local_functions.c:97
1130 msgid "parameter"
1131 msgstr ""
1132
1133 #: examples/hcal/local_functions.c:98
1134 msgid "is non-numeric or out of bounds"
1135 msgstr ""
1136
1137 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1138 msgid "option"
1139 msgstr ""
1140
1141 #: examples/hcal/local_functions.c:104
1142 msgid "missing parameter"
1143 msgstr ""
1144
1145 #: examples/hcal/local_functions.c:110
1146 msgid "ALERT: time zone not entered, using system local time zone"
1147 msgstr ""
1148
1149 #: examples/hcal/local_functions.c:117
1150 msgid "is not a valid option"
1151 msgstr ""
1152
1153 #: examples/hcal/local_functions.c:134
1154 msgid "ALERT: guessing... will use co-ordinates for"
1155 msgstr ""
1156
1157 #: examples/hcal/local_functions.c:142
1158 msgid "Los Angeles"
1159 msgstr ""
1160
1161 #: examples/hcal/local_functions.c:143
1162 msgid "Mexico City"
1163 msgstr ""
1164
1165 #: examples/hcal/local_functions.c:144
1166 msgid "New York City"
1167 msgstr ""
1168
1169 #: examples/hcal/local_functions.c:147
1170 msgid "Buenos Aires"
1171 msgstr ""
1172
1173 #: examples/hcal/local_functions.c:148
1174 msgid "London"
1175 msgstr ""
1176
1177 #: examples/hcal/local_functions.c:149
1178 msgid "Paris"
1179 msgstr ""
1180
1181 #: examples/hcal/local_functions.c:150
1182 msgid "Tel-Aviv"
1183 msgstr ""
1184
1185 #: examples/hcal/local_functions.c:151
1186 msgid "Moscow"
1187 msgstr ""
1188
1189 #: examples/hcal/local_functions.c:152
1190 msgid "Tashkent"
1191 msgstr ""
1192
1193 #: examples/hcal/local_functions.c:153
1194 msgid "Beijing"
1195 msgstr ""
1196
1197 #: examples/hcal/local_functions.c:155
1198 msgid "Honolulu"
1199 msgstr ""
1200
1201 #: examples/hcal/local_functions.c:156
1202 msgid "Hmmm, ... hate to do this, really ..."
1203 msgstr ""
1204
1205 #: examples/hcal/local_functions.c:156
1206 msgid "using co-ordinates for the equator, at the center of time zone"
1207 msgstr ""
1208
1209 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1210 #: examples/hcal/local_functions.c:337
1211 msgid "l (latitude)"
1212 msgstr ""
1213
1214 #: examples/hcal/local_functions.c:323
1215 msgid "L (Longitue)"
1216 msgstr ""
1217
1218 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1219 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1220 msgid "L (Longitude)"
1221 msgstr ""
1222
1223 #: examples/hcal/local_functions.c:446
1224 msgid "z (time zone)"
1225 msgstr ""
1226
1227 #: examples/hcal/local_functions.c:466
1228 msgid "z (timezone)"
1229 msgstr ""
1230
1231 #: examples/hcal/local_functions.c:490
1232 msgid "valid longitude parameter missing for given latitude"
1233 msgstr ""
1234
1235 #: examples/hcal/local_functions.c:495
1236 msgid "valid latitude parameter missing for given longitude"
1237 msgstr ""
1238
1239 #: examples/hcal/local_functions.c:533
1240 msgid "time zone value of"
1241 msgstr ""
1242
1243 #: examples/hcal/local_functions.c:534
1244 msgid "is incompatible with a longitude of"
1245 msgstr ""
1246
1247 #: examples/hcal/local_functions.c:534
1248 msgid "degrees"
1249 msgstr ""
1250
1251 #: examples/hcal/local_functions.c:642
1252 msgid ""
1253 "This seems to be to be your first time using this version.\n"
1254 "Please read the new documentation in the man page and config\n"
1255 "file. Attempting to create a config file ..."
1256 msgstr ""
1257
1258 #: examples/hcal/local_functions.c:676
1259 msgid "failure attempting to create config file"
1260 msgstr ""
1261
1262 #: examples/hcal/local_functions.c:680
1263 msgid "config file created"
1264 msgstr ""
1265
1266 #: examples/hcal/local_functions.c:681
1267 msgid "failure closing"
1268 msgstr ""
1269
1270 #: examples/hcal/local_functions.c:701
1271 msgid "memory allocation failure"
1272 msgstr ""
1273
1274 #: examples/hcal/local_functions.c:915
1275 msgid "your custom menu options (from your config file)"
1276 msgstr ""
1277
1278 #: examples/hcal/local_functions.c:921
1279 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1280 msgstr ""
1281
1282 #: examples/hcal/local_functions.c:924
1283 msgid "enter your selection, or <return> to continue"
1284 msgstr ""
1285
1286 #: examples/hcal/local_functions.c:928
1287 msgid "menu selection received was out of bounds"
1288 msgstr ""
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR Free Software Foundation, Inc.
2 # This file is distributed under the same license as the PACKAGE package.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4 #
5 #, fuzzy
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: libhdate 1.6.02\n"
9 "Report-Msgid-Bugs-To: \n"
10 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #: src/hdate_strings.c:186 src/hdate_strings.c:190
20 msgid "translator"
21 msgstr ""
22
23 #: src/hdate_strings.c:248
24 msgid "Sunday"
25 msgstr ""
26
27 #: src/hdate_strings.c:248
28 msgid "Monday"
29 msgstr ""
30
31 #: src/hdate_strings.c:248
32 msgid "Tuesday"
33 msgstr ""
34
35 #: src/hdate_strings.c:248
36 msgid "Wednesday"
37 msgstr ""
38
39 #: src/hdate_strings.c:249
40 msgid "Thursday"
41 msgstr ""
42
43 #: src/hdate_strings.c:249
44 msgid "Friday"
45 msgstr ""
46
47 #: src/hdate_strings.c:249
48 msgid "Saturday"
49 msgstr ""
50
51 #: src/hdate_strings.c:251
52 msgid "Sun"
53 msgstr ""
54
55 #: src/hdate_strings.c:251
56 msgid "Mon"
57 msgstr ""
58
59 #: src/hdate_strings.c:251
60 msgid "Tue"
61 msgstr ""
62
63 #: src/hdate_strings.c:251
64 msgid "Wed"
65 msgstr ""
66
67 #: src/hdate_strings.c:251
68 msgid "Thu"
69 msgstr ""
70
71 #: src/hdate_strings.c:252
72 msgid "Fri"
73 msgstr ""
74
75 #: src/hdate_strings.c:252
76 msgid "Sat"
77 msgstr ""
78
79 #: src/hdate_strings.c:265 src/hdate_strings.c:288
80 msgid "none"
81 msgstr ""
82
83 #: src/hdate_strings.c:265 src/hdate_strings.c:288
84 msgid "Bereshit"
85 msgstr ""
86
87 #: src/hdate_strings.c:265 src/hdate_strings.c:288
88 msgid "Noach"
89 msgstr ""
90
91 #: src/hdate_strings.c:266 src/hdate_strings.c:289
92 msgid "Lech-Lecha"
93 msgstr ""
94
95 #: src/hdate_strings.c:266 src/hdate_strings.c:289
96 msgid "Vayera"
97 msgstr ""
98
99 #: src/hdate_strings.c:266 src/hdate_strings.c:289
100 msgid "Chayei Sara"
101 msgstr ""
102
103 #: src/hdate_strings.c:267 src/hdate_strings.c:290
104 msgid "Toldot"
105 msgstr ""
106
107 #: src/hdate_strings.c:267 src/hdate_strings.c:290
108 msgid "Vayetzei"
109 msgstr ""
110
111 #: src/hdate_strings.c:267 src/hdate_strings.c:290
112 msgid "Vayishlach"
113 msgstr ""
114
115 #: src/hdate_strings.c:268 src/hdate_strings.c:291
116 msgid "Vayeshev"
117 msgstr ""
118
119 #: src/hdate_strings.c:268 src/hdate_strings.c:291
120 msgid "Miketz"
121 msgstr ""
122
123 #: src/hdate_strings.c:268 src/hdate_strings.c:291
124 msgid "Vayigash"
125 msgstr ""
126
127 #: src/hdate_strings.c:269 src/hdate_strings.c:292
128 msgid "Vayechi"
129 msgstr ""
130
131 #: src/hdate_strings.c:269 src/hdate_strings.c:292
132 msgid "Shemot"
133 msgstr ""
134
135 #: src/hdate_strings.c:269 src/hdate_strings.c:292
136 msgid "Vaera"
137 msgstr ""
138
139 #: src/hdate_strings.c:270 src/hdate_strings.c:293
140 msgid "Bo"
141 msgstr ""
142
143 #: src/hdate_strings.c:270 src/hdate_strings.c:293
144 msgid "Beshalach"
145 msgstr ""
146
147 #: src/hdate_strings.c:270 src/hdate_strings.c:293
148 msgid "Yitro"
149 msgstr ""
150
151 #: src/hdate_strings.c:271 src/hdate_strings.c:294
152 msgid "Mishpatim"
153 msgstr ""
154
155 #: src/hdate_strings.c:271 src/hdate_strings.c:294
156 msgid "Terumah"
157 msgstr ""
158
159 #: src/hdate_strings.c:271 src/hdate_strings.c:294
160 msgid "Tetzaveh"
161 msgstr ""
162
163 #: src/hdate_strings.c:272 src/hdate_strings.c:295
164 msgid "Ki Tisa"
165 msgstr ""
166
167 #: src/hdate_strings.c:272 src/hdate_strings.c:295
168 msgid "Vayakhel"
169 msgstr ""
170
171 #: src/hdate_strings.c:272 src/hdate_strings.c:295
172 msgid "Pekudei"
173 msgstr ""
174
175 #: src/hdate_strings.c:273 src/hdate_strings.c:296
176 msgid "Vayikra"
177 msgstr ""
178
179 #: src/hdate_strings.c:273 src/hdate_strings.c:296
180 msgid "Tzav"
181 msgstr ""
182
183 #: src/hdate_strings.c:273 src/hdate_strings.c:296
184 msgid "Shmini"
185 msgstr ""
186
187 #: src/hdate_strings.c:274 src/hdate_strings.c:297
188 msgid "Tazria"
189 msgstr ""
190
191 #: src/hdate_strings.c:274 src/hdate_strings.c:297
192 msgid "Metzora"
193 msgstr ""
194
195 #: src/hdate_strings.c:274 src/hdate_strings.c:297
196 msgid "Achrei Mot"
197 msgstr ""
198
199 #: src/hdate_strings.c:275 src/hdate_strings.c:298
200 msgid "Kedoshim"
201 msgstr ""
202
203 #: src/hdate_strings.c:275 src/hdate_strings.c:298
204 msgid "Emor"
205 msgstr ""
206
207 #: src/hdate_strings.c:275 src/hdate_strings.c:298
208 msgid "Behar"
209 msgstr ""
210
211 #: src/hdate_strings.c:276 src/hdate_strings.c:299
212 msgid "Bechukotai"
213 msgstr ""
214
215 #: src/hdate_strings.c:276 src/hdate_strings.c:299
216 msgid "Bamidbar"
217 msgstr ""
218
219 #: src/hdate_strings.c:276 src/hdate_strings.c:299
220 msgid "Nasso"
221 msgstr ""
222
223 #: src/hdate_strings.c:277 src/hdate_strings.c:300
224 msgid "Beha'alotcha"
225 msgstr ""
226
227 #: src/hdate_strings.c:277 src/hdate_strings.c:300
228 msgid "Sh'lach"
229 msgstr ""
230
231 #: src/hdate_strings.c:277 src/hdate_strings.c:300
232 msgid "Korach"
233 msgstr ""
234
235 #: src/hdate_strings.c:278 src/hdate_strings.c:301
236 msgid "Chukat"
237 msgstr ""
238
239 #: src/hdate_strings.c:278 src/hdate_strings.c:301
240 msgid "Balak"
241 msgstr ""
242
243 #: src/hdate_strings.c:278 src/hdate_strings.c:301
244 msgid "Pinchas"
245 msgstr ""
246
247 #: src/hdate_strings.c:279 src/hdate_strings.c:302
248 msgid "Matot"
249 msgstr ""
250
251 #: src/hdate_strings.c:279 src/hdate_strings.c:302
252 msgid "Masei"
253 msgstr ""
254
255 #: src/hdate_strings.c:279 src/hdate_strings.c:302
256 msgid "Devarim"
257 msgstr ""
258
259 #: src/hdate_strings.c:280 src/hdate_strings.c:303
260 msgid "Vaetchanan"
261 msgstr ""
262
263 #: src/hdate_strings.c:280 src/hdate_strings.c:303
264 msgid "Eikev"
265 msgstr ""
266
267 #: src/hdate_strings.c:280 src/hdate_strings.c:303
268 msgid "Re'eh"
269 msgstr ""
270
271 #: src/hdate_strings.c:281 src/hdate_strings.c:304
272 msgid "Shoftim"
273 msgstr ""
274
275 #: src/hdate_strings.c:281 src/hdate_strings.c:304
276 msgid "Ki Teitzei"
277 msgstr ""
278
279 #: src/hdate_strings.c:281 src/hdate_strings.c:304
280 msgid "Ki Tavo"
281 msgstr ""
282
283 #: src/hdate_strings.c:282 src/hdate_strings.c:305
284 msgid "Nitzavim"
285 msgstr ""
286
287 #: src/hdate_strings.c:282 src/hdate_strings.c:305
288 msgid "Vayeilech"
289 msgstr ""
290
291 #: src/hdate_strings.c:282 src/hdate_strings.c:305
292 msgid "Ha'Azinu"
293 msgstr ""
294
295 #: src/hdate_strings.c:283 src/hdate_strings.c:306
296 msgid "Vezot Habracha"
297 msgstr ""
298
299 #: src/hdate_strings.c:284 src/hdate_strings.c:307
300 msgid "Vayakhel-Pekudei"
301 msgstr ""
302
303 #: src/hdate_strings.c:284 src/hdate_strings.c:307
304 msgid "Tazria-Metzora"
305 msgstr ""
306
307 #: src/hdate_strings.c:284 src/hdate_strings.c:307
308 msgid "Achrei Mot-Kedoshim"
309 msgstr ""
310
311 #: src/hdate_strings.c:285 src/hdate_strings.c:308
312 msgid "Behar-Bechukotai"
313 msgstr ""
314
315 #: src/hdate_strings.c:285 src/hdate_strings.c:308
316 msgid "Chukat-Balak"
317 msgstr ""
318
319 #: src/hdate_strings.c:285 src/hdate_strings.c:308
320 msgid "Matot-Masei"
321 msgstr ""
322
323 #: src/hdate_strings.c:286 src/hdate_strings.c:309
324 msgid "Nitzavim-Vayeilech"
325 msgstr ""
326
327 #: src/hdate_strings.c:364 src/hdate_strings.c:369
328 msgid "Tishrei"
329 msgstr ""
330
331 #: src/hdate_strings.c:364 src/hdate_strings.c:369
332 msgid "Cheshvan"
333 msgstr ""
334
335 #: src/hdate_strings.c:364 src/hdate_strings.c:369
336 msgid "Kislev"
337 msgstr ""
338
339 #: src/hdate_strings.c:364 src/hdate_strings.c:369
340 msgid "Tevet"
341 msgstr ""
342
343 #: src/hdate_strings.c:365 src/hdate_strings.c:370
344 msgid "Sh'vat"
345 msgstr ""
346
347 #: src/hdate_strings.c:365 src/hdate_strings.c:370
348 msgid "Adar"
349 msgstr ""
350
351 #: src/hdate_strings.c:365 src/hdate_strings.c:370
352 msgid "Nisan"
353 msgstr ""
354
355 #: src/hdate_strings.c:365 src/hdate_strings.c:370
356 msgid "Iyyar"
357 msgstr ""
358
359 #: src/hdate_strings.c:366 src/hdate_strings.c:371
360 msgid "Sivan"
361 msgstr ""
362
363 #: src/hdate_strings.c:366 src/hdate_strings.c:371
364 msgid "Tammuz"
365 msgstr ""
366
367 #: src/hdate_strings.c:366 src/hdate_strings.c:371
368 msgid "Av"
369 msgstr ""
370
371 #: src/hdate_strings.c:366 src/hdate_strings.c:371
372 msgid "Elul"
373 msgstr ""
374
375 #: src/hdate_strings.c:366 src/hdate_strings.c:371
376 msgid "Adar I"
377 msgstr ""
378
379 #: src/hdate_strings.c:367 src/hdate_strings.c:372
380 msgid "Adar II"
381 msgstr ""
382
383 #: src/hdate_strings.c:384
384 msgid "January"
385 msgstr ""
386
387 #: src/hdate_strings.c:384
388 msgid "February"
389 msgstr ""
390
391 #: src/hdate_strings.c:384
392 msgid "March"
393 msgstr ""
394
395 #: src/hdate_strings.c:385
396 msgid "April"
397 msgstr ""
398
399 #: src/hdate_strings.c:385 src/hdate_strings.c:388
400 msgid "May"
401 msgstr ""
402
403 #: src/hdate_strings.c:385
404 msgid "June"
405 msgstr ""
406
407 #: src/hdate_strings.c:386
408 msgid "July"
409 msgstr ""
410
411 #: src/hdate_strings.c:386
412 msgid "August"
413 msgstr ""
414
415 #: src/hdate_strings.c:386
416 msgid "September"
417 msgstr ""
418
419 #: src/hdate_strings.c:387
420 msgid "October"
421 msgstr ""
422
423 #: src/hdate_strings.c:387
424 msgid "November"
425 msgstr ""
426
427 #: src/hdate_strings.c:387
428 msgid "December"
429 msgstr ""
430
431 #: src/hdate_strings.c:388
432 msgid "Jan"
433 msgstr ""
434
435 #: src/hdate_strings.c:388
436 msgid "Feb"
437 msgstr ""
438
439 #: src/hdate_strings.c:388
440 msgid "Mar"
441 msgstr ""
442
443 #: src/hdate_strings.c:388
444 msgid "Apr"
445 msgstr ""
446
447 #: src/hdate_strings.c:389
448 msgid "Jun"
449 msgstr ""
450
451 #: src/hdate_strings.c:389
452 msgid "Jul"
453 msgstr ""
454
455 #: src/hdate_strings.c:389
456 msgid "Aug"
457 msgstr ""
458
459 #: src/hdate_strings.c:389
460 msgid "Sep"
461 msgstr ""
462
463 #: src/hdate_strings.c:389
464 msgid "Oct"
465 msgstr ""
466
467 #: src/hdate_strings.c:390
468 msgid "Nov"
469 msgstr ""
470
471 #: src/hdate_strings.c:390
472 msgid "Dec"
473 msgstr ""
474
475 #: src/hdate_strings.c:396 src/hdate_strings.c:416
476 msgid "Rosh Hashana I"
477 msgstr ""
478
479 #: src/hdate_strings.c:396 src/hdate_strings.c:416
480 msgid "Rosh Hashana II"
481 msgstr ""
482
483 #: src/hdate_strings.c:397 src/hdate_strings.c:417
484 msgid "Tzom Gedaliah"
485 msgstr ""
486
487 #: src/hdate_strings.c:397 src/hdate_strings.c:417
488 msgid "Yom Kippur"
489 msgstr ""
490
491 #: src/hdate_strings.c:398 src/hdate_strings.c:418
492 msgid "Sukkot"
493 msgstr ""
494
495 #: src/hdate_strings.c:398 src/hdate_strings.c:418
496 msgid "Hol hamoed Sukkot"
497 msgstr ""
498
499 #: src/hdate_strings.c:399 src/hdate_strings.c:419
500 msgid "Hoshana raba"
501 msgstr ""
502
503 #: src/hdate_strings.c:399 src/hdate_strings.c:419
504 msgid "Simchat Torah"
505 msgstr ""
506
507 #: src/hdate_strings.c:400 src/hdate_strings.c:420
508 msgid "Chanukah"
509 msgstr ""
510
511 #: src/hdate_strings.c:400 src/hdate_strings.c:420
512 msgid "Asara B'Tevet"
513 msgstr ""
514
515 #: src/hdate_strings.c:401 src/hdate_strings.c:421
516 msgid "Tu B'Shvat"
517 msgstr ""
518
519 #: src/hdate_strings.c:401 src/hdate_strings.c:421
520 msgid "Ta'anit Esther"
521 msgstr ""
522
523 #: src/hdate_strings.c:402 src/hdate_strings.c:422
524 msgid "Purim"
525 msgstr ""
526
527 #: src/hdate_strings.c:402 src/hdate_strings.c:422
528 msgid "Shushan Purim"
529 msgstr ""
530
531 #: src/hdate_strings.c:403 src/hdate_strings.c:423
532 msgid "Pesach"
533 msgstr ""
534
535 #: src/hdate_strings.c:403 src/hdate_strings.c:423
536 msgid "Hol hamoed Pesach"
537 msgstr ""
538
539 #: src/hdate_strings.c:404 src/hdate_strings.c:424
540 msgid "Yom HaAtzma'ut"
541 msgstr ""
542
543 #: src/hdate_strings.c:404 src/hdate_strings.c:424
544 msgid "Lag B'Omer"
545 msgstr ""
546
547 #: src/hdate_strings.c:405 src/hdate_strings.c:425
548 msgid "Erev Shavuot"
549 msgstr ""
550
551 #: src/hdate_strings.c:405 src/hdate_strings.c:425
552 msgid "Shavuot"
553 msgstr ""
554
555 #: src/hdate_strings.c:406 src/hdate_strings.c:426
556 msgid "Tzom Tammuz"
557 msgstr ""
558
559 #: src/hdate_strings.c:406 src/hdate_strings.c:426
560 msgid "Tish'a B'Av"
561 msgstr ""
562
563 #: src/hdate_strings.c:407 src/hdate_strings.c:427
564 msgid "Tu B'Av"
565 msgstr ""
566
567 #: src/hdate_strings.c:407 src/hdate_strings.c:427
568 msgid "Yom HaShoah"
569 msgstr ""
570
571 #: src/hdate_strings.c:408 src/hdate_strings.c:428
572 msgid "Yom HaZikaron"
573 msgstr ""
574
575 #: src/hdate_strings.c:408 src/hdate_strings.c:428
576 msgid "Yom Yerushalayim"
577 msgstr ""
578
579 #: src/hdate_strings.c:409 src/hdate_strings.c:429
580 msgid "Shmini Atzeret"
581 msgstr ""
582
583 #: src/hdate_strings.c:409 src/hdate_strings.c:429
584 msgid "Pesach VII"
585 msgstr ""
586
587 #: src/hdate_strings.c:410 src/hdate_strings.c:430
588 msgid "Pesach VIII"
589 msgstr ""
590
591 #: src/hdate_strings.c:410 src/hdate_strings.c:430
592 msgid "Shavuot II"
593 msgstr ""
594
595 #: src/hdate_strings.c:411 src/hdate_strings.c:431
596 msgid "Sukkot II"
597 msgstr ""
598
599 #: src/hdate_strings.c:411 src/hdate_strings.c:431
600 msgid "Pesach II"
601 msgstr ""
602
603 #: src/hdate_strings.c:412 src/hdate_strings.c:432
604 msgid "Family Day"
605 msgstr ""
606
607 #: src/hdate_strings.c:412 src/hdate_strings.c:432
608 msgid "Memorial day for fallen whose place of burial is unknown"
609 msgstr ""
610
611 #: src/hdate_strings.c:413
612 msgid "Yitzhak Rabin memorial day"
613 msgstr ""
614
615 #: src/hdate_strings.c:413
616 msgid "Zeev Zhabotinsky day"
617 msgstr ""
618
619 #: src/hdate_strings.c:414 src/hdate_strings.c:434
620 msgid "Erev Yom Kippur"
621 msgstr ""
622
623 #: src/hdate_strings.c:433
624 msgid "Rabin memorial day"
625 msgstr ""
626
627 #: src/hdate_strings.c:433
628 msgid "Zhabotinsky day"
629 msgstr ""
630
631 #: src/hdate_strings.c:514
632 msgid "in the Omer"
633 msgstr ""
634
635 #: examples/hcal/hcal.c:142
636 msgid ""
637 "# configuration file for hcal - Hebrew calendar program\n"
638 "# part of package libhdate\n"
639 "#\n"
640 "# Should you mangle this file and wish to restore its default content,\n"
641 "# rename or delete this file and run hcal; hcal will automatically\n"
642 "# regenerate the default content.\n"
643 "#\n"
644 "# Your system administrator can set system-wide defaults for hcal by\n"
645 "# modifying file <not yet implemented>.\n"
646 "# You may override all defaults by changing the contents of this file.\n"
647 "#\n"
648 "# Version information\n"
649 "# This may be used by updates to hcal to determine how to parse the file\n"
650 "# and whether additional information and options should be appended to\n"
651 "# the end of this file.\n"
652 "VERSION=2.00\n"
653 "# Location awareness\n"
654 "# hcal wants to accurately highlight the current Hebrew day, including\n"
655 "# during the hours between sunset and secular midnight. If you don't\n"
656 "# provide it with latitude, longitude, and time zone information, hcal\n"
657 "# will try to guess the information, based upon your system timezone,\n"
658 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
659 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
660 "# with a message that includes the guessed location.\n"
661 "# hcal's guesses will also affect its default behaviour for ouput of\n"
662 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
663 "#SUNSET_AWARE=TRUE\n"
664 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
665 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
666 "# delimiters. Use negative values to indicate South and West, or\n"
667 "# use the abbreviated compass directions N, S, E, W.\n"
668 "#LATITUDE=\n"
669 "#LONGITUDE=\n"
670 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
671 "# with the characters :'\" as possible delimiters.\n"
672 "#TIMEZONE=\n"
673 "\n"
674 "# Israel and the diaspora\n"
675 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
676 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
677 "# forces hcal to display calendar information for Israel, using hcal's\n"
678 "# default coordinates foe Israel, or coordinates that you provide that\n"
679 "# seem legitmately within Israel.\n"
680 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
681 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
682 "# a non-resident vistor to Israel. The command line options for these\n"
683 "# features are --israel, -I, --diaspora, -d.\n"
684 "#FORCE_DIASPORA=FALSE;\n"
685 "#FORCE_ISRAEL=FALSE;\n"
686 "\n"
687 "# Shabbat related\n"
688 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
689 "# The command line options for these features are -p (--parasha), and\n"
690 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
691 "(minutes\n"
692 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
693 "# (minutes after sunset).\n"
694 "#PARASHA_NAMES=FALSE\n"
695 "#SHABBAT_INFO=FALSE\n"
696 "#CANDLE_LIGHTING=FALSE\n"
697 "#HAVDALAH=FALSE\n"
698 "\n"
699 "# Holiday identification\n"
700 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
701 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
702 "# will have hcal output after the month's calendar, a list of the month's\n"
703 "# holidays along with the days on which they occur.\n"
704 "#FOOTNOTE=FALSE\n"
705 "\n"
706 "# Output in hebrew characters\n"
707 "# hcal defaults to output all information in your default language, so\n"
708 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
709 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
710 "# still outputting gregorian information in your default language. To\n"
711 "# output ALL information in Hebrew, run something like this:\n"
712 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
713 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
714 "# output, you need to install a terminal font that includes the Hebrew\n"
715 "# character set (hint: unicode).\n"
716 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
717 "#FORCE_HEBREW=FALSE\n"
718 "\n"
719 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
720 "# Unfortunately, the world can not be depended upon to be either. Most\n"
721 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
722 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
723 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
724 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
725 "# This will reverse the order of the Hebrew characters, so they will\n"
726 "# display 'visual'ly correct; however, such output will not be suitable\n"
727 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
728 "# automatically forces hebrew.\n"
729 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
730 "#OUTPUT_BIDI=FALSE\n"
731 "\n"
732 "# Display enhancements\n"
733 "# hcal defaults to display the current day in reverse video\n"
734 "# The command line option for this feature is --no-reverse\n"
735 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
736 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
737 "# colorized output may yield unexpected results.\n"
738 "#COLORIZE=FALSE\n"
739 "\n"
740 "# HTML OUTPUT\n"
741 "#OUTPUT_HTML=FALSE\n"
742 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
743 "\n"
744 "# Suppress alerts and warnings\n"
745 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
746 "#QUIET_ALERTS=FALSE\n"
747 "\n"
748 "# Three month display\n"
749 "# hcal can display a previous, current and next month side-by-side. hcal\n"
750 "# can also display a calendar for an entire year in four rows of three\n"
751 "# months each. Note that this will display properly only if your console\n"
752 "# is set for at least 127 columns. Note also that setting this option to\n"
753 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
754 "#THREE_MONTH=FALSE\n"
755 "\n"
756 "# User-defined menus\n"
757 "# You may specify here command-line strings to optionally be parsed\n"
758 "# by hcal at execution time. To do so, use the command line option -m\n"
759 "# (--menu). hcal will process first the settings of this config file,\n"
760 "# then the other settings of your command line, and then will prompt\n"
761 "# you for which menu item you would like to select. hcal will process\n"
762 "# your menu selection as if it were a new command line, further modifying\n"
763 "# all the prior settings.\n"
764 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
765 "# truncated at one hundred characters\n"
766 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
767 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
768 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
769 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
770 msgstr ""
771
772 #: examples/hcal/hcal.c:271
773 msgid ""
774 "hcal - Hebrew calendar\n"
775 "version 1.6"
776 msgstr ""
777
778 #: examples/hcal/hcal.c:281
779 msgid ""
780 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
781 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
782 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
783 " timezone: -z nn[( .nn | :mm )]\n"
784 "Try 'hcal --help' for more information"
785 msgstr ""
786
787 #: examples/hcal/hcal.c:295
788 msgid ""
789 "Hebrew calendar\n"
790 "OPTIONS:\n"
791 " -1 --one-month over-ride config file setting if you had set\n"
792 " option --three-month as a default there\n"
793 " -3 --three-month displays previous/next months\n"
794 " side by side. requires 127 columns\n"
795 " -b --bidi prints hebrew in reverse (visual)\n"
796 " --visual\n"
797 " --no-bidi over-ride config file setting if you had set\n"
798 " --no-visual option -bidi as a default there\n"
799 " -c --colorize displays in calming, muted tones\n"
800 " --no-color over-ride a --colorize setting in your config file\n"
801 " -d --diaspora use diaspora reading and holidays.\n"
802 " -f --footnote print descriptive notes of holidays\n"
803 " --no-footnote over-ride a footnote setting in your config file\n"
804 " -h --html output in html format to stdout\n"
805 " -H --hebrew print hebrew information in Hebrew\n"
806 " -i use external css file \"./hcal.css\".\n"
807 " -I --israel override a diaspora default\n"
808 " --no-reverse do not highlight today's date\n"
809 " -m --menu prompt user-defined menu from config file\n"
810 " -p --parasha print week's parasha on each calendar row\n"
811 " -q --quiet-alerts suppress warning messages\n"
812 " -s --shabbat print Shabbat times and parshiot\n"
813 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
814 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
815 " -z --timezone nn timezone, +/-UTC\n"
816 " -l --latitude yy latitude yy degrees. Negative values are South\n"
817 " -L --longitude xx longitude xx degrees. Negative values are West\n"
818 "\n"
819 "All options can be made default in the config file, or menu-ized for\n"
820 "easy selection."
821 msgstr ""
822
823 #: examples/hcal/hcal.c:1877
824 msgid ""
825 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
826 "month' mode"
827 msgstr ""
828
829 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
830 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
831 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
832 msgid "error"
833 msgstr ""
834
835 #: examples/hcal/hcal.c:1949
836 msgid "too many parameters received. expected [[mm] [yyyy]"
837 msgstr ""
838
839 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
840 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
841 msgid "year"
842 msgstr ""
843
844 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
845 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
846 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
847 #: examples/hcal/hdate.c:2132
848 msgid "month"
849 msgstr ""
850
851 #: examples/hcal/hdate.c:42
852 msgid "sunrise"
853 msgstr ""
854
855 #: examples/hcal/hdate.c:43
856 msgid "sunset"
857 msgstr ""
858
859 #: examples/hcal/hdate.c:44
860 msgid "first_light"
861 msgstr ""
862
863 #: examples/hcal/hdate.c:45
864 msgid "talit"
865 msgstr ""
866
867 #: examples/hcal/hdate.c:46
868 msgid "midday"
869 msgstr ""
870
871 #: examples/hcal/hdate.c:47
872 msgid "first_stars"
873 msgstr ""
874
875 #: examples/hcal/hdate.c:48
876 msgid "three_stars"
877 msgstr ""
878
879 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
880 msgid "sun_hour"
881 msgstr ""
882
883 #: examples/hcal/hdate.c:50
884 msgid "candle-lighting"
885 msgstr ""
886
887 #: examples/hcal/hdate.c:51
888 msgid "havdalah"
889 msgstr ""
890
891 #: examples/hcal/hdate.c:81
892 msgid ""
893 "# configuration file for hdate - Hebrew date information program\n"
894 "# part of package libhdate\n"
895 "#\n"
896 "# Should you mangle this file and wish to restore its default content,\n"
897 "# rename or delete this file and run hdate; hdate will automatically\n"
898 "# regenerate the default content.\n"
899 "#\n"
900 "# Your system administrator can set system-wide defaults for hcal by\n"
901 "# modifying file <not yet implemented>.\n"
902 "# You may override all defaults by changing the contents of this file.\n"
903 "#\n"
904 "# Version information\n"
905 "# This may be used by updates to hcal to determine how to parse the file\n"
906 "# and whether additional information and options should be appended to\n"
907 "# the end of this file.\n"
908 "VERSION=2.00\n"
909 "#\n"
910 "# Location awareness\n"
911 "# hdate wants to accurately highlight the current Hebrew day, including\n"
912 "# during the hours between sunset and secular midnight. If you don't\n"
913 "# provide it with latitude, longitude, and time zone information, hdate\n"
914 "# will try to guess the information, based upon your system timezone,\n"
915 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
916 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
917 "# with a message that includes the guessed location.\n"
918 "# hdate's guesses will also affect its default behaviour for ouput of\n"
919 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
920 "#SUNSET_AWARE=TRUE\n"
921 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
922 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
923 "# delimiters. Use negative values to indicate South and West, or\n"
924 "# use the abbreviated compass directions N, S, E, W.\n"
925 "#LATITUDE=\n"
926 "#LONGITUDE=\n"
927 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
928 "# with the characters :'\" as possible delimiters.\n"
929 "#TIMEZONE=\n"
930 "\n"
931 "# Output in hebrew characters\n"
932 "# hdate defaults to output all information in your default language, so\n"
933 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
934 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
935 "# still outputting gregorian information in your default language. To\n"
936 "# output ALL information in Hebrew, run something like this:\n"
937 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
938 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
939 "# output, you need to install a terminal font that includes the Hebrew\n"
940 "# character set (hint: unicode).\n"
941 "#FORCE_HEBREW=FALSE\n"
942 "\n"
943 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
944 "# Unfortunately, the world can not be depended upon to be either. Most\n"
945 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
946 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
947 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
948 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
949 "# This will reverse the order of the Hebrew characters, so they will\n"
950 "# display 'visual'ly correct; however, such output will not be suitable\n"
951 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
952 "# automatically forces hebrew.\n"
953 "#OUTPUT_BIDI=FALSE\n"
954 "\n"
955 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
956 "# in the following ways:\n"
957 "# option YOM ~> yom shishi, aleph tishrei ...\n"
958 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
959 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
960 "#YOM=FALSE\n"
961 "#LESHABBAT=FALSE\n"
962 "#LESEDER=FALSE\n"
963 "\n"
964 "#SUN_RISE_SET=FALSE\n"
965 "#TIMES_OF_DAY=FALSE\n"
966 "#SHORT_FORMAT=FALSE\n"
967 "#SEFIRAT_HAOMER=FALSE\n"
968 "#DIASPORA=FALSE\n"
969 "\n"
970 "\n"
971 "# Shabbat related\n"
972 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
973 "# The command line options for these features are -r (--parasha), and\n"
974 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
975 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
976 "# (minutes after sunset).\n"
977 "#PARASHA_NAMES=FALSE\n"
978 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
979 "#SHABBAT_INFO=FALSE\n"
980 "\n"
981 "#CANDLE_LIGHTING=FALSE\n"
982 "#HAVDALAH=FALSE\n"
983 "\n"
984 "# Holiday related\n"
985 "#HOLIDAYS=FALSE\n"
986 "#ONLY_IF_HOLIDAY=FALSE\n"
987 "\n"
988 "# Tabular output\n"
989 "# This option has hdate output the information you request in a single\n"
990 "# comma-delimited line per day, suitable for piping or import to\n"
991 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
992 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
993 "# The command line option for this feature is, um, --table\n"
994 "#TABULAR=FALSE\n"
995 "\n"
996 "# iCal format\n"
997 "# hdate can output its information in iCal-compatable format\n"
998 "# ICAL=FALSE\n"
999 "# Suppress alerts and warnings\n"
1000 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1001 "#QUIET_ALERTS=FALSE\n"
1002 "\n"
1003 "# Julian day number\n"
1004 "# The Julian day number is a .... See ... for more details.\n"
1005 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1006 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1007 "#JULIAN_DAY=FALSE\n"
1008 "\n"
1009 "# User-defined menus\n"
1010 "# You may specify here command-line strings to optionally be parsed\n"
1011 "# by hcal at execution time. To do so, use the command line option -m\n"
1012 "# (--menu). hcal will process first the settings of this config file,\n"
1013 "# then the other settings of your command line, and then will prompt\n"
1014 "# you for which menu item you would like to select. hcal will process\n"
1015 "# your menu selection as if it were a new command line, further modifying\n"
1016 "# all the prior settings.\n"
1017 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1018 "# truncated at one hundred characters\n"
1019 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1020 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1021 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1022 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1023 msgstr ""
1024
1025 #: examples/hcal/hdate.c:209
1026 msgid ""
1027 "hdate - display Hebrew date information\n"
1028 "version 1.6"
1029 msgstr ""
1030
1031 #: examples/hcal/hdate.c:219
1032 msgid ""
1033 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1034 " hdate [options] [coordinates timezone] [julian_day]\n"
1035 "\n"
1036 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1037 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1038 " timezone: -z nn[( .nn | :mm )]\n"
1039 "Try 'hdate --help' for more information"
1040 msgstr ""
1041
1042 #: examples/hcal/hdate.c:235
1043 msgid ""
1044 "hdate - display Hebrew date information\n"
1045 "OPTIONS:\n"
1046 " -b --bidi prints hebrew in reverse (visual)\n"
1047 " --visual\n"
1048 " -c print Shabbat start/end times.\n"
1049 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1050 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1051 " -d --diaspora use diaspora reading and holidays.\n"
1052 " -h --holidays print holidays.\n"
1053 " -H print only it is a holiday.\n"
1054 " -i --ical use iCal formated output.\n"
1055 " -j --julian print Julian day number.\n"
1056 " -m --menu prompt user-defined menu from config file\n"
1057 " -o --omer print Sefirat Haomer.\n"
1058 " -q --quiet-alerts suppress warning messages\n"
1059 " -r --parasha print weekly reading on saturday.\n"
1060 " -R print only if there is a weekly reading on Shabbat.\n"
1061 " -s --sun print sunrise/sunset times.\n"
1062 " -S --short-format print using short format.\n"
1063 " -t print day times: first light, talit, sunrise,\n"
1064 " midday, sunset, first stars, three stars.\n"
1065 " -T --table tabular output, suitable for spreadsheets\n"
1066 "\n"
1067 " -z --timezone nn timezone, +/-UTC\n"
1068 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1069 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1070 "\n"
1071 " --hebrew forces Hebrew to print in Hebrew characters\n"
1072 " --yom force Hebrew prefix to Hebrew day of week\n"
1073 " --leshabbat insert parasha between day of week and day\n"
1074 " --leseder insert parasha between day of week and day\n"
1075 " --not-sunset-aware don't display next day if after sunset\n"
1076 "\n"
1077 "All options can be made default in the config file, or menu-ized for\n"
1078 "easy selection."
1079 msgstr ""
1080
1081 #: examples/hcal/hdate.c:274
1082 msgid ""
1083 "ALERT: The information displayed is for today's Hebrew date.\n"
1084 " Because it is now after sunset, that means the data is\n"
1085 " for the Gregorian day beginning at midnight."
1086 msgstr ""
1087
1088 #: examples/hcal/hdate.c:405
1089 msgid "eve of "
1090 msgstr ""
1091
1092 #: examples/hcal/hdate.c:669
1093 msgid "today is day"
1094 msgstr ""
1095
1096 #: examples/hcal/hdate.c:743
1097 msgid "Gregorian date"
1098 msgstr ""
1099
1100 #: examples/hcal/hdate.c:743
1101 msgid "Hebrew Date"
1102 msgstr ""
1103
1104 #: examples/hcal/hdate.c:748
1105 msgid "holiday"
1106 msgstr ""
1107
1108 #: examples/hcal/hdate.c:749
1109 msgid "omer count"
1110 msgstr ""
1111
1112 #: examples/hcal/hdate.c:750
1113 msgid "parashat"
1114 msgstr ""
1115
1116 #: examples/hcal/hdate.c:1016
1117 msgid "Parashat"
1118 msgstr ""
1119
1120 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1121 msgid "day"
1122 msgstr ""
1123
1124 #: examples/hcal/hdate.c:2168
1125 msgid "too many arguments; after options max is dd mm yyyy"
1126 msgstr ""
1127
1128 #: examples/hcal/local_functions.c:97
1129 msgid "parameter"
1130 msgstr ""
1131
1132 #: examples/hcal/local_functions.c:98
1133 msgid "is non-numeric or out of bounds"
1134 msgstr ""
1135
1136 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1137 msgid "option"
1138 msgstr ""
1139
1140 #: examples/hcal/local_functions.c:104
1141 msgid "missing parameter"
1142 msgstr ""
1143
1144 #: examples/hcal/local_functions.c:110
1145 msgid "ALERT: time zone not entered, using system local time zone"
1146 msgstr ""
1147
1148 #: examples/hcal/local_functions.c:117
1149 msgid "is not a valid option"
1150 msgstr ""
1151
1152 #: examples/hcal/local_functions.c:134
1153 msgid "ALERT: guessing... will use co-ordinates for"
1154 msgstr ""
1155
1156 #: examples/hcal/local_functions.c:142
1157 msgid "Los Angeles"
1158 msgstr ""
1159
1160 #: examples/hcal/local_functions.c:143
1161 msgid "Mexico City"
1162 msgstr ""
1163
1164 #: examples/hcal/local_functions.c:144
1165 msgid "New York City"
1166 msgstr ""
1167
1168 #: examples/hcal/local_functions.c:147
1169 msgid "Buenos Aires"
1170 msgstr ""
1171
1172 #: examples/hcal/local_functions.c:148
1173 msgid "London"
1174 msgstr ""
1175
1176 #: examples/hcal/local_functions.c:149
1177 msgid "Paris"
1178 msgstr ""
1179
1180 #: examples/hcal/local_functions.c:150
1181 msgid "Tel-Aviv"
1182 msgstr ""
1183
1184 #: examples/hcal/local_functions.c:151
1185 msgid "Moscow"
1186 msgstr ""
1187
1188 #: examples/hcal/local_functions.c:152
1189 msgid "Tashkent"
1190 msgstr ""
1191
1192 #: examples/hcal/local_functions.c:153
1193 msgid "Beijing"
1194 msgstr ""
1195
1196 #: examples/hcal/local_functions.c:155
1197 msgid "Honolulu"
1198 msgstr ""
1199
1200 #: examples/hcal/local_functions.c:156
1201 msgid "Hmmm, ... hate to do this, really ..."
1202 msgstr ""
1203
1204 #: examples/hcal/local_functions.c:156
1205 msgid "using co-ordinates for the equator, at the center of time zone"
1206 msgstr ""
1207
1208 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1209 #: examples/hcal/local_functions.c:337
1210 msgid "l (latitude)"
1211 msgstr ""
1212
1213 #: examples/hcal/local_functions.c:323
1214 msgid "L (Longitue)"
1215 msgstr ""
1216
1217 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1218 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1219 msgid "L (Longitude)"
1220 msgstr ""
1221
1222 #: examples/hcal/local_functions.c:446
1223 msgid "z (time zone)"
1224 msgstr ""
1225
1226 #: examples/hcal/local_functions.c:466
1227 msgid "z (timezone)"
1228 msgstr ""
1229
1230 #: examples/hcal/local_functions.c:490
1231 msgid "valid longitude parameter missing for given latitude"
1232 msgstr ""
1233
1234 #: examples/hcal/local_functions.c:495
1235 msgid "valid latitude parameter missing for given longitude"
1236 msgstr ""
1237
1238 #: examples/hcal/local_functions.c:533
1239 msgid "time zone value of"
1240 msgstr ""
1241
1242 #: examples/hcal/local_functions.c:534
1243 msgid "is incompatible with a longitude of"
1244 msgstr ""
1245
1246 #: examples/hcal/local_functions.c:534
1247 msgid "degrees"
1248 msgstr ""
1249
1250 #: examples/hcal/local_functions.c:642
1251 msgid ""
1252 "This seems to be to be your first time using this version.\n"
1253 "Please read the new documentation in the man page and config\n"
1254 "file. Attempting to create a config file ..."
1255 msgstr ""
1256
1257 #: examples/hcal/local_functions.c:676
1258 msgid "failure attempting to create config file"
1259 msgstr ""
1260
1261 #: examples/hcal/local_functions.c:680
1262 msgid "config file created"
1263 msgstr ""
1264
1265 #: examples/hcal/local_functions.c:681
1266 msgid "failure closing"
1267 msgstr ""
1268
1269 #: examples/hcal/local_functions.c:701
1270 msgid "memory allocation failure"
1271 msgstr ""
1272
1273 #: examples/hcal/local_functions.c:915
1274 msgid "your custom menu options (from your config file)"
1275 msgstr ""
1276
1277 #: examples/hcal/local_functions.c:921
1278 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1279 msgstr ""
1280
1281 #: examples/hcal/local_functions.c:924
1282 msgid "enter your selection, or <return> to continue"
1283 msgstr ""
1284
1285 #: examples/hcal/local_functions.c:928
1286 msgid "menu selection received was out of bounds"
1287 msgstr ""
0 # translation of libhdate.pot to Russian
1 # This file is distributed under the same license as the libhdate package.
2 # Copyright (C) 2005 Boris Peterberg.
3 # Boris Peterberg, 2005.
4 #
5 #, fuzzy
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: ru\n"
9 "Report-Msgid-Bugs-To: \n"
10 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
11 "PO-Revision-Date: 2005-03-08 22:44-0200\n"
12 "Last-Translator: Boeis Peterberg\n"
13 "Language-Team: Russian\n"
14 "Language: ru\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #: src/hdate_strings.c:186 src/hdate_strings.c:190
20 msgid "translator"
21 msgstr "Борис Петербарг"
22
23 #: src/hdate_strings.c:248
24 msgid "Sunday"
25 msgstr "Воскресенье"
26
27 #: src/hdate_strings.c:248
28 msgid "Monday"
29 msgstr "Понедельник"
30
31 #: src/hdate_strings.c:248
32 msgid "Tuesday"
33 msgstr "Вторник"
34
35 #: src/hdate_strings.c:248
36 msgid "Wednesday"
37 msgstr "Среда"
38
39 #: src/hdate_strings.c:249
40 msgid "Thursday"
41 msgstr "Четверг"
42
43 #: src/hdate_strings.c:249
44 msgid "Friday"
45 msgstr "Пятница"
46
47 #: src/hdate_strings.c:249
48 msgid "Saturday"
49 msgstr "Суботта"
50
51 #: src/hdate_strings.c:251
52 msgid "Sun"
53 msgstr "Вс."
54
55 #: src/hdate_strings.c:251
56 msgid "Mon"
57 msgstr "Пн."
58
59 #: src/hdate_strings.c:251
60 msgid "Tue"
61 msgstr "Вт."
62
63 #: src/hdate_strings.c:251
64 msgid "Wed"
65 msgstr "Ср."
66
67 #: src/hdate_strings.c:251
68 msgid "Thu"
69 msgstr "Чт."
70
71 #: src/hdate_strings.c:252
72 msgid "Fri"
73 msgstr "Пт."
74
75 #: src/hdate_strings.c:252
76 msgid "Sat"
77 msgstr "Сб."
78
79 #: src/hdate_strings.c:265 src/hdate_strings.c:288
80 msgid "none"
81 msgstr "Нет"
82
83 #: src/hdate_strings.c:265 src/hdate_strings.c:288
84 msgid "Bereshit"
85 msgstr ""
86
87 #: src/hdate_strings.c:265 src/hdate_strings.c:288
88 msgid "Noach"
89 msgstr "Ноах"
90
91 #: src/hdate_strings.c:266 src/hdate_strings.c:289
92 msgid "Lech-Lecha"
93 msgstr ""
94
95 #: src/hdate_strings.c:266 src/hdate_strings.c:289
96 msgid "Vayera"
97 msgstr ""
98
99 #: src/hdate_strings.c:266 src/hdate_strings.c:289
100 msgid "Chayei Sara"
101 msgstr "Жизнь Сары"
102
103 #: src/hdate_strings.c:267 src/hdate_strings.c:290
104 msgid "Toldot"
105 msgstr ""
106
107 #: src/hdate_strings.c:267 src/hdate_strings.c:290
108 msgid "Vayetzei"
109 msgstr ""
110
111 #: src/hdate_strings.c:267 src/hdate_strings.c:290
112 msgid "Vayishlach"
113 msgstr ""
114
115 #: src/hdate_strings.c:268 src/hdate_strings.c:291
116 msgid "Vayeshev"
117 msgstr ""
118
119 #: src/hdate_strings.c:268 src/hdate_strings.c:291
120 msgid "Miketz"
121 msgstr ""
122
123 #: src/hdate_strings.c:268 src/hdate_strings.c:291
124 msgid "Vayigash"
125 msgstr ""
126
127 #: src/hdate_strings.c:269 src/hdate_strings.c:292
128 msgid "Vayechi"
129 msgstr ""
130
131 #: src/hdate_strings.c:269 src/hdate_strings.c:292
132 msgid "Shemot"
133 msgstr ""
134
135 #: src/hdate_strings.c:269 src/hdate_strings.c:292
136 msgid "Vaera"
137 msgstr ""
138
139 #: src/hdate_strings.c:270 src/hdate_strings.c:293
140 msgid "Bo"
141 msgstr ""
142
143 #: src/hdate_strings.c:270 src/hdate_strings.c:293
144 msgid "Beshalach"
145 msgstr ""
146
147 #: src/hdate_strings.c:270 src/hdate_strings.c:293
148 msgid "Yitro"
149 msgstr ""
150
151 #: src/hdate_strings.c:271 src/hdate_strings.c:294
152 msgid "Mishpatim"
153 msgstr ""
154
155 #: src/hdate_strings.c:271 src/hdate_strings.c:294
156 msgid "Terumah"
157 msgstr ""
158
159 #: src/hdate_strings.c:271 src/hdate_strings.c:294
160 msgid "Tetzaveh"
161 msgstr ""
162
163 #: src/hdate_strings.c:272 src/hdate_strings.c:295
164 msgid "Ki Tisa"
165 msgstr ""
166
167 #: src/hdate_strings.c:272 src/hdate_strings.c:295
168 msgid "Vayakhel"
169 msgstr ""
170
171 #: src/hdate_strings.c:272 src/hdate_strings.c:295
172 msgid "Pekudei"
173 msgstr ""
174
175 #: src/hdate_strings.c:273 src/hdate_strings.c:296
176 msgid "Vayikra"
177 msgstr ""
178
179 #: src/hdate_strings.c:273 src/hdate_strings.c:296
180 msgid "Tzav"
181 msgstr ""
182
183 #: src/hdate_strings.c:273 src/hdate_strings.c:296
184 msgid "Shmini"
185 msgstr ""
186
187 #: src/hdate_strings.c:274 src/hdate_strings.c:297
188 msgid "Tazria"
189 msgstr ""
190
191 #: src/hdate_strings.c:274 src/hdate_strings.c:297
192 msgid "Metzora"
193 msgstr ""
194
195 #: src/hdate_strings.c:274 src/hdate_strings.c:297
196 msgid "Achrei Mot"
197 msgstr ""
198
199 #: src/hdate_strings.c:275 src/hdate_strings.c:298
200 msgid "Kedoshim"
201 msgstr ""
202
203 #: src/hdate_strings.c:275 src/hdate_strings.c:298
204 msgid "Emor"
205 msgstr ""
206
207 #: src/hdate_strings.c:275 src/hdate_strings.c:298
208 msgid "Behar"
209 msgstr ""
210
211 #: src/hdate_strings.c:276 src/hdate_strings.c:299
212 msgid "Bechukotai"
213 msgstr ""
214
215 #: src/hdate_strings.c:276 src/hdate_strings.c:299
216 msgid "Bamidbar"
217 msgstr ""
218
219 #: src/hdate_strings.c:276 src/hdate_strings.c:299
220 msgid "Nasso"
221 msgstr ""
222
223 #: src/hdate_strings.c:277 src/hdate_strings.c:300
224 msgid "Beha'alotcha"
225 msgstr ""
226
227 #: src/hdate_strings.c:277 src/hdate_strings.c:300
228 msgid "Sh'lach"
229 msgstr ""
230
231 #: src/hdate_strings.c:277 src/hdate_strings.c:300
232 msgid "Korach"
233 msgstr ""
234
235 #: src/hdate_strings.c:278 src/hdate_strings.c:301
236 msgid "Chukat"
237 msgstr ""
238
239 #: src/hdate_strings.c:278 src/hdate_strings.c:301
240 msgid "Balak"
241 msgstr ""
242
243 #: src/hdate_strings.c:278 src/hdate_strings.c:301
244 msgid "Pinchas"
245 msgstr ""
246
247 #: src/hdate_strings.c:279 src/hdate_strings.c:302
248 msgid "Matot"
249 msgstr ""
250
251 #: src/hdate_strings.c:279 src/hdate_strings.c:302
252 msgid "Masei"
253 msgstr ""
254
255 #: src/hdate_strings.c:279 src/hdate_strings.c:302
256 msgid "Devarim"
257 msgstr ""
258
259 #: src/hdate_strings.c:280 src/hdate_strings.c:303
260 msgid "Vaetchanan"
261 msgstr ""
262
263 #: src/hdate_strings.c:280 src/hdate_strings.c:303
264 msgid "Eikev"
265 msgstr ""
266
267 #: src/hdate_strings.c:280 src/hdate_strings.c:303
268 msgid "Re'eh"
269 msgstr ""
270
271 #: src/hdate_strings.c:281 src/hdate_strings.c:304
272 msgid "Shoftim"
273 msgstr ""
274
275 #: src/hdate_strings.c:281 src/hdate_strings.c:304
276 msgid "Ki Teitzei"
277 msgstr ""
278
279 #: src/hdate_strings.c:281 src/hdate_strings.c:304
280 msgid "Ki Tavo"
281 msgstr ""
282
283 #: src/hdate_strings.c:282 src/hdate_strings.c:305
284 msgid "Nitzavim"
285 msgstr ""
286
287 #: src/hdate_strings.c:282 src/hdate_strings.c:305
288 msgid "Vayeilech"
289 msgstr ""
290
291 #: src/hdate_strings.c:282 src/hdate_strings.c:305
292 msgid "Ha'Azinu"
293 msgstr ""
294
295 #: src/hdate_strings.c:283 src/hdate_strings.c:306
296 msgid "Vezot Habracha"
297 msgstr ""
298
299 #: src/hdate_strings.c:284 src/hdate_strings.c:307
300 msgid "Vayakhel-Pekudei"
301 msgstr ""
302
303 #: src/hdate_strings.c:284 src/hdate_strings.c:307
304 msgid "Tazria-Metzora"
305 msgstr ""
306
307 #: src/hdate_strings.c:284 src/hdate_strings.c:307
308 msgid "Achrei Mot-Kedoshim"
309 msgstr ""
310
311 #: src/hdate_strings.c:285 src/hdate_strings.c:308
312 msgid "Behar-Bechukotai"
313 msgstr ""
314
315 #: src/hdate_strings.c:285 src/hdate_strings.c:308
316 msgid "Chukat-Balak"
317 msgstr ""
318
319 #: src/hdate_strings.c:285 src/hdate_strings.c:308
320 msgid "Matot-Masei"
321 msgstr ""
322
323 #: src/hdate_strings.c:286 src/hdate_strings.c:309
324 msgid "Nitzavim-Vayeilech"
325 msgstr ""
326
327 #: src/hdate_strings.c:364 src/hdate_strings.c:369
328 msgid "Tishrei"
329 msgstr "Тишрэй"
330
331 #: src/hdate_strings.c:364 src/hdate_strings.c:369
332 msgid "Cheshvan"
333 msgstr "Хешван"
334
335 #: src/hdate_strings.c:364 src/hdate_strings.c:369
336 msgid "Kislev"
337 msgstr "Кислэв"
338
339 #: src/hdate_strings.c:364 src/hdate_strings.c:369
340 msgid "Tevet"
341 msgstr "Тэвэт"
342
343 #: src/hdate_strings.c:365 src/hdate_strings.c:370
344 msgid "Sh'vat"
345 msgstr "Шват"
346
347 #: src/hdate_strings.c:365 src/hdate_strings.c:370
348 msgid "Adar"
349 msgstr "Адар"
350
351 #: src/hdate_strings.c:365 src/hdate_strings.c:370
352 msgid "Nisan"
353 msgstr "Нисан"
354
355 #: src/hdate_strings.c:365 src/hdate_strings.c:370
356 msgid "Iyyar"
357 msgstr "Ийар"
358
359 #: src/hdate_strings.c:366 src/hdate_strings.c:371
360 msgid "Sivan"
361 msgstr "Сиван"
362
363 #: src/hdate_strings.c:366 src/hdate_strings.c:371
364 #, fuzzy
365 msgid "Tammuz"
366 msgstr "17 Тамуза"
367
368 #: src/hdate_strings.c:366 src/hdate_strings.c:371
369 msgid "Av"
370 msgstr "Ав"
371
372 #: src/hdate_strings.c:366 src/hdate_strings.c:371
373 msgid "Elul"
374 msgstr "Элул"
375
376 #: src/hdate_strings.c:366 src/hdate_strings.c:371
377 msgid "Adar I"
378 msgstr "Адар 1"
379
380 #: src/hdate_strings.c:367 src/hdate_strings.c:372
381 msgid "Adar II"
382 msgstr "Адар 2"
383
384 #: src/hdate_strings.c:384
385 msgid "January"
386 msgstr "Январь"
387
388 #: src/hdate_strings.c:384
389 msgid "February"
390 msgstr "Февраль"
391
392 #: src/hdate_strings.c:384
393 msgid "March"
394 msgstr "Март"
395
396 #: src/hdate_strings.c:385
397 msgid "April"
398 msgstr "Апрель"
399
400 #: src/hdate_strings.c:385 src/hdate_strings.c:388
401 msgid "May"
402 msgstr "Май"
403
404 #: src/hdate_strings.c:385
405 msgid "June"
406 msgstr "Июнь"
407
408 #: src/hdate_strings.c:386
409 msgid "July"
410 msgstr "Июль"
411
412 #: src/hdate_strings.c:386
413 msgid "August"
414 msgstr "Август"
415
416 #: src/hdate_strings.c:386
417 msgid "September"
418 msgstr "Сентябрь"
419
420 #: src/hdate_strings.c:387
421 msgid "October"
422 msgstr "Октябрь"
423
424 #: src/hdate_strings.c:387
425 msgid "November"
426 msgstr "Ноябрь"
427
428 #: src/hdate_strings.c:387
429 msgid "December"
430 msgstr "Декабрь"
431
432 #: src/hdate_strings.c:388
433 msgid "Jan"
434 msgstr "Янв"
435
436 #: src/hdate_strings.c:388
437 msgid "Feb"
438 msgstr "Фев"
439
440 #: src/hdate_strings.c:388
441 msgid "Mar"
442 msgstr "Мар"
443
444 #: src/hdate_strings.c:388
445 msgid "Apr"
446 msgstr "Апр"
447
448 #: src/hdate_strings.c:389
449 msgid "Jun"
450 msgstr "Июнь"
451
452 #: src/hdate_strings.c:389
453 msgid "Jul"
454 msgstr "Июль"
455
456 #: src/hdate_strings.c:389
457 msgid "Aug"
458 msgstr "Авг"
459
460 #: src/hdate_strings.c:389
461 msgid "Sep"
462 msgstr "Сен"
463
464 #: src/hdate_strings.c:389
465 msgid "Oct"
466 msgstr "Окт"
467
468 #: src/hdate_strings.c:390
469 msgid "Nov"
470 msgstr "Но"
471
472 #: src/hdate_strings.c:390
473 msgid "Dec"
474 msgstr "Дек"
475
476 #: src/hdate_strings.c:396 src/hdate_strings.c:416
477 msgid "Rosh Hashana I"
478 msgstr "Рош-а-Шана I"
479
480 #: src/hdate_strings.c:396 src/hdate_strings.c:416
481 msgid "Rosh Hashana II"
482 msgstr "Рош-а-Шана II"
483
484 #: src/hdate_strings.c:397 src/hdate_strings.c:417
485 msgid "Tzom Gedaliah"
486 msgstr "Цом гдаляа"
487
488 #: src/hdate_strings.c:397 src/hdate_strings.c:417
489 msgid "Yom Kippur"
490 msgstr "Йом Кипур"
491
492 #: src/hdate_strings.c:398 src/hdate_strings.c:418
493 msgid "Sukkot"
494 msgstr "Суккот I"
495
496 #: src/hdate_strings.c:398 src/hdate_strings.c:418
497 msgid "Hol hamoed Sukkot"
498 msgstr "Суккот"
499
500 #: src/hdate_strings.c:399 src/hdate_strings.c:419
501 msgid "Hoshana raba"
502 msgstr "hoшана Раба"
503
504 #: src/hdate_strings.c:399 src/hdate_strings.c:419
505 msgid "Simchat Torah"
506 msgstr "Симхат-Тора"
507
508 #: src/hdate_strings.c:400 src/hdate_strings.c:420
509 msgid "Chanukah"
510 msgstr "Ханука"
511
512 #: src/hdate_strings.c:400 src/hdate_strings.c:420
513 msgid "Asara B'Tevet"
514 msgstr "Десятое Тевета"
515
516 #: src/hdate_strings.c:401 src/hdate_strings.c:421
517 msgid "Tu B'Shvat"
518 msgstr "Ту би-Шват"
519
520 #: src/hdate_strings.c:401 src/hdate_strings.c:421
521 msgid "Ta'anit Esther"
522 msgstr "Танйт зстер"
523
524 #: src/hdate_strings.c:402 src/hdate_strings.c:422
525 msgid "Purim"
526 msgstr "Пурим"
527
528 #: src/hdate_strings.c:402 src/hdate_strings.c:422
529 msgid "Shushan Purim"
530 msgstr "Ш. Пурим"
531
532 #: src/hdate_strings.c:403 src/hdate_strings.c:423
533 msgid "Pesach"
534 msgstr "Пэсах I"
535
536 #: src/hdate_strings.c:403 src/hdate_strings.c:423
537 msgid "Hol hamoed Pesach"
538 msgstr "Песах"
539
540 #: src/hdate_strings.c:404 src/hdate_strings.c:424
541 msgid "Yom HaAtzma'ut"
542 msgstr "День Независимости"
543
544 #: src/hdate_strings.c:404 src/hdate_strings.c:424
545 msgid "Lag B'Omer"
546 msgstr "Лаг ба-Омер"
547
548 #: src/hdate_strings.c:405 src/hdate_strings.c:425
549 msgid "Erev Shavuot"
550 msgstr ""
551
552 #: src/hdate_strings.c:405 src/hdate_strings.c:425
553 msgid "Shavuot"
554 msgstr "Шавуот"
555
556 #: src/hdate_strings.c:406 src/hdate_strings.c:426
557 msgid "Tzom Tammuz"
558 msgstr "17 Тамуза"
559
560 #: src/hdate_strings.c:406 src/hdate_strings.c:426
561 msgid "Tish'a B'Av"
562 msgstr "9 Ава"
563
564 #: src/hdate_strings.c:407 src/hdate_strings.c:427
565 msgid "Tu B'Av"
566 msgstr "15-ое Ава"
567
568 #: src/hdate_strings.c:407 src/hdate_strings.c:427
569 msgid "Yom HaShoah"
570 msgstr "День Холокоста"
571
572 #: src/hdate_strings.c:408 src/hdate_strings.c:428
573 msgid "Yom HaZikaron"
574 msgstr "День Памяти"
575
576 #: src/hdate_strings.c:408 src/hdate_strings.c:428
577 msgid "Yom Yerushalayim"
578 msgstr "День Йерусалима"
579
580 #: src/hdate_strings.c:409 src/hdate_strings.c:429
581 msgid "Shmini Atzeret"
582 msgstr "Шмини-Ацерет"
583
584 #: src/hdate_strings.c:409 src/hdate_strings.c:429
585 msgid "Pesach VII"
586 msgstr "Песах VII"
587
588 #: src/hdate_strings.c:410 src/hdate_strings.c:430
589 msgid "Pesach VIII"
590 msgstr "Песах VIII"
591
592 #: src/hdate_strings.c:410 src/hdate_strings.c:430
593 msgid "Shavuot II"
594 msgstr "Шавуот II"
595
596 #: src/hdate_strings.c:411 src/hdate_strings.c:431
597 #, fuzzy
598 msgid "Sukkot II"
599 msgstr "Суккот II"
600
601 #: src/hdate_strings.c:411 src/hdate_strings.c:431
602 #, fuzzy
603 msgid "Pesach II"
604 msgstr "Песах II"
605
606 #: src/hdate_strings.c:412 src/hdate_strings.c:432
607 msgid "Family Day"
608 msgstr ""
609
610 #: src/hdate_strings.c:412 src/hdate_strings.c:432
611 msgid "Memorial day for fallen whose place of burial is unknown"
612 msgstr ""
613
614 #: src/hdate_strings.c:413
615 msgid "Yitzhak Rabin memorial day"
616 msgstr ""
617
618 #: src/hdate_strings.c:413
619 msgid "Zeev Zhabotinsky day"
620 msgstr ""
621
622 #: src/hdate_strings.c:414 src/hdate_strings.c:434
623 msgid "Erev Yom Kippur"
624 msgstr ""
625
626 #: src/hdate_strings.c:433
627 msgid "Rabin memorial day"
628 msgstr ""
629
630 #: src/hdate_strings.c:433
631 msgid "Zhabotinsky day"
632 msgstr ""
633
634 #: src/hdate_strings.c:514
635 msgid "in the Omer"
636 msgstr ""
637
638 #: examples/hcal/hcal.c:142
639 msgid ""
640 "# configuration file for hcal - Hebrew calendar program\n"
641 "# part of package libhdate\n"
642 "#\n"
643 "# Should you mangle this file and wish to restore its default content,\n"
644 "# rename or delete this file and run hcal; hcal will automatically\n"
645 "# regenerate the default content.\n"
646 "#\n"
647 "# Your system administrator can set system-wide defaults for hcal by\n"
648 "# modifying file <not yet implemented>.\n"
649 "# You may override all defaults by changing the contents of this file.\n"
650 "#\n"
651 "# Version information\n"
652 "# This may be used by updates to hcal to determine how to parse the file\n"
653 "# and whether additional information and options should be appended to\n"
654 "# the end of this file.\n"
655 "VERSION=2.00\n"
656 "# Location awareness\n"
657 "# hcal wants to accurately highlight the current Hebrew day, including\n"
658 "# during the hours between sunset and secular midnight. If you don't\n"
659 "# provide it with latitude, longitude, and time zone information, hcal\n"
660 "# will try to guess the information, based upon your system timezone,\n"
661 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
662 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
663 "# with a message that includes the guessed location.\n"
664 "# hcal's guesses will also affect its default behaviour for ouput of\n"
665 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
666 "#SUNSET_AWARE=TRUE\n"
667 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
668 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
669 "# delimiters. Use negative values to indicate South and West, or\n"
670 "# use the abbreviated compass directions N, S, E, W.\n"
671 "#LATITUDE=\n"
672 "#LONGITUDE=\n"
673 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
674 "# with the characters :'\" as possible delimiters.\n"
675 "#TIMEZONE=\n"
676 "\n"
677 "# Israel and the diaspora\n"
678 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
679 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
680 "# forces hcal to display calendar information for Israel, using hcal's\n"
681 "# default coordinates foe Israel, or coordinates that you provide that\n"
682 "# seem legitmately within Israel.\n"
683 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
684 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
685 "# a non-resident vistor to Israel. The command line options for these\n"
686 "# features are --israel, -I, --diaspora, -d.\n"
687 "#FORCE_DIASPORA=FALSE;\n"
688 "#FORCE_ISRAEL=FALSE;\n"
689 "\n"
690 "# Shabbat related\n"
691 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
692 "# The command line options for these features are -p (--parasha), and\n"
693 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
694 "(minutes\n"
695 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
696 "# (minutes after sunset).\n"
697 "#PARASHA_NAMES=FALSE\n"
698 "#SHABBAT_INFO=FALSE\n"
699 "#CANDLE_LIGHTING=FALSE\n"
700 "#HAVDALAH=FALSE\n"
701 "\n"
702 "# Holiday identification\n"
703 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
704 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
705 "# will have hcal output after the month's calendar, a list of the month's\n"
706 "# holidays along with the days on which they occur.\n"
707 "#FOOTNOTE=FALSE\n"
708 "\n"
709 "# Output in hebrew characters\n"
710 "# hcal defaults to output all information in your default language, so\n"
711 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
712 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
713 "# still outputting gregorian information in your default language. To\n"
714 "# output ALL information in Hebrew, run something like this:\n"
715 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
716 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
717 "# output, you need to install a terminal font that includes the Hebrew\n"
718 "# character set (hint: unicode).\n"
719 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
720 "#FORCE_HEBREW=FALSE\n"
721 "\n"
722 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
723 "# Unfortunately, the world can not be depended upon to be either. Most\n"
724 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
725 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
726 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
727 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
728 "# This will reverse the order of the Hebrew characters, so they will\n"
729 "# display 'visual'ly correct; however, such output will not be suitable\n"
730 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
731 "# automatically forces hebrew.\n"
732 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
733 "#OUTPUT_BIDI=FALSE\n"
734 "\n"
735 "# Display enhancements\n"
736 "# hcal defaults to display the current day in reverse video\n"
737 "# The command line option for this feature is --no-reverse\n"
738 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
739 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
740 "# colorized output may yield unexpected results.\n"
741 "#COLORIZE=FALSE\n"
742 "\n"
743 "# HTML OUTPUT\n"
744 "#OUTPUT_HTML=FALSE\n"
745 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
746 "\n"
747 "# Suppress alerts and warnings\n"
748 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
749 "#QUIET_ALERTS=FALSE\n"
750 "\n"
751 "# Three month display\n"
752 "# hcal can display a previous, current and next month side-by-side. hcal\n"
753 "# can also display a calendar for an entire year in four rows of three\n"
754 "# months each. Note that this will display properly only if your console\n"
755 "# is set for at least 127 columns. Note also that setting this option to\n"
756 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
757 "#THREE_MONTH=FALSE\n"
758 "\n"
759 "# User-defined menus\n"
760 "# You may specify here command-line strings to optionally be parsed\n"
761 "# by hcal at execution time. To do so, use the command line option -m\n"
762 "# (--menu). hcal will process first the settings of this config file,\n"
763 "# then the other settings of your command line, and then will prompt\n"
764 "# you for which menu item you would like to select. hcal will process\n"
765 "# your menu selection as if it were a new command line, further modifying\n"
766 "# all the prior settings.\n"
767 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
768 "# truncated at one hundred characters\n"
769 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
770 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
771 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
772 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
773 msgstr ""
774
775 #: examples/hcal/hcal.c:271
776 msgid ""
777 "hcal - Hebrew calendar\n"
778 "version 1.6"
779 msgstr ""
780
781 #: examples/hcal/hcal.c:281
782 msgid ""
783 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
784 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
785 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
786 " timezone: -z nn[( .nn | :mm )]\n"
787 "Try 'hcal --help' for more information"
788 msgstr ""
789
790 #: examples/hcal/hcal.c:295
791 msgid ""
792 "Hebrew calendar\n"
793 "OPTIONS:\n"
794 " -1 --one-month over-ride config file setting if you had set\n"
795 " option --three-month as a default there\n"
796 " -3 --three-month displays previous/next months\n"
797 " side by side. requires 127 columns\n"
798 " -b --bidi prints hebrew in reverse (visual)\n"
799 " --visual\n"
800 " --no-bidi over-ride config file setting if you had set\n"
801 " --no-visual option -bidi as a default there\n"
802 " -c --colorize displays in calming, muted tones\n"
803 " --no-color over-ride a --colorize setting in your config file\n"
804 " -d --diaspora use diaspora reading and holidays.\n"
805 " -f --footnote print descriptive notes of holidays\n"
806 " --no-footnote over-ride a footnote setting in your config file\n"
807 " -h --html output in html format to stdout\n"
808 " -H --hebrew print hebrew information in Hebrew\n"
809 " -i use external css file \"./hcal.css\".\n"
810 " -I --israel override a diaspora default\n"
811 " --no-reverse do not highlight today's date\n"
812 " -m --menu prompt user-defined menu from config file\n"
813 " -p --parasha print week's parasha on each calendar row\n"
814 " -q --quiet-alerts suppress warning messages\n"
815 " -s --shabbat print Shabbat times and parshiot\n"
816 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
817 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
818 " -z --timezone nn timezone, +/-UTC\n"
819 " -l --latitude yy latitude yy degrees. Negative values are South\n"
820 " -L --longitude xx longitude xx degrees. Negative values are West\n"
821 "\n"
822 "All options can be made default in the config file, or menu-ized for\n"
823 "easy selection."
824 msgstr ""
825
826 #: examples/hcal/hcal.c:1877
827 msgid ""
828 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
829 "month' mode"
830 msgstr ""
831
832 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
833 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
834 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
835 msgid "error"
836 msgstr ""
837
838 #: examples/hcal/hcal.c:1949
839 msgid "too many parameters received. expected [[mm] [yyyy]"
840 msgstr ""
841
842 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
843 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
844 msgid "year"
845 msgstr ""
846
847 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
848 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
849 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
850 #: examples/hcal/hdate.c:2132
851 msgid "month"
852 msgstr ""
853
854 #: examples/hcal/hdate.c:42
855 msgid "sunrise"
856 msgstr ""
857
858 #: examples/hcal/hdate.c:43
859 msgid "sunset"
860 msgstr ""
861
862 #: examples/hcal/hdate.c:44
863 msgid "first_light"
864 msgstr ""
865
866 #: examples/hcal/hdate.c:45
867 msgid "talit"
868 msgstr ""
869
870 #: examples/hcal/hdate.c:46
871 msgid "midday"
872 msgstr ""
873
874 #: examples/hcal/hdate.c:47
875 msgid "first_stars"
876 msgstr ""
877
878 #: examples/hcal/hdate.c:48
879 msgid "three_stars"
880 msgstr ""
881
882 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
883 msgid "sun_hour"
884 msgstr ""
885
886 #: examples/hcal/hdate.c:50
887 msgid "candle-lighting"
888 msgstr ""
889
890 #: examples/hcal/hdate.c:51
891 msgid "havdalah"
892 msgstr ""
893
894 #: examples/hcal/hdate.c:81
895 msgid ""
896 "# configuration file for hdate - Hebrew date information program\n"
897 "# part of package libhdate\n"
898 "#\n"
899 "# Should you mangle this file and wish to restore its default content,\n"
900 "# rename or delete this file and run hdate; hdate will automatically\n"
901 "# regenerate the default content.\n"
902 "#\n"
903 "# Your system administrator can set system-wide defaults for hcal by\n"
904 "# modifying file <not yet implemented>.\n"
905 "# You may override all defaults by changing the contents of this file.\n"
906 "#\n"
907 "# Version information\n"
908 "# This may be used by updates to hcal to determine how to parse the file\n"
909 "# and whether additional information and options should be appended to\n"
910 "# the end of this file.\n"
911 "VERSION=2.00\n"
912 "#\n"
913 "# Location awareness\n"
914 "# hdate wants to accurately highlight the current Hebrew day, including\n"
915 "# during the hours between sunset and secular midnight. If you don't\n"
916 "# provide it with latitude, longitude, and time zone information, hdate\n"
917 "# will try to guess the information, based upon your system timezone,\n"
918 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
919 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
920 "# with a message that includes the guessed location.\n"
921 "# hdate's guesses will also affect its default behaviour for ouput of\n"
922 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
923 "#SUNSET_AWARE=TRUE\n"
924 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
925 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
926 "# delimiters. Use negative values to indicate South and West, or\n"
927 "# use the abbreviated compass directions N, S, E, W.\n"
928 "#LATITUDE=\n"
929 "#LONGITUDE=\n"
930 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
931 "# with the characters :'\" as possible delimiters.\n"
932 "#TIMEZONE=\n"
933 "\n"
934 "# Output in hebrew characters\n"
935 "# hdate defaults to output all information in your default language, so\n"
936 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
937 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
938 "# still outputting gregorian information in your default language. To\n"
939 "# output ALL information in Hebrew, run something like this:\n"
940 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
941 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
942 "# output, you need to install a terminal font that includes the Hebrew\n"
943 "# character set (hint: unicode).\n"
944 "#FORCE_HEBREW=FALSE\n"
945 "\n"
946 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
947 "# Unfortunately, the world can not be depended upon to be either. Most\n"
948 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
949 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
950 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
951 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
952 "# This will reverse the order of the Hebrew characters, so they will\n"
953 "# display 'visual'ly correct; however, such output will not be suitable\n"
954 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
955 "# automatically forces hebrew.\n"
956 "#OUTPUT_BIDI=FALSE\n"
957 "\n"
958 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
959 "# in the following ways:\n"
960 "# option YOM ~> yom shishi, aleph tishrei ...\n"
961 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
962 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
963 "#YOM=FALSE\n"
964 "#LESHABBAT=FALSE\n"
965 "#LESEDER=FALSE\n"
966 "\n"
967 "#SUN_RISE_SET=FALSE\n"
968 "#TIMES_OF_DAY=FALSE\n"
969 "#SHORT_FORMAT=FALSE\n"
970 "#SEFIRAT_HAOMER=FALSE\n"
971 "#DIASPORA=FALSE\n"
972 "\n"
973 "\n"
974 "# Shabbat related\n"
975 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
976 "# The command line options for these features are -r (--parasha), and\n"
977 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
978 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
979 "# (minutes after sunset).\n"
980 "#PARASHA_NAMES=FALSE\n"
981 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
982 "#SHABBAT_INFO=FALSE\n"
983 "\n"
984 "#CANDLE_LIGHTING=FALSE\n"
985 "#HAVDALAH=FALSE\n"
986 "\n"
987 "# Holiday related\n"
988 "#HOLIDAYS=FALSE\n"
989 "#ONLY_IF_HOLIDAY=FALSE\n"
990 "\n"
991 "# Tabular output\n"
992 "# This option has hdate output the information you request in a single\n"
993 "# comma-delimited line per day, suitable for piping or import to\n"
994 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
995 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
996 "# The command line option for this feature is, um, --table\n"
997 "#TABULAR=FALSE\n"
998 "\n"
999 "# iCal format\n"
1000 "# hdate can output its information in iCal-compatable format\n"
1001 "# ICAL=FALSE\n"
1002 "# Suppress alerts and warnings\n"
1003 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1004 "#QUIET_ALERTS=FALSE\n"
1005 "\n"
1006 "# Julian day number\n"
1007 "# The Julian day number is a .... See ... for more details.\n"
1008 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1009 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1010 "#JULIAN_DAY=FALSE\n"
1011 "\n"
1012 "# User-defined menus\n"
1013 "# You may specify here command-line strings to optionally be parsed\n"
1014 "# by hcal at execution time. To do so, use the command line option -m\n"
1015 "# (--menu). hcal will process first the settings of this config file,\n"
1016 "# then the other settings of your command line, and then will prompt\n"
1017 "# you for which menu item you would like to select. hcal will process\n"
1018 "# your menu selection as if it were a new command line, further modifying\n"
1019 "# all the prior settings.\n"
1020 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1021 "# truncated at one hundred characters\n"
1022 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1023 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1024 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1025 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1026 msgstr ""
1027
1028 #: examples/hcal/hdate.c:209
1029 msgid ""
1030 "hdate - display Hebrew date information\n"
1031 "version 1.6"
1032 msgstr ""
1033
1034 #: examples/hcal/hdate.c:219
1035 msgid ""
1036 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1037 " hdate [options] [coordinates timezone] [julian_day]\n"
1038 "\n"
1039 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1040 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1041 " timezone: -z nn[( .nn | :mm )]\n"
1042 "Try 'hdate --help' for more information"
1043 msgstr ""
1044
1045 #: examples/hcal/hdate.c:235
1046 msgid ""
1047 "hdate - display Hebrew date information\n"
1048 "OPTIONS:\n"
1049 " -b --bidi prints hebrew in reverse (visual)\n"
1050 " --visual\n"
1051 " -c print Shabbat start/end times.\n"
1052 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1053 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1054 " -d --diaspora use diaspora reading and holidays.\n"
1055 " -h --holidays print holidays.\n"
1056 " -H print only it is a holiday.\n"
1057 " -i --ical use iCal formated output.\n"
1058 " -j --julian print Julian day number.\n"
1059 " -m --menu prompt user-defined menu from config file\n"
1060 " -o --omer print Sefirat Haomer.\n"
1061 " -q --quiet-alerts suppress warning messages\n"
1062 " -r --parasha print weekly reading on saturday.\n"
1063 " -R print only if there is a weekly reading on Shabbat.\n"
1064 " -s --sun print sunrise/sunset times.\n"
1065 " -S --short-format print using short format.\n"
1066 " -t print day times: first light, talit, sunrise,\n"
1067 " midday, sunset, first stars, three stars.\n"
1068 " -T --table tabular output, suitable for spreadsheets\n"
1069 "\n"
1070 " -z --timezone nn timezone, +/-UTC\n"
1071 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1072 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1073 "\n"
1074 " --hebrew forces Hebrew to print in Hebrew characters\n"
1075 " --yom force Hebrew prefix to Hebrew day of week\n"
1076 " --leshabbat insert parasha between day of week and day\n"
1077 " --leseder insert parasha between day of week and day\n"
1078 " --not-sunset-aware don't display next day if after sunset\n"
1079 "\n"
1080 "All options can be made default in the config file, or menu-ized for\n"
1081 "easy selection."
1082 msgstr ""
1083
1084 #: examples/hcal/hdate.c:274
1085 msgid ""
1086 "ALERT: The information displayed is for today's Hebrew date.\n"
1087 " Because it is now after sunset, that means the data is\n"
1088 " for the Gregorian day beginning at midnight."
1089 msgstr ""
1090
1091 #: examples/hcal/hdate.c:405
1092 msgid "eve of "
1093 msgstr ""
1094
1095 #: examples/hcal/hdate.c:669
1096 msgid "today is day"
1097 msgstr ""
1098
1099 #: examples/hcal/hdate.c:743
1100 msgid "Gregorian date"
1101 msgstr ""
1102
1103 #: examples/hcal/hdate.c:743
1104 msgid "Hebrew Date"
1105 msgstr ""
1106
1107 #: examples/hcal/hdate.c:748
1108 #, fuzzy
1109 msgid "holiday"
1110 msgstr "Пятница"
1111
1112 #: examples/hcal/hdate.c:749
1113 msgid "omer count"
1114 msgstr ""
1115
1116 #: examples/hcal/hdate.c:750
1117 msgid "parashat"
1118 msgstr ""
1119
1120 #: examples/hcal/hdate.c:1016
1121 msgid "Parashat"
1122 msgstr ""
1123
1124 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1125 #, fuzzy
1126 msgid "day"
1127 msgstr "Май"
1128
1129 #: examples/hcal/hdate.c:2168
1130 msgid "too many arguments; after options max is dd mm yyyy"
1131 msgstr ""
1132
1133 #: examples/hcal/local_functions.c:97
1134 msgid "parameter"
1135 msgstr ""
1136
1137 #: examples/hcal/local_functions.c:98
1138 msgid "is non-numeric or out of bounds"
1139 msgstr ""
1140
1141 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1142 msgid "option"
1143 msgstr ""
1144
1145 #: examples/hcal/local_functions.c:104
1146 msgid "missing parameter"
1147 msgstr ""
1148
1149 #: examples/hcal/local_functions.c:110
1150 msgid "ALERT: time zone not entered, using system local time zone"
1151 msgstr ""
1152
1153 #: examples/hcal/local_functions.c:117
1154 msgid "is not a valid option"
1155 msgstr ""
1156
1157 #: examples/hcal/local_functions.c:134
1158 msgid "ALERT: guessing... will use co-ordinates for"
1159 msgstr ""
1160
1161 #: examples/hcal/local_functions.c:142
1162 msgid "Los Angeles"
1163 msgstr ""
1164
1165 #: examples/hcal/local_functions.c:143
1166 msgid "Mexico City"
1167 msgstr ""
1168
1169 #: examples/hcal/local_functions.c:144
1170 msgid "New York City"
1171 msgstr ""
1172
1173 #: examples/hcal/local_functions.c:147
1174 msgid "Buenos Aires"
1175 msgstr ""
1176
1177 #: examples/hcal/local_functions.c:148
1178 msgid "London"
1179 msgstr ""
1180
1181 #: examples/hcal/local_functions.c:149
1182 msgid "Paris"
1183 msgstr ""
1184
1185 #: examples/hcal/local_functions.c:150
1186 msgid "Tel-Aviv"
1187 msgstr ""
1188
1189 #: examples/hcal/local_functions.c:151
1190 msgid "Moscow"
1191 msgstr ""
1192
1193 #: examples/hcal/local_functions.c:152
1194 msgid "Tashkent"
1195 msgstr ""
1196
1197 #: examples/hcal/local_functions.c:153
1198 msgid "Beijing"
1199 msgstr ""
1200
1201 #: examples/hcal/local_functions.c:155
1202 msgid "Honolulu"
1203 msgstr ""
1204
1205 #: examples/hcal/local_functions.c:156
1206 msgid "Hmmm, ... hate to do this, really ..."
1207 msgstr ""
1208
1209 #: examples/hcal/local_functions.c:156
1210 msgid "using co-ordinates for the equator, at the center of time zone"
1211 msgstr ""
1212
1213 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1214 #: examples/hcal/local_functions.c:337
1215 msgid "l (latitude)"
1216 msgstr ""
1217
1218 #: examples/hcal/local_functions.c:323
1219 msgid "L (Longitue)"
1220 msgstr ""
1221
1222 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1223 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1224 msgid "L (Longitude)"
1225 msgstr ""
1226
1227 #: examples/hcal/local_functions.c:446
1228 msgid "z (time zone)"
1229 msgstr ""
1230
1231 #: examples/hcal/local_functions.c:466
1232 msgid "z (timezone)"
1233 msgstr ""
1234
1235 #: examples/hcal/local_functions.c:490
1236 msgid "valid longitude parameter missing for given latitude"
1237 msgstr ""
1238
1239 #: examples/hcal/local_functions.c:495
1240 msgid "valid latitude parameter missing for given longitude"
1241 msgstr ""
1242
1243 #: examples/hcal/local_functions.c:533
1244 msgid "time zone value of"
1245 msgstr ""
1246
1247 #: examples/hcal/local_functions.c:534
1248 msgid "is incompatible with a longitude of"
1249 msgstr ""
1250
1251 #: examples/hcal/local_functions.c:534
1252 msgid "degrees"
1253 msgstr ""
1254
1255 #: examples/hcal/local_functions.c:642
1256 msgid ""
1257 "This seems to be to be your first time using this version.\n"
1258 "Please read the new documentation in the man page and config\n"
1259 "file. Attempting to create a config file ..."
1260 msgstr ""
1261
1262 #: examples/hcal/local_functions.c:676
1263 msgid "failure attempting to create config file"
1264 msgstr ""
1265
1266 #: examples/hcal/local_functions.c:680
1267 msgid "config file created"
1268 msgstr ""
1269
1270 #: examples/hcal/local_functions.c:681
1271 msgid "failure closing"
1272 msgstr ""
1273
1274 #: examples/hcal/local_functions.c:701
1275 msgid "memory allocation failure"
1276 msgstr ""
1277
1278 #: examples/hcal/local_functions.c:915
1279 msgid "your custom menu options (from your config file)"
1280 msgstr ""
1281
1282 #: examples/hcal/local_functions.c:921
1283 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1284 msgstr ""
1285
1286 #: examples/hcal/local_functions.c:924
1287 msgid "enter your selection, or <return> to continue"
1288 msgstr ""
1289
1290 #: examples/hcal/local_functions.c:928
1291 msgid "menu selection received was out of bounds"
1292 msgstr ""
1293
1294 #~ msgid "Tamuz"
1295 #~ msgstr "Тамуз"
0 # Swedish translation of libhdate.
1 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
2 # This file is distributed under the same license as the libhdate package.
3 # Daniel Nylander <po@danielnylander.se>, 2006.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: libhdate\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2013-01-23 07:07-0500\n"
10 "PO-Revision-Date: 2008-01-10 10:26+0100\n"
11 "Last-Translator: Patrik Nilsson <blambi@chebab.com>, Daniel Nylander "
12 "<po@danielnylander.se>\n"
13 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
14 "Language: sv\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=utf-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #: src/hdate_strings.c:186 src/hdate_strings.c:190
20 msgid "translator"
21 msgstr "Daniel Nylander, Patrik Nilsson"
22
23 #: src/hdate_strings.c:248
24 msgid "Sunday"
25 msgstr "Söndag"
26
27 #: src/hdate_strings.c:248
28 msgid "Monday"
29 msgstr "Måndag"
30
31 #: src/hdate_strings.c:248
32 msgid "Tuesday"
33 msgstr "Tisdag"
34
35 #: src/hdate_strings.c:248
36 msgid "Wednesday"
37 msgstr "Onsdag"
38
39 #: src/hdate_strings.c:249
40 msgid "Thursday"
41 msgstr "Torsdag"
42
43 #: src/hdate_strings.c:249
44 msgid "Friday"
45 msgstr "Fredag"
46
47 #: src/hdate_strings.c:249
48 msgid "Saturday"
49 msgstr "Lördag"
50
51 #: src/hdate_strings.c:251
52 msgid "Sun"
53 msgstr "Sön"
54
55 #: src/hdate_strings.c:251
56 msgid "Mon"
57 msgstr "Mån"
58
59 #: src/hdate_strings.c:251
60 msgid "Tue"
61 msgstr "Tis"
62
63 #: src/hdate_strings.c:251
64 msgid "Wed"
65 msgstr "Ons"
66
67 #: src/hdate_strings.c:251
68 msgid "Thu"
69 msgstr "Tor"
70
71 #: src/hdate_strings.c:252
72 msgid "Fri"
73 msgstr "Fre"
74
75 #: src/hdate_strings.c:252
76 msgid "Sat"
77 msgstr "Lör"
78
79 #: src/hdate_strings.c:265 src/hdate_strings.c:288
80 msgid "none"
81 msgstr "ingen"
82
83 #: src/hdate_strings.c:265 src/hdate_strings.c:288
84 msgid "Bereshit"
85 msgstr "Bereshit"
86
87 #: src/hdate_strings.c:265 src/hdate_strings.c:288
88 msgid "Noach"
89 msgstr "Noach"
90
91 #: src/hdate_strings.c:266 src/hdate_strings.c:289
92 msgid "Lech-Lecha"
93 msgstr "Lech-Lecha"
94
95 #: src/hdate_strings.c:266 src/hdate_strings.c:289
96 msgid "Vayera"
97 msgstr "Vayera"
98
99 #: src/hdate_strings.c:266 src/hdate_strings.c:289
100 msgid "Chayei Sara"
101 msgstr "Chayei Sara"
102
103 #: src/hdate_strings.c:267 src/hdate_strings.c:290
104 msgid "Toldot"
105 msgstr "Toldot"
106
107 #: src/hdate_strings.c:267 src/hdate_strings.c:290
108 msgid "Vayetzei"
109 msgstr "Vayetzei"
110
111 #: src/hdate_strings.c:267 src/hdate_strings.c:290
112 msgid "Vayishlach"
113 msgstr "Vayishlach"
114
115 #: src/hdate_strings.c:268 src/hdate_strings.c:291
116 msgid "Vayeshev"
117 msgstr "Vayeshev"
118
119 #: src/hdate_strings.c:268 src/hdate_strings.c:291
120 msgid "Miketz"
121 msgstr "Miketz"
122
123 #: src/hdate_strings.c:268 src/hdate_strings.c:291
124 msgid "Vayigash"
125 msgstr "Vayigash"
126
127 #: src/hdate_strings.c:269 src/hdate_strings.c:292
128 msgid "Vayechi"
129 msgstr "Vayechi"
130
131 #: src/hdate_strings.c:269 src/hdate_strings.c:292
132 msgid "Shemot"
133 msgstr "Shemot"
134
135 #: src/hdate_strings.c:269 src/hdate_strings.c:292
136 msgid "Vaera"
137 msgstr "Vaera"
138
139 #: src/hdate_strings.c:270 src/hdate_strings.c:293
140 msgid "Bo"
141 msgstr "Bo"
142
143 #: src/hdate_strings.c:270 src/hdate_strings.c:293
144 msgid "Beshalach"
145 msgstr "Beshalach"
146
147 #: src/hdate_strings.c:270 src/hdate_strings.c:293
148 msgid "Yitro"
149 msgstr "Yitro"
150
151 #: src/hdate_strings.c:271 src/hdate_strings.c:294
152 msgid "Mishpatim"
153 msgstr "Mishpatim"
154
155 #: src/hdate_strings.c:271 src/hdate_strings.c:294
156 msgid "Terumah"
157 msgstr "Terumah"
158
159 #: src/hdate_strings.c:271 src/hdate_strings.c:294
160 msgid "Tetzaveh"
161 msgstr "Tetzaveh"
162
163 #: src/hdate_strings.c:272 src/hdate_strings.c:295
164 msgid "Ki Tisa"
165 msgstr "Ki Tisa"
166
167 #: src/hdate_strings.c:272 src/hdate_strings.c:295
168 msgid "Vayakhel"
169 msgstr "Vayakhel"
170
171 #: src/hdate_strings.c:272 src/hdate_strings.c:295
172 msgid "Pekudei"
173 msgstr "Pekudei"
174
175 #: src/hdate_strings.c:273 src/hdate_strings.c:296
176 msgid "Vayikra"
177 msgstr "Vayikra"
178
179 #: src/hdate_strings.c:273 src/hdate_strings.c:296
180 msgid "Tzav"
181 msgstr "Tzav"
182
183 #: src/hdate_strings.c:273 src/hdate_strings.c:296
184 msgid "Shmini"
185 msgstr "Shmini"
186
187 #: src/hdate_strings.c:274 src/hdate_strings.c:297
188 msgid "Tazria"
189 msgstr "Tazria"
190
191 #: src/hdate_strings.c:274 src/hdate_strings.c:297
192 msgid "Metzora"
193 msgstr "Metzora"
194
195 #: src/hdate_strings.c:274 src/hdate_strings.c:297
196 msgid "Achrei Mot"
197 msgstr "Achrei Mot"
198
199 #: src/hdate_strings.c:275 src/hdate_strings.c:298
200 msgid "Kedoshim"
201 msgstr "Kedoshim"
202
203 #: src/hdate_strings.c:275 src/hdate_strings.c:298
204 msgid "Emor"
205 msgstr "Emor"
206
207 #: src/hdate_strings.c:275 src/hdate_strings.c:298
208 msgid "Behar"
209 msgstr "Behar"
210
211 #: src/hdate_strings.c:276 src/hdate_strings.c:299
212 msgid "Bechukotai"
213 msgstr "Bechukotai"
214
215 #: src/hdate_strings.c:276 src/hdate_strings.c:299
216 msgid "Bamidbar"
217 msgstr "Bamidbar"
218
219 #: src/hdate_strings.c:276 src/hdate_strings.c:299
220 msgid "Nasso"
221 msgstr "Nasso"
222
223 #: src/hdate_strings.c:277 src/hdate_strings.c:300
224 msgid "Beha'alotcha"
225 msgstr "Beha'alotcha"
226
227 #: src/hdate_strings.c:277 src/hdate_strings.c:300
228 msgid "Sh'lach"
229 msgstr "Sh'lach"
230
231 #: src/hdate_strings.c:277 src/hdate_strings.c:300
232 msgid "Korach"
233 msgstr "Korach"
234
235 #: src/hdate_strings.c:278 src/hdate_strings.c:301
236 msgid "Chukat"
237 msgstr "Chukat"
238
239 #: src/hdate_strings.c:278 src/hdate_strings.c:301
240 msgid "Balak"
241 msgstr "Balak"
242
243 #: src/hdate_strings.c:278 src/hdate_strings.c:301
244 msgid "Pinchas"
245 msgstr "Pinchas"
246
247 #: src/hdate_strings.c:279 src/hdate_strings.c:302
248 msgid "Matot"
249 msgstr "Matot"
250
251 #: src/hdate_strings.c:279 src/hdate_strings.c:302
252 msgid "Masei"
253 msgstr "Masei"
254
255 #: src/hdate_strings.c:279 src/hdate_strings.c:302
256 msgid "Devarim"
257 msgstr "Devarim"
258
259 #: src/hdate_strings.c:280 src/hdate_strings.c:303
260 msgid "Vaetchanan"
261 msgstr "Vaetchanan"
262
263 #: src/hdate_strings.c:280 src/hdate_strings.c:303
264 msgid "Eikev"
265 msgstr "Eikev"
266
267 #: src/hdate_strings.c:280 src/hdate_strings.c:303
268 msgid "Re'eh"
269 msgstr "Re'eh"
270
271 #: src/hdate_strings.c:281 src/hdate_strings.c:304
272 msgid "Shoftim"
273 msgstr "Shoftim"
274
275 #: src/hdate_strings.c:281 src/hdate_strings.c:304
276 msgid "Ki Teitzei"
277 msgstr "Ki Teitzei"
278
279 #: src/hdate_strings.c:281 src/hdate_strings.c:304
280 msgid "Ki Tavo"
281 msgstr "Ki Tavo"
282
283 #: src/hdate_strings.c:282 src/hdate_strings.c:305
284 msgid "Nitzavim"
285 msgstr "Nitzavim"
286
287 #: src/hdate_strings.c:282 src/hdate_strings.c:305
288 msgid "Vayeilech"
289 msgstr "Vayeilech"
290
291 #: src/hdate_strings.c:282 src/hdate_strings.c:305
292 msgid "Ha'Azinu"
293 msgstr "Ha'Azinu"
294
295 #: src/hdate_strings.c:283 src/hdate_strings.c:306
296 msgid "Vezot Habracha"
297 msgstr "Vezot Habracha"
298
299 #: src/hdate_strings.c:284 src/hdate_strings.c:307
300 msgid "Vayakhel-Pekudei"
301 msgstr "Vayakhel-Pekudei"
302
303 #: src/hdate_strings.c:284 src/hdate_strings.c:307
304 msgid "Tazria-Metzora"
305 msgstr "Tazria-Metzora"
306
307 #: src/hdate_strings.c:284 src/hdate_strings.c:307
308 msgid "Achrei Mot-Kedoshim"
309 msgstr "Achrei Mot-Kedoshim"
310
311 #: src/hdate_strings.c:285 src/hdate_strings.c:308
312 msgid "Behar-Bechukotai"
313 msgstr "Behar-Bechukotai"
314
315 #: src/hdate_strings.c:285 src/hdate_strings.c:308
316 msgid "Chukat-Balak"
317 msgstr "Chukat-Balak"
318
319 #: src/hdate_strings.c:285 src/hdate_strings.c:308
320 msgid "Matot-Masei"
321 msgstr "Matot-Masei"
322
323 #: src/hdate_strings.c:286 src/hdate_strings.c:309
324 msgid "Nitzavim-Vayeilech"
325 msgstr "Nitzavim-Vayeilech"
326
327 #: src/hdate_strings.c:364 src/hdate_strings.c:369
328 msgid "Tishrei"
329 msgstr "Tishrei"
330
331 #: src/hdate_strings.c:364 src/hdate_strings.c:369
332 msgid "Cheshvan"
333 msgstr "Cheshvan"
334
335 #: src/hdate_strings.c:364 src/hdate_strings.c:369
336 msgid "Kislev"
337 msgstr "Kislev"
338
339 #: src/hdate_strings.c:364 src/hdate_strings.c:369
340 msgid "Tevet"
341 msgstr "Tevet"
342
343 #: src/hdate_strings.c:365 src/hdate_strings.c:370
344 msgid "Sh'vat"
345 msgstr "Sh'vat"
346
347 #: src/hdate_strings.c:365 src/hdate_strings.c:370
348 msgid "Adar"
349 msgstr "Adar"
350
351 #: src/hdate_strings.c:365 src/hdate_strings.c:370
352 msgid "Nisan"
353 msgstr "Nisan"
354
355 #: src/hdate_strings.c:365 src/hdate_strings.c:370
356 msgid "Iyyar"
357 msgstr "Iyyar"
358
359 #: src/hdate_strings.c:366 src/hdate_strings.c:371
360 msgid "Sivan"
361 msgstr "Sivan"
362
363 #: src/hdate_strings.c:366 src/hdate_strings.c:371
364 #, fuzzy
365 msgid "Tammuz"
366 msgstr "Tzom Tammuz"
367
368 #: src/hdate_strings.c:366 src/hdate_strings.c:371
369 msgid "Av"
370 msgstr "Av"
371
372 #: src/hdate_strings.c:366 src/hdate_strings.c:371
373 msgid "Elul"
374 msgstr "Elul"
375
376 #: src/hdate_strings.c:366 src/hdate_strings.c:371
377 msgid "Adar I"
378 msgstr "Adar I"
379
380 #: src/hdate_strings.c:367 src/hdate_strings.c:372
381 msgid "Adar II"
382 msgstr "Adar II"
383
384 #: src/hdate_strings.c:384
385 msgid "January"
386 msgstr "Januari"
387
388 #: src/hdate_strings.c:384
389 msgid "February"
390 msgstr "Februari"
391
392 #: src/hdate_strings.c:384
393 msgid "March"
394 msgstr "Mars"
395
396 #: src/hdate_strings.c:385
397 msgid "April"
398 msgstr "April"
399
400 #: src/hdate_strings.c:385 src/hdate_strings.c:388
401 msgid "May"
402 msgstr "Maj"
403
404 #: src/hdate_strings.c:385
405 msgid "June"
406 msgstr "Juni"
407
408 #: src/hdate_strings.c:386
409 msgid "July"
410 msgstr "Juli"
411
412 #: src/hdate_strings.c:386
413 msgid "August"
414 msgstr "Augusti"
415
416 #: src/hdate_strings.c:386
417 msgid "September"
418 msgstr "September"
419
420 #: src/hdate_strings.c:387
421 msgid "October"
422 msgstr "Oktober"
423
424 #: src/hdate_strings.c:387
425 msgid "November"
426 msgstr "November"
427
428 #: src/hdate_strings.c:387
429 msgid "December"
430 msgstr "December"
431
432 #: src/hdate_strings.c:388
433 msgid "Jan"
434 msgstr "Jan"
435
436 #: src/hdate_strings.c:388
437 msgid "Feb"
438 msgstr "Feb"
439
440 #: src/hdate_strings.c:388
441 msgid "Mar"
442 msgstr "Mar"
443
444 #: src/hdate_strings.c:388
445 msgid "Apr"
446 msgstr "Apr"
447
448 #: src/hdate_strings.c:389
449 msgid "Jun"
450 msgstr "Jun"
451
452 #: src/hdate_strings.c:389
453 msgid "Jul"
454 msgstr "Jul"
455
456 #: src/hdate_strings.c:389
457 msgid "Aug"
458 msgstr "Aug"
459
460 #: src/hdate_strings.c:389
461 msgid "Sep"
462 msgstr "Sep"
463
464 #: src/hdate_strings.c:389
465 msgid "Oct"
466 msgstr "Okt"
467
468 #: src/hdate_strings.c:390
469 msgid "Nov"
470 msgstr "Nov"
471
472 #: src/hdate_strings.c:390
473 msgid "Dec"
474 msgstr "Dec"
475
476 #: src/hdate_strings.c:396 src/hdate_strings.c:416
477 msgid "Rosh Hashana I"
478 msgstr "Rosh Hashana I"
479
480 #: src/hdate_strings.c:396 src/hdate_strings.c:416
481 msgid "Rosh Hashana II"
482 msgstr "Rosh Hashana II"
483
484 #: src/hdate_strings.c:397 src/hdate_strings.c:417
485 msgid "Tzom Gedaliah"
486 msgstr "Tzom Gedaliah"
487
488 #: src/hdate_strings.c:397 src/hdate_strings.c:417
489 msgid "Yom Kippur"
490 msgstr "Yom Kippur"
491
492 #: src/hdate_strings.c:398 src/hdate_strings.c:418
493 msgid "Sukkot"
494 msgstr "Sukkot"
495
496 #: src/hdate_strings.c:398 src/hdate_strings.c:418
497 msgid "Hol hamoed Sukkot"
498 msgstr "Hol hamoed Sukkot"
499
500 #: src/hdate_strings.c:399 src/hdate_strings.c:419
501 msgid "Hoshana raba"
502 msgstr "Hoshana raba"
503
504 #: src/hdate_strings.c:399 src/hdate_strings.c:419
505 msgid "Simchat Torah"
506 msgstr "Simchat Torah"
507
508 #: src/hdate_strings.c:400 src/hdate_strings.c:420
509 msgid "Chanukah"
510 msgstr "Chanukah"
511
512 #: src/hdate_strings.c:400 src/hdate_strings.c:420
513 msgid "Asara B'Tevet"
514 msgstr "Asara B'Tevet"
515
516 #: src/hdate_strings.c:401 src/hdate_strings.c:421
517 msgid "Tu B'Shvat"
518 msgstr "Tu B'Shvat"
519
520 #: src/hdate_strings.c:401 src/hdate_strings.c:421
521 msgid "Ta'anit Esther"
522 msgstr "Ta'anit Esther"
523
524 #: src/hdate_strings.c:402 src/hdate_strings.c:422
525 msgid "Purim"
526 msgstr "Purim"
527
528 #: src/hdate_strings.c:402 src/hdate_strings.c:422
529 msgid "Shushan Purim"
530 msgstr "Shushan Purim"
531
532 #: src/hdate_strings.c:403 src/hdate_strings.c:423
533 msgid "Pesach"
534 msgstr "Pesach"
535
536 #: src/hdate_strings.c:403 src/hdate_strings.c:423
537 msgid "Hol hamoed Pesach"
538 msgstr "Hol hamoed Pesach"
539
540 #: src/hdate_strings.c:404 src/hdate_strings.c:424
541 msgid "Yom HaAtzma'ut"
542 msgstr "Yom HaAtzma'ut"
543
544 #: src/hdate_strings.c:404 src/hdate_strings.c:424
545 msgid "Lag B'Omer"
546 msgstr "Lag B'Omer"
547
548 #: src/hdate_strings.c:405 src/hdate_strings.c:425
549 msgid "Erev Shavuot"
550 msgstr "Erev Shavuot"
551
552 #: src/hdate_strings.c:405 src/hdate_strings.c:425
553 msgid "Shavuot"
554 msgstr "Shavuot"
555
556 #: src/hdate_strings.c:406 src/hdate_strings.c:426
557 msgid "Tzom Tammuz"
558 msgstr "Tzom Tammuz"
559
560 #: src/hdate_strings.c:406 src/hdate_strings.c:426
561 msgid "Tish'a B'Av"
562 msgstr "Tish'a B'Av"
563
564 #: src/hdate_strings.c:407 src/hdate_strings.c:427
565 msgid "Tu B'Av"
566 msgstr "Tu B'Av"
567
568 #: src/hdate_strings.c:407 src/hdate_strings.c:427
569 msgid "Yom HaShoah"
570 msgstr "Yom HaShoah"
571
572 #: src/hdate_strings.c:408 src/hdate_strings.c:428
573 msgid "Yom HaZikaron"
574 msgstr "Yom HaZikaron"
575
576 #: src/hdate_strings.c:408 src/hdate_strings.c:428
577 msgid "Yom Yerushalayim"
578 msgstr "Yom Yerushalayim"
579
580 #: src/hdate_strings.c:409 src/hdate_strings.c:429
581 msgid "Shmini Atzeret"
582 msgstr "Shmini Atzeret"
583
584 #: src/hdate_strings.c:409 src/hdate_strings.c:429
585 msgid "Pesach VII"
586 msgstr "Pesach VII"
587
588 #: src/hdate_strings.c:410 src/hdate_strings.c:430
589 msgid "Pesach VIII"
590 msgstr "Pesach VIII"
591
592 #: src/hdate_strings.c:410 src/hdate_strings.c:430
593 msgid "Shavuot II"
594 msgstr "Shavuot II"
595
596 #: src/hdate_strings.c:411 src/hdate_strings.c:431
597 msgid "Sukkot II"
598 msgstr "Sukkot II"
599
600 #: src/hdate_strings.c:411 src/hdate_strings.c:431
601 msgid "Pesach II"
602 msgstr "Pesach II"
603
604 #: src/hdate_strings.c:412 src/hdate_strings.c:432
605 msgid "Family Day"
606 msgstr "Familjedagen"
607
608 #: src/hdate_strings.c:412 src/hdate_strings.c:432
609 msgid "Memorial day for fallen whose place of burial is unknown"
610 msgstr "Minnesdag för de fallena vars gravplats är okänd"
611
612 #: src/hdate_strings.c:413
613 msgid "Yitzhak Rabin memorial day"
614 msgstr "Minnesdag för Yitzhak Rabin"
615
616 #: src/hdate_strings.c:413
617 msgid "Zeev Zhabotinsky day"
618 msgstr "Zeev Zhabotinksys dag"
619
620 #: src/hdate_strings.c:414 src/hdate_strings.c:434
621 #, fuzzy
622 msgid "Erev Yom Kippur"
623 msgstr "Erev Yom Kippur"
624
625 #: src/hdate_strings.c:433
626 msgid "Rabin memorial day"
627 msgstr "Minnesdag för Y. Rabin"
628
629 #: src/hdate_strings.c:433
630 msgid "Zhabotinsky day"
631 msgstr "Zhabotinksys dag"
632
633 #: src/hdate_strings.c:514
634 msgid "in the Omer"
635 msgstr ""
636
637 #: examples/hcal/hcal.c:142
638 msgid ""
639 "# configuration file for hcal - Hebrew calendar program\n"
640 "# part of package libhdate\n"
641 "#\n"
642 "# Should you mangle this file and wish to restore its default content,\n"
643 "# rename or delete this file and run hcal; hcal will automatically\n"
644 "# regenerate the default content.\n"
645 "#\n"
646 "# Your system administrator can set system-wide defaults for hcal by\n"
647 "# modifying file <not yet implemented>.\n"
648 "# You may override all defaults by changing the contents of this file.\n"
649 "#\n"
650 "# Version information\n"
651 "# This may be used by updates to hcal to determine how to parse the file\n"
652 "# and whether additional information and options should be appended to\n"
653 "# the end of this file.\n"
654 "VERSION=2.00\n"
655 "# Location awareness\n"
656 "# hcal wants to accurately highlight the current Hebrew day, including\n"
657 "# during the hours between sunset and secular midnight. If you don't\n"
658 "# provide it with latitude, longitude, and time zone information, hcal\n"
659 "# will try to guess the information, based upon your system timezone,\n"
660 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
661 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
662 "# with a message that includes the guessed location.\n"
663 "# hcal's guesses will also affect its default behaviour for ouput of\n"
664 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
665 "#SUNSET_AWARE=TRUE\n"
666 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
667 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
668 "# delimiters. Use negative values to indicate South and West, or\n"
669 "# use the abbreviated compass directions N, S, E, W.\n"
670 "#LATITUDE=\n"
671 "#LONGITUDE=\n"
672 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
673 "# with the characters :'\" as possible delimiters.\n"
674 "#TIMEZONE=\n"
675 "\n"
676 "# Israel and the diaspora\n"
677 "# If hcal guesses that you're not in Israel, the DIASPORA option will be\n"
678 "# set true. This will affect holiday and parasha output. FORCE_ISRAEL\n"
679 "# forces hcal to display calendar information for Israel, using hcal's\n"
680 "# default coordinates foe Israel, or coordinates that you provide that\n"
681 "# seem legitmately within Israel.\n"
682 "# Thus, if you are living in Sao Paolo, and will be visiting Israel for\n"
683 "# Sukkot, set BOTH flags true in order to see holiday information for\n"
684 "# a non-resident vistor to Israel. The command line options for these\n"
685 "# features are --israel, -I, --diaspora, -d.\n"
686 "#FORCE_DIASPORA=FALSE;\n"
687 "#FORCE_ISRAEL=FALSE;\n"
688 "\n"
689 "# Shabbat related\n"
690 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
691 "# The command line options for these features are -p (--parasha), and\n"
692 "# -s (--shabbat). The CANDLE_LIGHTING field can accept a value of 18 - 90 "
693 "(minutes\n"
694 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
695 "# (minutes after sunset).\n"
696 "#PARASHA_NAMES=FALSE\n"
697 "#SHABBAT_INFO=FALSE\n"
698 "#CANDLE_LIGHTING=FALSE\n"
699 "#HAVDALAH=FALSE\n"
700 "\n"
701 "# Holiday identification\n"
702 "# hcal flags holidays by replacing the gregorian/Hebrew date separator\n"
703 "# with assorted unhelpful cryptic symbols. Setting FOOTNOTES to true\n"
704 "# will have hcal output after the month's calendar, a list of the month's\n"
705 "# holidays along with the days on which they occur.\n"
706 "#FOOTNOTE=FALSE\n"
707 "\n"
708 "# Output in hebrew characters\n"
709 "# hcal defaults to output all information in your default language, so\n"
710 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
711 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
712 "# still outputting gregorian information in your default language. To\n"
713 "# output ALL information in Hebrew, run something like this:\n"
714 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hcal; LC_ALL=$LC_TEMP\n"
715 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
716 "# output, you need to install a terminal font that includes the Hebrew\n"
717 "# character set (hint: unicode).\n"
718 "# The command line option for FORCE_HEBREW is either --hebrew or -H\n"
719 "#FORCE_HEBREW=FALSE\n"
720 "\n"
721 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
722 "# Unfortunately, the world can not be depended upon to be either. Most\n"
723 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
724 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
725 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
726 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
727 "# This will reverse the order of the Hebrew characters, so they will\n"
728 "# display 'visual'ly correct; however, such output will not be suitable\n"
729 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
730 "# automatically forces hebrew.\n"
731 "# The command line option for OUTPUT_BIDI is either --bidi, --visual, or -b\n"
732 "#OUTPUT_BIDI=FALSE\n"
733 "\n"
734 "# Display enhancements\n"
735 "# hcal defaults to display the current day in reverse video\n"
736 "# The command line option for this feature is --no-reverse\n"
737 "#SUPPRESS_REVERSE_VIDEO=FALSE;\n"
738 "# hcal can display its output \"calming, muted tones\". Note that piping\n"
739 "# colorized output may yield unexpected results.\n"
740 "#COLORIZE=FALSE\n"
741 "\n"
742 "# HTML OUTPUT\n"
743 "#OUTPUT_HTML=FALSE\n"
744 "#USE_EXTERNAL_CSS_FILE=\"pathto/foo/bar\"\n"
745 "\n"
746 "# Suppress alerts and warnings\n"
747 "# hcal alerts the user via STDERR when it guesses the user's location.\n"
748 "#QUIET_ALERTS=FALSE\n"
749 "\n"
750 "# Three month display\n"
751 "# hcal can display a previous, current and next month side-by-side. hcal\n"
752 "# can also display a calendar for an entire year in four rows of three\n"
753 "# months each. Note that this will display properly only if your console\n"
754 "# is set for at least 127 columns. Note also that setting this option to\n"
755 "# will cause options FOOTNOTES, SHABBAT, and PARASHA_NAMES to false.\n"
756 "#THREE_MONTH=FALSE\n"
757 "\n"
758 "# User-defined menus\n"
759 "# You may specify here command-line strings to optionally be parsed\n"
760 "# by hcal at execution time. To do so, use the command line option -m\n"
761 "# (--menu). hcal will process first the settings of this config file,\n"
762 "# then the other settings of your command line, and then will prompt\n"
763 "# you for which menu item you would like to select. hcal will process\n"
764 "# your menu selection as if it were a new command line, further modifying\n"
765 "# all the prior settings.\n"
766 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
767 "# truncated at one hundred characters\n"
768 "#MENU= -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
769 "#MENU= -l 32 -L 34 -z 2 # son in bnei brak\n"
770 "#MENU= -fbc -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
771 "#MENU= -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
772 msgstr ""
773
774 #: examples/hcal/hcal.c:271
775 msgid ""
776 "hcal - Hebrew calendar\n"
777 "version 1.6"
778 msgstr ""
779
780 #: examples/hcal/hcal.c:281
781 msgid ""
782 "Usage: hcal [options] [coordinates timezone] ] [[month] year]\n"
783 " coordinates: -l [NS]yy[.xxx] -L [EW]xx[.xxx]\n"
784 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
785 " timezone: -z nn[( .nn | :mm )]\n"
786 "Try 'hcal --help' for more information"
787 msgstr ""
788
789 #: examples/hcal/hcal.c:295
790 msgid ""
791 "Hebrew calendar\n"
792 "OPTIONS:\n"
793 " -1 --one-month over-ride config file setting if you had set\n"
794 " option --three-month as a default there\n"
795 " -3 --three-month displays previous/next months\n"
796 " side by side. requires 127 columns\n"
797 " -b --bidi prints hebrew in reverse (visual)\n"
798 " --visual\n"
799 " --no-bidi over-ride config file setting if you had set\n"
800 " --no-visual option -bidi as a default there\n"
801 " -c --colorize displays in calming, muted tones\n"
802 " --no-color over-ride a --colorize setting in your config file\n"
803 " -d --diaspora use diaspora reading and holidays.\n"
804 " -f --footnote print descriptive notes of holidays\n"
805 " --no-footnote over-ride a footnote setting in your config file\n"
806 " -h --html output in html format to stdout\n"
807 " -H --hebrew print hebrew information in Hebrew\n"
808 " -i use external css file \"./hcal.css\".\n"
809 " -I --israel override a diaspora default\n"
810 " --no-reverse do not highlight today's date\n"
811 " -m --menu prompt user-defined menu from config file\n"
812 " -p --parasha print week's parasha on each calendar row\n"
813 " -q --quiet-alerts suppress warning messages\n"
814 " -s --shabbat print Shabbat times and parshiot\n"
815 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
816 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
817 " -z --timezone nn timezone, +/-UTC\n"
818 " -l --latitude yy latitude yy degrees. Negative values are South\n"
819 " -L --longitude xx longitude xx degrees. Negative values are West\n"
820 "\n"
821 "All options can be made default in the config file, or menu-ized for\n"
822 "easy selection."
823 msgstr ""
824
825 #: examples/hcal/hcal.c:1877
826 msgid ""
827 "ALERT: options --parasha, --shabbat, --footnote are not supported in 'three-"
828 "month' mode"
829 msgstr ""
830
831 #: examples/hcal/hcal.c:1949 examples/hcal/local_functions.c:96
832 #: examples/hcal/local_functions.c:103 examples/hcal/local_functions.c:116
833 #: examples/hcal/local_functions.c:490 examples/hcal/local_functions.c:495
834 msgid "error"
835 msgstr ""
836
837 #: examples/hcal/hcal.c:1949
838 msgid "too many parameters received. expected [[mm] [yyyy]"
839 msgstr ""
840
841 #: examples/hcal/hcal.c:1958 examples/hcal/hdate.c:1929
842 #: examples/hcal/hdate.c:2003 examples/hcal/hdate.c:2100
843 msgid "year"
844 msgstr ""
845
846 #: examples/hcal/hcal.c:1966 examples/hcal/hdate.c:2013
847 #: examples/hcal/hdate.c:2016 examples/hcal/hdate.c:2070
848 #: examples/hcal/hdate.c:2110 examples/hcal/hdate.c:2113
849 #: examples/hcal/hdate.c:2132
850 msgid "month"
851 msgstr ""
852
853 #: examples/hcal/hdate.c:42
854 msgid "sunrise"
855 msgstr ""
856
857 #: examples/hcal/hdate.c:43
858 msgid "sunset"
859 msgstr ""
860
861 #: examples/hcal/hdate.c:44
862 msgid "first_light"
863 msgstr ""
864
865 #: examples/hcal/hdate.c:45
866 msgid "talit"
867 msgstr ""
868
869 #: examples/hcal/hdate.c:46
870 msgid "midday"
871 msgstr ""
872
873 #: examples/hcal/hdate.c:47
874 msgid "first_stars"
875 msgstr ""
876
877 #: examples/hcal/hdate.c:48
878 msgid "three_stars"
879 msgstr ""
880
881 #: examples/hcal/hdate.c:49 examples/hcal/hdate.c:635
882 msgid "sun_hour"
883 msgstr ""
884
885 #: examples/hcal/hdate.c:50
886 msgid "candle-lighting"
887 msgstr ""
888
889 #: examples/hcal/hdate.c:51
890 msgid "havdalah"
891 msgstr ""
892
893 #: examples/hcal/hdate.c:81
894 msgid ""
895 "# configuration file for hdate - Hebrew date information program\n"
896 "# part of package libhdate\n"
897 "#\n"
898 "# Should you mangle this file and wish to restore its default content,\n"
899 "# rename or delete this file and run hdate; hdate will automatically\n"
900 "# regenerate the default content.\n"
901 "#\n"
902 "# Your system administrator can set system-wide defaults for hcal by\n"
903 "# modifying file <not yet implemented>.\n"
904 "# You may override all defaults by changing the contents of this file.\n"
905 "#\n"
906 "# Version information\n"
907 "# This may be used by updates to hcal to determine how to parse the file\n"
908 "# and whether additional information and options should be appended to\n"
909 "# the end of this file.\n"
910 "VERSION=2.00\n"
911 "#\n"
912 "# Location awareness\n"
913 "# hdate wants to accurately highlight the current Hebrew day, including\n"
914 "# during the hours between sunset and secular midnight. If you don't\n"
915 "# provide it with latitude, longitude, and time zone information, hdate\n"
916 "# will try to guess the information, based upon your system timezone,\n"
917 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
918 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
919 "# with a message that includes the guessed location.\n"
920 "# hdate's guesses will also affect its default behaviour for ouput of\n"
921 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
922 "#SUNSET_AWARE=TRUE\n"
923 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
924 "# degrees[:minutes[:seconds]] with the characters :'\" as possible\n"
925 "# delimiters. Use negative values to indicate South and West, or\n"
926 "# use the abbreviated compass directions N, S, E, W.\n"
927 "#LATITUDE=\n"
928 "#LONGITUDE=\n"
929 "# TIMEZONE may may be in decimal format or in the form degrees[:minutes]\n"
930 "# with the characters :'\" as possible delimiters.\n"
931 "#TIMEZONE=\n"
932 "\n"
933 "# Output in hebrew characters\n"
934 "# hdate defaults to output all information in your default language, so\n"
935 "# if your default language is Hebrew, you're all set. Otherwise, you can\n"
936 "# set FORCE_HEBREW to true to output Hebrew information in Hebrew, while\n"
937 "# still outputting gregorian information in your default language. To\n"
938 "# output ALL information in Hebrew, run something like this:\n"
939 "# LC_TEMP=LC_ALL; LC_ALL=\"he_IL.UTF-8\"; hdate; LC_ALL=$LC_TEMP\n"
940 "# If setting FORCE_HEBREW to true results in 'garbage' or non-Hebrew\n"
941 "# output, you need to install a terminal font that includes the Hebrew\n"
942 "# character set (hint: unicode).\n"
943 "#FORCE_HEBREW=FALSE\n"
944 "\n"
945 "# The FORCE_HEBREW option outputs data that is 'correct' and 'logical'.\n"
946 "# Unfortunately, the world can not be depended upon to be either. Most\n"
947 "# Xwindow applications will display the data fine with FORCE_HEBREW; most\n"
948 "# xterm implementations will not. (in fact, the only xterm clone I know\n"
949 "# of that comes close is mlterm). If using FORCE_HEBREW results in\n"
950 "# Hebrew characters being displayed in reverse, set OUTPUT_BIDI to true.\n"
951 "# This will reverse the order of the Hebrew characters, so they will\n"
952 "# display 'visual'ly correct; however, such output will not be suitable\n"
953 "# for piping or pasting to many other applications. Setting OUTPUT_BIDI\n"
954 "# automatically forces hebrew.\n"
955 "#OUTPUT_BIDI=FALSE\n"
956 "\n"
957 "# The Hebrew language output of Hebrew information can also be 'styled'\n"
958 "# in the following ways:\n"
959 "# option YOM ~> yom shishi, aleph tishrei ...\n"
960 "# option LESHABBAT ~> yom sheni leshabbat miketz, kof kislev ...\n"
961 "# option LESEDER ~> yom sheni leseder miketz, kof kislev ...\n"
962 "#YOM=FALSE\n"
963 "#LESHABBAT=FALSE\n"
964 "#LESEDER=FALSE\n"
965 "\n"
966 "#SUN_RISE_SET=FALSE\n"
967 "#TIMES_OF_DAY=FALSE\n"
968 "#SHORT_FORMAT=FALSE\n"
969 "#SEFIRAT_HAOMER=FALSE\n"
970 "#DIASPORA=FALSE\n"
971 "\n"
972 "\n"
973 "# Shabbat related\n"
974 "# Setting SHABBAT_INFO true will output parshiot and Shabbat times.\n"
975 "# The command line options for these features are -r (--parasha), and\n"
976 "# -c. The CANDLE_LIGHTING field can accept a value of 18 - 90 (minutes\n"
977 "# before sunset). The HAVDALAH field can accept a value of 20 - 90\n"
978 "# (minutes after sunset).\n"
979 "#PARASHA_NAMES=FALSE\n"
980 "#ONLY_IF_PARASHA_IS_READ=FALSE\n"
981 "#SHABBAT_INFO=FALSE\n"
982 "\n"
983 "#CANDLE_LIGHTING=FALSE\n"
984 "#HAVDALAH=FALSE\n"
985 "\n"
986 "# Holiday related\n"
987 "#HOLIDAYS=FALSE\n"
988 "#ONLY_IF_HOLIDAY=FALSE\n"
989 "\n"
990 "# Tabular output\n"
991 "# This option has hdate output the information you request in a single\n"
992 "# comma-delimited line per day, suitable for piping or import to\n"
993 "# spreadsheet formatting applications, etc. To belabor the obvious,\n"
994 "# try running - ./hdate 12 2011 -Rt --table |column -s, -t \n"
995 "# The command line option for this feature is, um, --table\n"
996 "#TABULAR=FALSE\n"
997 "\n"
998 "# iCal format\n"
999 "# hdate can output its information in iCal-compatable format\n"
1000 "# ICAL=FALSE\n"
1001 "# Suppress alerts and warnings\n"
1002 "# hdate alerts the user via STDERR when it guesses the user's location.\n"
1003 "#QUIET_ALERTS=FALSE\n"
1004 "\n"
1005 "# Julian day number\n"
1006 "# The Julian day number is a .... See ... for more details.\n"
1007 "# setting the option JULIAN_DAY will have hdate output that number in\n"
1008 "# the format JDN-nnnnnnn at the beginning of its first line of output.\n"
1009 "#JULIAN_DAY=FALSE\n"
1010 "\n"
1011 "# User-defined menus\n"
1012 "# You may specify here command-line strings to optionally be parsed\n"
1013 "# by hcal at execution time. To do so, use the command line option -m\n"
1014 "# (--menu). hcal will process first the settings of this config file,\n"
1015 "# then the other settings of your command line, and then will prompt\n"
1016 "# you for which menu item you would like to select. hcal will process\n"
1017 "# your menu selection as if it were a new command line, further modifying\n"
1018 "# all the prior settings.\n"
1019 "# Only the first ten \"MENU=\" entries will be read. Each line will be\n"
1020 "# truncated at one hundred characters\n"
1021 "#MENU= -bd -l -23.55 -L -46.61 -z -3 # parents in Sao Paolo\n"
1022 "#MENU= -b -l 32 -L 34 -z 2 # son in bnei brak\n"
1023 "#MENU= -bd -l 43.71 -L -79.43 -z -5 # me in Toronto\n"
1024 "#MENU= -bd -l 22.26 -L 114.15 -z 8 # supplier in Hong Kong\n"
1025 msgstr ""
1026
1027 #: examples/hcal/hdate.c:209
1028 msgid ""
1029 "hdate - display Hebrew date information\n"
1030 "version 1.6"
1031 msgstr ""
1032
1033 #: examples/hcal/hdate.c:219
1034 msgid ""
1035 "Usage: hdate [options] [coordinates timezone] [[[day] month] year]\n"
1036 " hdate [options] [coordinates timezone] [julian_day]\n"
1037 "\n"
1038 " coordinates: -l [NS]yy[.yyy] -L [EW]xx[.xxx]\n"
1039 " -l [NS]yy[:mm[:ss]] -L [EW]xx[:mm[:ss]]\n"
1040 " timezone: -z nn[( .nn | :mm )]\n"
1041 "Try 'hdate --help' for more information"
1042 msgstr ""
1043
1044 #: examples/hcal/hdate.c:235
1045 msgid ""
1046 "hdate - display Hebrew date information\n"
1047 "OPTIONS:\n"
1048 " -b --bidi prints hebrew in reverse (visual)\n"
1049 " --visual\n"
1050 " -c print Shabbat start/end times.\n"
1051 " --candles modify default minhag of 20 minutes. (17<n<91)\n"
1052 " --havdalah modify default minhag of 3 stars. (19<n<91 minutes)\n"
1053 " -d --diaspora use diaspora reading and holidays.\n"
1054 " -h --holidays print holidays.\n"
1055 " -H print only it is a holiday.\n"
1056 " -i --ical use iCal formated output.\n"
1057 " -j --julian print Julian day number.\n"
1058 " -m --menu prompt user-defined menu from config file\n"
1059 " -o --omer print Sefirat Haomer.\n"
1060 " -q --quiet-alerts suppress warning messages\n"
1061 " -r --parasha print weekly reading on saturday.\n"
1062 " -R print only if there is a weekly reading on Shabbat.\n"
1063 " -s --sun print sunrise/sunset times.\n"
1064 " -S --short-format print using short format.\n"
1065 " -t print day times: first light, talit, sunrise,\n"
1066 " midday, sunset, first stars, three stars.\n"
1067 " -T --table tabular output, suitable for spreadsheets\n"
1068 "\n"
1069 " -z --timezone nn timezone, +/-UTC\n"
1070 " -l --latitude yy latitude yy degrees. Negative values are South\n"
1071 " -L --longitude xx longitude xx degrees. Negative values are West\n"
1072 "\n"
1073 " --hebrew forces Hebrew to print in Hebrew characters\n"
1074 " --yom force Hebrew prefix to Hebrew day of week\n"
1075 " --leshabbat insert parasha between day of week and day\n"
1076 " --leseder insert parasha between day of week and day\n"
1077 " --not-sunset-aware don't display next day if after sunset\n"
1078 "\n"
1079 "All options can be made default in the config file, or menu-ized for\n"
1080 "easy selection."
1081 msgstr ""
1082
1083 #: examples/hcal/hdate.c:274
1084 msgid ""
1085 "ALERT: The information displayed is for today's Hebrew date.\n"
1086 " Because it is now after sunset, that means the data is\n"
1087 " for the Gregorian day beginning at midnight."
1088 msgstr ""
1089
1090 #: examples/hcal/hdate.c:405
1091 msgid "eve of "
1092 msgstr ""
1093
1094 #: examples/hcal/hdate.c:669
1095 msgid "today is day"
1096 msgstr ""
1097
1098 #: examples/hcal/hdate.c:743
1099 msgid "Gregorian date"
1100 msgstr ""
1101
1102 #: examples/hcal/hdate.c:743
1103 msgid "Hebrew Date"
1104 msgstr ""
1105
1106 #: examples/hcal/hdate.c:748
1107 #, fuzzy
1108 msgid "holiday"
1109 msgstr "Fredag"
1110
1111 #: examples/hcal/hdate.c:749
1112 msgid "omer count"
1113 msgstr ""
1114
1115 #: examples/hcal/hdate.c:750
1116 msgid "parashat"
1117 msgstr ""
1118
1119 #: examples/hcal/hdate.c:1016
1120 msgid "Parashat"
1121 msgstr ""
1122
1123 #: examples/hcal/hdate.c:2120 examples/hcal/hdate.c:2139
1124 #, fuzzy
1125 msgid "day"
1126 msgstr "Maj"
1127
1128 #: examples/hcal/hdate.c:2168
1129 msgid "too many arguments; after options max is dd mm yyyy"
1130 msgstr ""
1131
1132 #: examples/hcal/local_functions.c:97
1133 msgid "parameter"
1134 msgstr ""
1135
1136 #: examples/hcal/local_functions.c:98
1137 msgid "is non-numeric or out of bounds"
1138 msgstr ""
1139
1140 #: examples/hcal/local_functions.c:104 examples/hcal/local_functions.c:117
1141 msgid "option"
1142 msgstr ""
1143
1144 #: examples/hcal/local_functions.c:104
1145 msgid "missing parameter"
1146 msgstr ""
1147
1148 #: examples/hcal/local_functions.c:110
1149 msgid "ALERT: time zone not entered, using system local time zone"
1150 msgstr ""
1151
1152 #: examples/hcal/local_functions.c:117
1153 msgid "is not a valid option"
1154 msgstr ""
1155
1156 #: examples/hcal/local_functions.c:134
1157 msgid "ALERT: guessing... will use co-ordinates for"
1158 msgstr ""
1159
1160 #: examples/hcal/local_functions.c:142
1161 msgid "Los Angeles"
1162 msgstr ""
1163
1164 #: examples/hcal/local_functions.c:143
1165 msgid "Mexico City"
1166 msgstr ""
1167
1168 #: examples/hcal/local_functions.c:144
1169 msgid "New York City"
1170 msgstr ""
1171
1172 #: examples/hcal/local_functions.c:147
1173 msgid "Buenos Aires"
1174 msgstr ""
1175
1176 #: examples/hcal/local_functions.c:148
1177 msgid "London"
1178 msgstr ""
1179
1180 #: examples/hcal/local_functions.c:149
1181 msgid "Paris"
1182 msgstr ""
1183
1184 #: examples/hcal/local_functions.c:150
1185 msgid "Tel-Aviv"
1186 msgstr ""
1187
1188 #: examples/hcal/local_functions.c:151
1189 msgid "Moscow"
1190 msgstr ""
1191
1192 #: examples/hcal/local_functions.c:152
1193 msgid "Tashkent"
1194 msgstr ""
1195
1196 #: examples/hcal/local_functions.c:153
1197 msgid "Beijing"
1198 msgstr ""
1199
1200 #: examples/hcal/local_functions.c:155
1201 msgid "Honolulu"
1202 msgstr ""
1203
1204 #: examples/hcal/local_functions.c:156
1205 msgid "Hmmm, ... hate to do this, really ..."
1206 msgstr ""
1207
1208 #: examples/hcal/local_functions.c:156
1209 msgid "using co-ordinates for the equator, at the center of time zone"
1210 msgstr ""
1211
1212 #: examples/hcal/local_functions.c:322 examples/hcal/local_functions.c:336
1213 #: examples/hcal/local_functions.c:337
1214 msgid "l (latitude)"
1215 msgstr ""
1216
1217 #: examples/hcal/local_functions.c:323
1218 msgid "L (Longitue)"
1219 msgstr ""
1220
1221 #: examples/hcal/local_functions.c:369 examples/hcal/local_functions.c:383
1222 #: examples/hcal/local_functions.c:384 examples/hcal/local_functions.c:415
1223 msgid "L (Longitude)"
1224 msgstr ""
1225
1226 #: examples/hcal/local_functions.c:446
1227 msgid "z (time zone)"
1228 msgstr ""
1229
1230 #: examples/hcal/local_functions.c:466
1231 msgid "z (timezone)"
1232 msgstr ""
1233
1234 #: examples/hcal/local_functions.c:490
1235 msgid "valid longitude parameter missing for given latitude"
1236 msgstr ""
1237
1238 #: examples/hcal/local_functions.c:495
1239 msgid "valid latitude parameter missing for given longitude"
1240 msgstr ""
1241
1242 #: examples/hcal/local_functions.c:533
1243 msgid "time zone value of"
1244 msgstr ""
1245
1246 #: examples/hcal/local_functions.c:534
1247 msgid "is incompatible with a longitude of"
1248 msgstr ""
1249
1250 #: examples/hcal/local_functions.c:534
1251 msgid "degrees"
1252 msgstr ""
1253
1254 #: examples/hcal/local_functions.c:642
1255 msgid ""
1256 "This seems to be to be your first time using this version.\n"
1257 "Please read the new documentation in the man page and config\n"
1258 "file. Attempting to create a config file ..."
1259 msgstr ""
1260
1261 #: examples/hcal/local_functions.c:676
1262 msgid "failure attempting to create config file"
1263 msgstr ""
1264
1265 #: examples/hcal/local_functions.c:680
1266 msgid "config file created"
1267 msgstr ""
1268
1269 #: examples/hcal/local_functions.c:681
1270 msgid "failure closing"
1271 msgstr ""
1272
1273 #: examples/hcal/local_functions.c:701
1274 msgid "memory allocation failure"
1275 msgstr ""
1276
1277 #: examples/hcal/local_functions.c:915
1278 msgid "your custom menu options (from your config file)"
1279 msgstr ""
1280
1281 #: examples/hcal/local_functions.c:921
1282 msgid "ALERT: -m (--menu) option specified, but no menu items in config file"
1283 msgstr ""
1284
1285 #: examples/hcal/local_functions.c:924
1286 msgid "enter your selection, or <return> to continue"
1287 msgstr ""
1288
1289 #: examples/hcal/local_functions.c:928
1290 msgid "menu selection received was out of bounds"
1291 msgstr ""
1292
1293 #~ msgid "Tamuz"
1294 #~ msgstr "Tamuz"
0 /* libhdate - Hebrew calendar library: http://libhdate.sourceforge.net
1 *
2 * Copyright (C) 2011-2012 Boruch Baum <boruch-baum@users.sourceforge.net>
3 * 2004-2007 Yaacov Zamir <kzamir@walla.co.il>
4 * 1984-2003 Amos Shapir
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 /** @file hdate.h
21 @brief libhdate C language header.
22
23 libhdate - Hebrew calendar library, the C language header file.
24 */
25
26 #ifndef __HDATE_H__
27 #define __HDATE_H__
28
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33
34 /** @def HDATE_DIASPORA_FLAG
35 @brief use diaspora dates and holydays flag
36 */
37 #define HDATE_DIASPORA_FLAG -1
38
39 /** @def HDATE_ISRAEL_FLAG
40 @brief use israel dates and holydays flag
41 */
42 #define HDATE_ISRAEL_FLAG 0
43
44 /** @def HDATE_SHORT_FLAG
45 @brief use short strings flag
46 */
47 #define HDATE_SHORT_FLAG -1
48
49 /** @def HDATE_LONG_FLAG
50 @brief use long strings flag
51 */
52 #define HDATE_LONG_FLAG 0
53
54 /** @def HEBREW_NUMBER_BUFFER_SIZE
55 @brief for hdate_get_int_string_ and hdate_get_int_wstring
56 @note
57 How large should the buffer be? Hebrew year 10,999 would
58 be י'תתקצ"ט, eight characters, each two bytes, plus an
59 end-of-string delimiter, equals 17. This could effectively
60 yield a range extending to Hebrew year 11,899, י"א תתצ"ט,
61 due to the extra ק needed for the '900' century. However,
62 for readability, I would want a an extra space at that
63 point between the millenium and the century...
64 */
65 #define HEBREW_NUMBER_BUFFER_SIZE 17
66 #define HEBREW_WNUMBER_BUFFER_SIZE 9
67
68
69 /** @struct hdate_struct
70 @brief libhdate Hebrew date struct
71 */
72 typedef struct
73 {
74 /** The number of day in the hebrew month (1..31). */
75 int hd_day;
76 /** The number of the hebrew month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). */
77 int hd_mon;
78 /** The number of the hebrew year. */
79 int hd_year;
80 /** The number of the day in the month. (1..31) */
81 int gd_day;
82 /** The number of the month 1..12 (1 - jan). */
83 int gd_mon;
84 /** The number of the year. */
85 int gd_year;
86 /** The day of the week 1..7 (1 - sunday). */
87 int hd_dw;
88 /** The length of the year in days. */
89 int hd_size_of_year;
90 /** The week day of Hebrew new year. */
91 int hd_new_year_dw;
92 /** The number type of year. */
93 int hd_year_type;
94 /** The Julian day number */
95 int hd_jd;
96 /** The number of days passed since 1 tishrey */
97 int hd_days;
98 /** The number of weeks passed since 1 tishrey */
99 int hd_weeks;
100 } hdate_struct;
101
102 /*************************************************************/
103 /*************************************************************/
104
105 /**
106 @brief compute date structure from the Gregorian date
107
108 @param h pointer this hdate struct.
109 @param d Day of month 1..31
110 @param m Month 1..12
111 if m or d is 0 return current date.
112 @param y Year in 4 digits e.g. 2001
113 @return pointer to this hdate struct
114 */
115 hdate_struct *
116 hdate_set_gdate (hdate_struct *h, int d, int m, int y);
117
118 /**
119 @brief compute date structure from the Hebrew date
120
121 @param h pointer this hdate struct.
122 @param d Day of month 1..31
123 @param m Month 1..14 ,(13 - Adar 1, 14 - Adar 2)
124 if m or d is 0 return current date.
125 @param y Year in 4 digits e.g. 5731
126 @return pointer to this hdate struct
127 */
128 hdate_struct *
129 hdate_set_hdate (hdate_struct *h, int d, int m, int y);
130
131 /**
132 @brief compute date structure from the Julian day
133
134 @param h pointer this hdate struct.
135 @param jd the julian day number.
136 @return pointer to this hdate struct
137 */
138 hdate_struct *
139 hdate_set_jd (hdate_struct *h, int jd);
140
141 /*************************************************************/
142 /*************************************************************/
143
144 /**
145 @brief Return a string, with the hebrew date.
146
147 @return NULL pointer upon failure or, upon success, a pointer to a
148 string containing the short ( e.g. "1 Tishrey" ) or long (e.g. "Tuesday
149 18 Tishrey 5763 Hol hamoed Sukot" ) formated date. You must free() the
150 pointer after use.
151
152 @param h The hdate_struct of the date to print.
153 @param diaspora if true give diaspora holydays
154 @param short_format A short flag (true - returns a short string, false returns a long string).
155
156 @warning This was originally written using a local static string,
157 calling for output to be copied away.
158
159 */
160 char *
161 hdate_get_format_date (hdate_struct const * h, int diaspora, int s);
162
163 /**
164 @brief get the number of hebrew parasha.
165
166 @param h pointer this hdate struct.
167 @param diaspora if true give diaspora readings
168 @return the number of parasha 1. Bereshit etc..
169 (55 through 61 are joined strings e.g. Vayakhel Pekudei)
170 */
171 int
172 hdate_get_parasha (hdate_struct const * h, int diaspora);
173
174 /**
175 @brief get the number of hebrew holiday.
176
177 @param h pointer this hdate struct.
178 @param diaspora if true give diaspora holidays
179 @return the number of holiday.
180 */
181 int
182 hdate_get_holyday (hdate_struct const * h, int diaspora);
183
184 /*************************************************************/
185 /*************************************************************/
186
187 /**
188 @brief convert an integer to hebrew string.
189
190 @param n The int to convert ( 0 < n < 11000)
191 @return a string of the hebrew number UTF-8 (logical)
192 @warning DEPRECATION: This function is now just a wrapper for
193 hdate_string, and is subject to deprecation.
194 Callers to this function must free() after using the memory
195 pointed to by the return value.
196 The original function outputted to a local static string,
197 and suggested that the caller copied it away.
198 [deprecation date 2011-12-28]
199 */
200 char *
201 hdate_get_int_string (int n);
202
203
204 /**
205 @brief Return a static string, with name of week day.
206
207 @param day_of_week The number of the day 1..7 (1 - sun).
208 @param short_form A short flag (true - sun; false - sunday).
209 @warning DEPRECATION: This function is now just a wrapper for
210 hdate_string, and is subject to deprecation.
211 [deprecation date 2011-12-28]
212 */
213 char *
214 hdate_get_day_string (int day, int s);
215
216 /**
217 @brief Return a static string, with name of month.
218
219 @param month The number of the month 1..12 (1 - jan).
220 @param short_form A short flag.
221 @warning DEPRECATION: This function is now just a wrapper for
222 hdate_string, and is subject to deprecation.
223 [deprecation date 2011-12-28]
224 */
225 char *
226 hdate_get_month_string (int month, int s);
227
228 /**
229 @brief Return a static string, with name of hebrew month.
230
231 @param month The number of the month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2).
232 @param short_form A short flag.
233 @warning DEPRECATION: This function is now just a wrapper for
234 hdate_string, and is subject to deprecation.
235 [deprecation date 2011-12-28]
236 */
237 char *
238 hdate_get_hebrew_month_string (int month, int s);
239
240 /**
241 @brief Name of hebrew holiday.
242
243 @param holiday The holiday number.
244 @param short_text A short flag. 0=true, !0=false
245 @warning DEPRECATION: This function is now just a wrapper for
246 hdate_string, and is subject to deprecation.
247 [deprecation date 2011-12-28]
248 */
249 char *
250 hdate_get_holyday_string (int holyday, int s);
251
252 /**
253 @brief Name of Parasha
254
255 @param parasha The Number of Parasha 1-Bereshit
256 (55 through 61 are joined strings e.g. Vayakhel Pekudei)
257 @param short_form A short flag. 0=true, !0 = false
258 @warning DEPRECATION: This function is now just a wrapper for
259 hdate_string, and is subject to deprecation.
260 [deprecation date 2011-12-28]
261 */
262 char *
263 hdate_get_parasha_string (int parasha, int s);
264
265 /**
266 @brief Return a static string, with the day in the omer
267
268 @param omer day The day in the omer.
269 @return a pointer to a string with the day in the omer. The caller
270 must free() the pointer after use.
271 @warning DEPRECATION: This function is now just a wrapper for
272 hdate_string, and is subject to deprecation.
273 @attention The prior version of this function returned a pointer to a
274 static string buffer. The current version returns a pointer to
275 a malloc()ed buffer and needs to be free()d after use.
276 [deprecation date 2011-12-28]
277 */
278 char *
279 hdate_get_omer_string (int omer_day);
280
281 /*************************************************************/
282 /*************************************************************/
283
284 /**
285 @brief Return the day in the omer of the given date
286
287 @param h The hdate_struct of the date to use.
288 @return The day in the omer, starting from 1 (or 0 if not in sfirat ha omer)
289 */
290 int
291 hdate_get_omer_day(hdate_struct const * h);
292
293 /**
294 @brief Return number of hebrew holyday type.
295
296 Holiday types:
297 0 - Regular day
298 1 - Yom tov (plus yom kippor)
299 2 - Erev yom kippur
300 3 - Hol hamoed
301 4 - Hanuka and purim
302 5 - Tzomot
303 6 - Independance day and Yom yerushalaim
304 7 - Lag baomer ,Tu beav, Tu beshvat
305 8 - Tzahal and Holocaust memorial days
306 9 - National days
307
308 @param holyday the holyday number
309 @return the number of holyday type.
310 */
311 int
312 hdate_get_holyday_type (int holyday);
313
314 /**
315 @brief size of hebrew year in days.
316
317 @param hebrew_year the hebrew year.
318 @return size of Hebrew year
319 */
320 int
321 hdate_get_size_of_hebrew_year (int hebrew_year);
322
323 /*************************************************************/
324 /*************************************************************/
325
326 /**
327 @brief Days since Tishrey 3744
328
329 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
330
331 @param hebrew_year The Hebrew year
332 @return Number of days since 3,1,3744
333 */
334 int
335 hdate_days_from_3744 (int hebrew_year);
336
337 /**
338 @brief Return Hebrew year type based on size and first week day of year.
339
340 @param size_of_year Length of year in days
341 @param new_year_dw First week day of year
342 @return the number for year type (1..14)
343 */
344 int
345 hdate_get_year_type (int size_of_year, int new_year_dw);
346
347 /**
348 @brief Compute Julian day from Gregorian date
349
350 @author Yaacov Zamir (algorithm from Henry F. Fliegel and Thomas C. Van Flandern ,1968)
351
352 @param day Day of month 1..31
353 @param month Month 1..12
354 @param year Year in 4 digits e.g. 2001
355 @return the julian day number
356 */
357 int
358 hdate_gdate_to_jd (int day, int month, int year);
359
360 /**
361 @brief Compute Julian day from Hebrew day, month and year
362
363 @author Amos Shapir 1984 (rev. 1985, 1992) Yaacov Zamir 2003-2005
364
365 @param day Day of month 1..31
366 @param month Month 1..14 (13 - Adar 1, 14 - Adar 2)
367 @param year Hebrew year in 4 digits e.g. 5753
368 @param jd_tishrey1 return the julian number of 1 Tishrey this year
369 @param jd_tishrey1_next_year return the julian number of 1 Tishrey next year
370 @return the julian day number
371 */
372 int
373 hdate_hdate_to_jd (int day, int month, int year, int *jd_tishrey1, int *jd_tishrey1_next_year);
374
375 /**
376 @brief Converting from the Julian day to the Gregorian date
377
378 @author Yaacov Zamir (Algorithm, Henry F. Fliegel and Thomas C. Van Flandern ,1968)
379
380 @param jd Julian day
381 @param day return Day of month 1..31
382 @param month return Month 1..12
383 @param year return Year in 4 digits e.g. 2001
384 */
385 void
386 hdate_jd_to_gdate (int jd, int *day, int *month, int *year);
387
388 /**
389 @brief Converting from the Julian day to the Hebrew day
390
391 @author Yaacov Zamir 2005
392
393 @param jd Julian day
394 @param day return Day of month 1..31
395 @param month return Month 1..14 (13 - Adar 1, 14 - Adar 2)
396 @param year return Year in 4 digits e.g. 2001
397 @param jd_tishrey1 return the julian number of 1 Tishrey this year
398 @param jd_tishrey1_next_year return the julian number of 1 Tishrey next year
399 */
400 void
401 hdate_jd_to_hdate (int jd, int *day, int *month, int *year, int *jd_tishrey1, int *jd_tishrey1_next_year);
402
403 /*************************************************************/
404 /*************************************************************/
405
406 /**
407 @brief days from 1 january
408
409 @param day this day of month
410 @param month this month
411 @param year this year
412 @return the days from 1 jan
413 */
414 int
415 hdate_get_day_of_year (int day, int month, int year);
416
417 /**
418 @brief utc sun times for altitude at a gregorian date
419
420 Returns the sunset and sunrise times in minutes from 00:00 (utc time)
421 if sun altitude in sunrise is deg degries.
422 This function only works for altitudes sun realy is.
423 If the sun never get to this altitude, the returned sunset and sunrise values
424 will be negative. This can happen in low altitude when latitude is
425 nearing the pols in winter times, the sun never goes very high in
426 the sky there.
427
428 @param day this day of month
429 @param month this month
430 @param year this year
431 @param longitude longitude to use in calculations
432 @param latitude latitude to use in calculations
433 @param deg degrees of sun's altitude (0 - Zenith .. 90 - Horizon)
434 @param sunrise return the utc sunrise in minutes
435 @param sunset return the utc sunset in minutes
436 */
437 void
438 hdate_get_utc_sun_time_deg (int day, int month, int year,
439 double latitude, double longitude, double deg, int *sunrise, int *sunset);
440
441 /**
442 @brief utc sunrise/set time for a gregorian date
443
444 @param day this day of month
445 @param month this month
446 @param year this year
447 @param longitude longitude to use in calculations
448 degrees, negative values are east
449 @param latitude latitude to use in calculations
450 degrees, negative values are south
451 @param sunrise return the utc sunrise in minutes after midnight (00:00)
452 @param sunset return the utc sunset in minutes after midnight (00:00)
453 */
454 void
455 hdate_get_utc_sun_time (int day, int month, int year,
456 double latitude, double longitude, int *sunrise, int *sunset);
457
458 /**
459 @brief utc sunrise/set time for a gregorian date
460
461 @param day this day of month
462 @param month this month
463 @param year this year
464 @param longitude longitude to use in calculations
465 @param latitude latitude to use in calculations
466 @param sun_hour return the length of shaa zaminit in minutes
467 @param first_light return the utc alut ha-shachar in minutes
468 @param talit return the utc tphilin and talit in minutes
469 @param sunrise return the utc sunrise in minutes
470 @param midday return the utc midday in minutes
471 @param sunset return the utc sunset in minutes
472 @param first_stars return the utc tzeit hacochavim in minutes
473 @param three_stars return the utc shlosha cochavim in minutes
474 */
475 void
476 hdate_get_utc_sun_time_full (int day, int month, int year, double latitude, double longitude,
477 int *sun_hour, int *first_light, int *talit, int *sunrise,
478 int *midday, int *sunset, int *first_stars, int *three_stars);
479
480 /*************************************************************/
481 /*************************************************************/
482
483 /**
484 @brief get the Gregorian day of the month
485
486 @param h pointer this hdate struct.
487 @return the Gregorian day of the month, 1..31.
488 */
489 int
490 hdate_get_gday (hdate_struct const * h);
491
492 /**
493 @brief get the Gregorian month
494
495 @param h pointer this hdate struct.
496 @return the Gregorian month, jan = 1.
497 */
498 int
499 hdate_get_gmonth (hdate_struct const * h);
500
501 /**
502 @brief get the Gregorian year
503
504 @param h pointer this hdate struct.
505 @return the Gregorian year.
506 */
507 int
508 hdate_get_gyear (hdate_struct const * h);
509
510 /**
511 @brief get the Hebrew day of the month
512
513 @param h pointer this hdate struct.
514 @return the Hebrew day of the month, 1..30.
515 */
516 int
517 hdate_get_hday (hdate_struct const * h);
518
519 /**
520 @brief get the Hebrew month
521
522 @param h pointer this hdate struct.
523 @return the Hebrew month, Tishery = 1 .. Adar I =13, Adar II = 14.
524 */
525 int
526 hdate_get_hmonth (hdate_struct const * h);
527
528 /**
529 @brief get the Hebrew year
530
531 @param h pointer this hdate struct.
532 @return the Hebrew year.
533 */
534 int
535 hdate_get_hyear (hdate_struct const * h);
536
537 /**
538 @brief get the day of the week
539
540 @param h pointer this hdate struct.
541 @return the the day of the week.
542 */
543 int
544 hdate_get_day_of_the_week (hdate_struct const * h);
545
546 /**
547 @brief get the size of the hebrew year
548
549 @param h pointer this hdate struct.
550 @return the the size of the hebrew year.
551 */
552 int
553 hdate_get_size_of_year (hdate_struct const * h);
554
555 /**
556 @brief get the new year day of the week
557
558 @param h pointer this hdate struct.
559 @return the the new year day of the week.
560 */
561 int
562 hdate_get_new_year_day_of_the_week (hdate_struct const * h);
563
564 /**
565 @brief get the Julian day number
566
567 @param h pointer this hdate struct.
568 @return the Julian day number.
569 */
570 int
571 hdate_get_julian (hdate_struct const * h);
572
573 /**
574 @brief get the number of days passed since 1 tishrey
575
576 @param h pointer this hdate struct.
577 @return the number of days passed since 1 tishrey.
578 */
579 int
580 hdate_get_days (hdate_struct const * h);
581
582 /**
583 @brief get the number of weeks passed since 1 tishrey
584
585 @param h pointer this hdate struct.
586 @return the number of weeks passed since 1 tishrey.
587 */
588 int
589 hdate_get_weeks (hdate_struct const * h);
590
591 /*************************************************************/
592 /*************************************************************/
593
594 /**
595 @brief creat a new hdate struct object, must be deleted using delete_hdate.
596
597 @return a new hdate object
598 */
599 hdate_struct *
600 new_hdate ();
601
602 /**
603 @brief delete an hdate struct object.
604
605 @param h pointer this hdate struct.
606 */
607 hdate_struct *
608 delete_hdate (hdate_struct *h);
609
610 /*************************************************************/
611 /*************************************************************/
612
613 /**
614 @brief Return a static string, with the package name and version
615
616 @return a static string, with the package name and version
617 */
618 char *
619 hdate_get_version_string ();
620
621 /**
622 @brief name of translator
623
624 @return a static string with name of translator, or NULL if none.
625 */
626 char *
627 hdate_get_translator_string ();
628
629 /**
630 @brief helper function to find hebrew locale
631
632 @return 0 - latin locale, -1 - hebrew locale
633 */
634 int
635 hdate_is_hebrew_locale();
636
637 /**
638 @brief Return string values for hdate information
639 @return a pointer to a string containing the information. In the cases
640 integers and omer, the strings will NOT be static, and the
641 caller must free() them after use. Returns a null pointer
642 upon failure.
643 @param type_of_string 0 = integer, 1 = day of week, 2 = parshaot,
644 3 = hmonth, 4 = gmonth, 5 = holiday, 6 = omer
645 @param index integer ( 0 < n < 11000)
646 day of week ( 0 < n < 8 )
647 parshaot ( 0 , n < 62 )
648 hmonth ( 0 < n < 15 )
649 gmonth ( 0 < n < 13 )
650 holiday ( 0 < n < 37 )
651 omer ( 0 < n < 50 )
652 @param short_form 0 = short format
653 @param hebrew_form 0 = not hebrew (native/embedded)
654 */
655 char* hdate_string( int type_of_string, int index, int short_form, int hebrew_form);
656
657 /** @def HDATE_STRING_INT
658 @brief for function hdate_string: identifies string type: integer
659 */
660 #define HDATE_STRING_INT 0
661
662 /** @def HDATE_STRING_DOW
663 @brief for function hdate_string: identifies string type: day of week
664 */
665 #define HDATE_STRING_DOW 1
666
667 /** @def HDATE_STRING_PARASHA
668 @brief for function hdate_string: identifies string type: parasha
669 */
670 #define HDATE_STRING_PARASHA 2
671
672 /** @def HDATE_STRING_HMONTH
673 @brief for function hdate_string: identifies string type: hebrew_month
674 */
675 #define HDATE_STRING_HMONTH 3
676
677 /** @def HDATE_STRING_GMONTH
678 @brief for function hdate_string: identifies string type: gregorian_month
679 */
680 #define HDATE_STRING_GMONTH 4
681
682 /** @def HDATE_STRING_HOLIDAY
683 @brief for function hdate_string: identifies string type: holiday
684 */
685 #define HDATE_STRING_HOLIDAY 5
686
687 /** @def HDATE_STRING_HOLIDAY
688 @brief for function hdate_string: identifies string type: holiday
689 */
690 #define HDATE_STRING_OMER 6
691
692 /** @def HDATE_STRING_SHORT
693 @brief for function hdate_string: use short form, if one exists
694 */
695 #define HDATE_STRING_SHORT 1
696
697 /** @def HDATE_STRING_LONG
698 @brief for function hdate_string: use long form
699 */
700 #define HDATE_STRING_LONG 0
701
702 /** @def HDATE_STRING_HEBREW
703 @brief for function hdate_string: use embedded hebrew string
704 */
705 #define HDATE_STRING_HEBREW 1
706
707 /** @def HDATE_STRING_LOCAL
708 @brief for function hdate_string: use local locale string
709 */
710 #define HDATE_STRING_LOCAL 0
711
712
713
714 #ifdef __cplusplus
715 }
716 #endif
717
718 #endif
1515 libhdate_LDFLAGS = -z relro -z now
1616
1717
18 libhdatedocdir = ${prefix}/share/doc/libhdate
18 libhdatedocdir = ${prefix}/share/doc/libhdate1
1919 libhdatedoc_DATA = \
2020 README\
2121 COPYING\
1010
1111
1212 hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so
13 g++ -fpic -c hdate_wrap.cxx $(CFLAGS) $(CPPFLAGS) $(PE_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so $(LDFLAGS)
1515
1616 hdate_wrap.cxx: hdate.i
1717 swig -perl -c++ hdate.i
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
0 # Makefile.in generated by automake 1.15 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
4
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
1413
1514 @SET_MAKE@
1615 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
16 am__is_gnu_make = { \
17 if test -z '$(MAKELEVEL)'; then \
18 false; \
19 elif test -n '$(MAKE_HOST)'; then \
20 true; \
21 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
22 true; \
23 else \
24 false; \
25 fi; \
26 }
27 am__make_running_with_option = \
28 case $${target_option-} in \
29 ?) ;; \
30 *) echo "am__make_running_with_option: internal error: invalid" \
31 "target option '$${target_option-}' specified" >&2; \
32 exit 1;; \
33 esac; \
34 has_opt=no; \
35 sane_makeflags=$$MAKEFLAGS; \
36 if $(am__is_gnu_make); then \
37 sane_makeflags=$$MFLAGS; \
38 else \
2039 case $$MAKEFLAGS in \
2140 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
41 bs=\\; \
42 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
43 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
3144 esac; \
32 test $$am__dry = yes; \
33 }
45 fi; \
46 skip_next=no; \
47 strip_trailopt () \
48 { \
49 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
50 }; \
51 for flg in $$sane_makeflags; do \
52 test $$skip_next = yes && { skip_next=no; continue; }; \
53 case $$flg in \
54 *=*|--*) continue;; \
55 -*I) strip_trailopt 'I'; skip_next=yes;; \
56 -*I?*) strip_trailopt 'I';; \
57 -*O) strip_trailopt 'O'; skip_next=yes;; \
58 -*O?*) strip_trailopt 'O';; \
59 -*l) strip_trailopt 'l'; skip_next=yes;; \
60 -*l?*) strip_trailopt 'l';; \
61 -[dEDm]) skip_next=yes;; \
62 -[JT]) skip_next=yes;; \
63 esac; \
64 case $$flg in \
65 *$$target_option*) has_opt=yes; break;; \
66 esac; \
67 done; \
68 test $$has_opt = yes
69 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
70 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
3471 pkgdatadir = $(datadir)/@PACKAGE@
3572 pkgincludedir = $(includedir)/@PACKAGE@
3673 pkglibdir = $(libdir)/@PACKAGE@
5087 build_triplet = @build@
5188 host_triplet = @host@
5289 subdir = bindings/perl
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
5490 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
5591 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
5692 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
6298 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
6399 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64100 $(ACLOCAL_M4)
101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
65102 mkinstalldirs = $(install_sh) -d
66103 CONFIG_CLEAN_FILES =
67104 CONFIG_CLEAN_VPATH_FILES =
105 AM_V_P = $(am__v_P_@AM_V@)
106 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
107 am__v_P_0 = false
108 am__v_P_1 = :
109 AM_V_GEN = $(am__v_GEN_@AM_V@)
110 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
111 am__v_GEN_0 = @echo " GEN " $@;
112 am__v_GEN_1 =
113 AM_V_at = $(am__v_at_@AM_V@)
114 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
115 am__v_at_0 = @
116 am__v_at_1 =
68117 SOURCES =
69118 DIST_SOURCES =
70119 am__can_run_installinfo = \
72121 n|no|NO) false;; \
73122 *) (install-info --version) >/dev/null 2>&1;; \
74123 esac
124 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
125 am__DIST_COMMON = $(srcdir)/Makefile.in
75126 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76127 ACLOCAL = @ACLOCAL@
77128 AMTAR = @AMTAR@
129 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
78130 AR = @AR@
79131 AUTOCONF = @AUTOCONF@
80132 AUTOHEADER = @AUTOHEADER@
122174 LTLIBICONV = @LTLIBICONV@
123175 LTLIBINTL = @LTLIBINTL@
124176 LTLIBOBJS = @LTLIBOBJS@
177 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
125178 MAINT = @MAINT@
126179 MAKEINFO = @MAKEINFO@
127180 MANIFEST_TOOL = @MANIFEST_TOOL@
221274 prefix = @prefix@
222275 program_transform_name = @program_transform_name@
223276 psdir = @psdir@
277 runstatedir = @runstatedir@
224278 sbindir = @sbindir@
225279 sharedstatedir = @sharedstatedir@
226280 srcdir = @srcdir@
247301 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/perl/Makefile'; \
248302 $(am__cd) $(top_srcdir) && \
249303 $(AUTOMAKE) --gnu bindings/perl/Makefile
250 .PRECIOUS: Makefile
251304 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252305 @case '$?' in \
253306 *config.status*) \
271324
272325 clean-libtool:
273326 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
327 tags TAGS:
328
329 ctags CTAGS:
330
331 cscope cscopelist:
279332
280333
281334 distdir: $(DISTFILES)
413466 .MAKE: install-am install-strip
414467
415468 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
469 cscopelist-am ctags-am distclean distclean-generic \
470 distclean-libtool distdir dvi dvi-am html html-am info info-am \
471 install install-am install-data install-data-am \
472 install-data-local install-dvi install-dvi-am install-exec \
473 install-exec-am install-html install-html-am install-info \
474 install-info-am install-man install-pdf install-pdf-am \
475 install-ps install-ps-am install-strip installcheck \
476 installcheck-am installdirs maintainer-clean \
477 maintainer-clean-generic mostlyclean mostlyclean-generic \
478 mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
479 uninstall-am
480
481 .PRECIOUS: Makefile
426482
427483
428484 @WITH_PERL_TRUE@all-am: hdate.so
429485
430486 @WITH_PERL_TRUE@hdate.so: hdate_wrap.cxx
431 @WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PE_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PERL_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o hdate.so
487 @WITH_PERL_TRUE@ g++ -fpic -c hdate_wrap.cxx $(CFLAGS) $(CPPFLAGS) $(PE_CFLAGS) -I$(top_srcdir)/src
488 @WITH_PERL_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o hdate.so $(LDFLAGS)
433489
434490 @WITH_PERL_TRUE@hdate_wrap.cxx: hdate.i
435491 @WITH_PERL_TRUE@ swig -perl -c++ hdate.i
1111
1212 hdate.so: hdate_wrap.cpp
1313 g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp
14 gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so
14 gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -lstdc++ -o hdate.so
1515
1616 hdate_wrap.cpp: hdate.i
1717 swig -php5 -c++ hdate.i
429429
430430 @WITH_PHP_TRUE@hdate.so: hdate_wrap.cpp
431431 @WITH_PHP_TRUE@ g++ -I$(top_srcdir)/src `php-config --includes` -fpic -c hdate_wrap.cpp
432 @WITH_PHP_TRUE@ gcc -shared ../../src/.libs/libhdate.so hdate_wrap.o -lstdc++ -o hdate.so
432 @WITH_PHP_TRUE@ gcc -shared hdate_wrap.o ../../src/.libs/libhdate.so -lstdc++ -o hdate.so
433433
434434 @WITH_PHP_TRUE@hdate_wrap.cpp: hdate.i
435435 @WITH_PHP_TRUE@ swig -php5 -c++ hdate.i
1010
1111
1212 _hdate.so: hdate_wrap.cxx
13 g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so
13 g++ -fpic -c hdate_wrap.cxx $(CPPFLAGS) $(CFLAGS) $(PY_CFLAGS) -I$(top_srcdir)/src
14 g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so $(LDFLAGS)
1515
1616 hdate_wrap.cxx: hdate.i
1717 swig -python -c++ hdate.i
0 # Makefile.in generated by automake 1.11.6 from Makefile.am.
0 # Makefile.in generated by automake 1.15 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
4
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
1413
1514 @SET_MAKE@
1615 VPATH = @srcdir@
17 am__make_dryrun = \
18 { \
19 am__dry=no; \
16 am__is_gnu_make = { \
17 if test -z '$(MAKELEVEL)'; then \
18 false; \
19 elif test -n '$(MAKE_HOST)'; then \
20 true; \
21 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
22 true; \
23 else \
24 false; \
25 fi; \
26 }
27 am__make_running_with_option = \
28 case $${target_option-} in \
29 ?) ;; \
30 *) echo "am__make_running_with_option: internal error: invalid" \
31 "target option '$${target_option-}' specified" >&2; \
32 exit 1;; \
33 esac; \
34 has_opt=no; \
35 sane_makeflags=$$MAKEFLAGS; \
36 if $(am__is_gnu_make); then \
37 sane_makeflags=$$MFLAGS; \
38 else \
2039 case $$MAKEFLAGS in \
2140 *\\[\ \ ]*) \
22 echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
23 | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
24 *) \
25 for am__flg in $$MAKEFLAGS; do \
26 case $$am__flg in \
27 *=*|--*) ;; \
28 *n*) am__dry=yes; break;; \
29 esac; \
30 done;; \
41 bs=\\; \
42 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
43 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
3144 esac; \
32 test $$am__dry = yes; \
33 }
45 fi; \
46 skip_next=no; \
47 strip_trailopt () \
48 { \
49 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
50 }; \
51 for flg in $$sane_makeflags; do \
52 test $$skip_next = yes && { skip_next=no; continue; }; \
53 case $$flg in \
54 *=*|--*) continue;; \
55 -*I) strip_trailopt 'I'; skip_next=yes;; \
56 -*I?*) strip_trailopt 'I';; \
57 -*O) strip_trailopt 'O'; skip_next=yes;; \
58 -*O?*) strip_trailopt 'O';; \
59 -*l) strip_trailopt 'l'; skip_next=yes;; \
60 -*l?*) strip_trailopt 'l';; \
61 -[dEDm]) skip_next=yes;; \
62 -[JT]) skip_next=yes;; \
63 esac; \
64 case $$flg in \
65 *$$target_option*) has_opt=yes; break;; \
66 esac; \
67 done; \
68 test $$has_opt = yes
69 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
70 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
3471 pkgdatadir = $(datadir)/@PACKAGE@
3572 pkgincludedir = $(includedir)/@PACKAGE@
3673 pkglibdir = $(libdir)/@PACKAGE@
5087 build_triplet = @build@
5188 host_triplet = @host@
5289 subdir = bindings/python
53 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
5490 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
5591 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
5692 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
6298 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
6399 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64100 $(ACLOCAL_M4)
101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
65102 mkinstalldirs = $(install_sh) -d
66103 CONFIG_CLEAN_FILES =
67104 CONFIG_CLEAN_VPATH_FILES =
105 AM_V_P = $(am__v_P_@AM_V@)
106 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
107 am__v_P_0 = false
108 am__v_P_1 = :
109 AM_V_GEN = $(am__v_GEN_@AM_V@)
110 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
111 am__v_GEN_0 = @echo " GEN " $@;
112 am__v_GEN_1 =
113 AM_V_at = $(am__v_at_@AM_V@)
114 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
115 am__v_at_0 = @
116 am__v_at_1 =
68117 SOURCES =
69118 DIST_SOURCES =
70119 am__can_run_installinfo = \
72121 n|no|NO) false;; \
73122 *) (install-info --version) >/dev/null 2>&1;; \
74123 esac
124 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
125 am__DIST_COMMON = $(srcdir)/Makefile.in
75126 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76127 ACLOCAL = @ACLOCAL@
77128 AMTAR = @AMTAR@
129 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
78130 AR = @AR@
79131 AUTOCONF = @AUTOCONF@
80132 AUTOHEADER = @AUTOHEADER@
122174 LTLIBICONV = @LTLIBICONV@
123175 LTLIBINTL = @LTLIBINTL@
124176 LTLIBOBJS = @LTLIBOBJS@
177 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
125178 MAINT = @MAINT@
126179 MAKEINFO = @MAKEINFO@
127180 MANIFEST_TOOL = @MANIFEST_TOOL@
221274 prefix = @prefix@
222275 program_transform_name = @program_transform_name@
223276 psdir = @psdir@
277 runstatedir = @runstatedir@
224278 sbindir = @sbindir@
225279 sharedstatedir = @sharedstatedir@
226280 srcdir = @srcdir@
247301 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \
248302 $(am__cd) $(top_srcdir) && \
249303 $(AUTOMAKE) --gnu bindings/python/Makefile
250 .PRECIOUS: Makefile
251304 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
252305 @case '$?' in \
253306 *config.status*) \
271324
272325 clean-libtool:
273326 -rm -rf .libs _libs
274 tags: TAGS
275 TAGS:
276
277 ctags: CTAGS
278 CTAGS:
327 tags TAGS:
328
329 ctags CTAGS:
330
331 cscope cscopelist:
279332
280333
281334 distdir: $(DISTFILES)
413466 .MAKE: install-am install-strip
414467
415468 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
416 distclean distclean-generic distclean-libtool distdir dvi \
417 dvi-am html html-am info info-am install install-am \
418 install-data install-data-am install-data-local install-dvi \
419 install-dvi-am install-exec install-exec-am install-html \
420 install-html-am install-info install-info-am install-man \
421 install-pdf install-pdf-am install-ps install-ps-am \
422 install-strip installcheck installcheck-am installdirs \
423 maintainer-clean maintainer-clean-generic mostlyclean \
424 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
425 uninstall uninstall-am
469 cscopelist-am ctags-am distclean distclean-generic \
470 distclean-libtool distdir dvi dvi-am html html-am info info-am \
471 install install-am install-data install-data-am \
472 install-data-local install-dvi install-dvi-am install-exec \
473 install-exec-am install-html install-html-am install-info \
474 install-info-am install-man install-pdf install-pdf-am \
475 install-ps install-ps-am install-strip installcheck \
476 installcheck-am installdirs maintainer-clean \
477 maintainer-clean-generic mostlyclean mostlyclean-generic \
478 mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
479 uninstall-am
480
481 .PRECIOUS: Makefile
426482
427483
428484 @WITH_PYTHON_TRUE@all-am: _hdate.so
429485
430486 @WITH_PYTHON_TRUE@_hdate.so: hdate_wrap.cxx
431 @WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(PY_CFLAGS) -I$(top_srcdir)/src
432 @WITH_PYTHON_TRUE@ g++ -shared ../../src/.libs/libhdate.so hdate_wrap.o -o _hdate.so
487 @WITH_PYTHON_TRUE@ g++ -fpic -c hdate_wrap.cxx $(CPPFLAGS) $(CFLAGS) $(PY_CFLAGS) -I$(top_srcdir)/src
488 @WITH_PYTHON_TRUE@ g++ -shared hdate_wrap.o ../../src/.libs/libhdate.so -o _hdate.so $(LDFLAGS)
433489
434490 @WITH_PYTHON_TRUE@hdate_wrap.cxx: hdate.i
435491 @WITH_PYTHON_TRUE@ swig -python -c++ hdate.i
1111
1212 hdate.so: hdate_wrap.cxx
1313 g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src
14 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
14 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
1515
1616 hdate_wrap.cxx: hdate.i
1717 swig -c++ -ruby hdate.i
429429
430430 @WITH_RUBY_TRUE@hdate.so: hdate_wrap.cxx
431431 @WITH_RUBY_TRUE@ g++ -fpic -fno-strict-aliasing -g -O2 -c hdate_wrap.cxx $(RU_CFLAGS) -I$(top_srcdir)/src
432 @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
432 @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
433433
434434 @WITH_RUBY_TRUE@hdate_wrap.cxx: hdate.i
435435 @WITH_RUBY_TRUE@ swig -c++ -ruby hdate.i
3232 AC_CONFIG_MACRO_DIR([m4])
3333 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
3434
35 CFLAGS=" -Wall -g -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O1 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie"
3635 LIBS=-lm
3736
3837 dnl =======================================================================================
0 libhdate (1.6.02-2.1) unstable; urgency=medium
1
2 * Non-maintainer upload.
3 * Drop python-hdate, there are no remaining rdeps remaining
4 (Closes: #936873)
5
6 -- Moritz Muehlenhoff <jmm@debian.org> Sun, 02 Aug 2020 23:13:33 +0200
7
08 libhdate (1.6.02-2) unstable; urgency=medium
19
210 * Update maintainer address (Closes: #899576)
66 Vcs-Git: https://salsa.debian.org/hebrew-team/libhdate.git
77 Build-Depends: debhelper (>= 9),
88 swig,
9 python-dev (>= 2.6.6-3~),
10 dh-python,
119 dh-autoreconf,
1210 Standards-Version: 3.9.8
1311 Homepage: http://libhdate.sourceforge.net/
2422 .
2523 This package contains headers and support files required
2624 to build new applications with libhdate.
27
28 Package: python-hdate
29 Section: python
30 Architecture: any
31 Provides: ${python:Provides}
32 Depends: libhdate1 (= ${binary:Version}), ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
33 Description: Provides a library that help use Hebrew dates (Python bindings)
34 LibHdate is a small C,C++ library for Hebrew dates,
35 holidays, and reading sequence (parasha). It is using
36 the source code from Amos Shapir's "hdate" package fixed and
37 patched by Nadav Har'El. The Torah reading sequence
38 is from tables by Zvi Har'El.
39 .
40 This package contains Python bindings to libhdate
4125
4226 Package: libhdate-perl
4327 Section: perl
+0
-1
debian/python-hdate.install less more
0 usr/lib/python*/*
22 ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
33
44 %:
5 dh $* --with python2,autoreconf
5 dh $* --with autoreconf
66
77 override_dh_auto_configure:
88 dh_auto_configure -- --with-perl-sitelib-dir=$(ARCHLIB)
9
10 override_dh_python2:
11 dh_python2 -s --no-guessing-versions
289289 .PP
290290 for hdate_get_int_string_ and hdate_get_int_wstring \fBNote:\fP
291291 .RS 4
292 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\&.\&.\&.
292 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\&.\&.\&.
293293 .RE
294294 .PP
295295
385385 Return a string, with the hebrew date\&. \fBReturns:\fP
386386 .RS 4
387387 NULL pointer upon failure or, upon success, a pointer to a string containing the short ( e\&.g\&. '1 Tishrey' ) or long (e\&.g\&. 'Tuesday
388 18 Tishrey 5763 Hol hamoed Sukot' ) formated date\&. You must free() the pointer after use\&.
388 18 Tishrey 5763 Hol hamoed Sukot' ) formatted date\&. You must free() the pointer after use\&.
389389 .RE
390390 .PP
391391 \fBParameters:\fP
3535 .ti -1c
3636 .RI "char * \fBget_format_date\fP (int s)"
3737 .br
38 .RI "\fIget formated hebrew date. \fP"
38 .RI "\fIget formatted hebrew date. \fP"
3939 .ti -1c
4040 .RI "char * \fBget_day_of_week_string\fP (int s)"
4141 .br
230230
231231 .SS "char* hdate::Hdate::get_format_date (int s)\fC [inline]\fP"
232232 .PP
233 get formated hebrew date.
234 .PP
235 return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formated date.
233 get formatted hebrew date.
234 .PP
235 return the short ( e.g. '1 Tishrey' ) or long (e.g. 'Tuesday 18 Tishrey 5763 Hol hamoed Sukot' ) formatted date.
236236 .PP
237237 \fBParameters:\fP
238238 .RS 4
1919 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2020 */
2121
22 #define _GNU_SOURCE // for mempcpy
2322 #include <stdio.h> // For printf
2423 #include <hdate.h> // For hebrew date
2524 //#include "../../src/hdate.h"
161160 # and its (limited, and maybe biased) of the dominant Jewish community\n\
162161 # in that timezone. When hcal is forced to guess, it alerts the user\n\
163162 # with a message that includes the guessed location.\n\
164 # hcal's guesses will also affect its default behaviour for ouput of\n\
163 # hcal's guesses will also affect its default behaviour for output of\n\
165164 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n\
166165 #SUNSET_AWARE=TRUE\n\
167166 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
677676 }
678677
679678
680 /**************************************************
681 * print column headings for days of weeks
682 **************************************************/
683 void print_header_dow_line_stdout( const int colorize )
684 {
685 int column;
686
687679 void print_dow_column( int column )
688680 {
689681 if (hdate_is_hebrew_locale())
700692
701693 if (column != 7) printf (" ");
702694 }
695
696 /**************************************************
697 * print column headings for days of weeks
698 **************************************************/
699 void print_header_dow_line_stdout( const int colorize )
700 {
701 int column;
703702
704703 if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES);
705704 for (column = 1; column < 7; column++) print_dow_column(column);
11521151
11531152
11541153
1154 void how_many_calendar_lines( int month, int start_dow, int *max_calendar_lines )
1155 {
1156 switch (month)
1157 {
1158 case 4:
1159 case 6:
1160 case 9:
1161 case 11: if (start_dow == 7) *max_calendar_lines = 6;
1162 else if (*max_calendar_lines == 4) *max_calendar_lines = 5;
1163 break;
1164 case 1:
1165 case 3:
1166 case 5:
1167 case 7:
1168 case 8:
1169 case 10:
1170 case 12: if (start_dow > 5) *max_calendar_lines = 6;
1171 else if (*max_calendar_lines == 4) *max_calendar_lines = 5;
1172 break;
1173 case 2: if (start_dow > 1 && *max_calendar_lines == 4) *max_calendar_lines = 5;
1174 break;
1175 }
1176 }
1177
11551178 /**************************************************
11561179 * print month table
11571180 *************************************************/
11681191 /// suppress warning "may be used uninitialized in this function [-Wmaybe-uninitialized]"
11691192 int jd_current_month, jd_previous_month = 1, jd_next_month = 1;
11701193
1171 void how_many_calendar_lines( int month, int start_dow )
1172 {
1173 switch (month)
1174 {
1175 case 4:
1176 case 6:
1177 case 9:
1178 case 11: if (start_dow == 7) max_calendar_lines = 6;
1179 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1180 break;
1181 case 1:
1182 case 3:
1183 case 5:
1184 case 7:
1185 case 8:
1186 case 10:
1187 case 12: if (start_dow > 5) max_calendar_lines = 6;
1188 else if (max_calendar_lines == 4) max_calendar_lines = 5;
1189 break;
1190 case 2: if (start_dow > 1 && max_calendar_lines == 4) max_calendar_lines = 5;
1191 break;
1192 }
1193 }
1194
11951194 /*********************************************************
11961195 * Preliminaries:
11971196 * - Find the first sunday(s) of each calendar
11991198 *********************************************************/
12001199 hdate_set_gdate (&h, 1, current_month, current_year);
12011200 jd_current_month = h.hd_jd - h.hd_dw + 1;
1202 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1201 how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines );
12031202
12041203 /*********************************************************
12051204 * three months, side-by-side
12211220 }
12221221 hdate_set_gdate (&h, 1, previous_month, previous_year);
12231222 jd_previous_month = h.hd_jd - h.hd_dw + 1;
1224 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1223 how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines );
12251224
12261225 /*********************************************************
12271226 * next month
12381237 }
12391238 hdate_set_gdate (&h, 1, next_month, next_year);
12401239 jd_next_month = h.hd_jd - h.hd_dw + 1;
1241 how_many_calendar_lines( h.gd_mon, h.hd_dw );
1240 how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines );
12421241 }
12431242
12441243
1919 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2020 */
2121
22 #define _GNU_SOURCE // For mempcpy, asprintf
2322 #include <hdate.h> // For hebrew date
2423 //#include "../../src/hdate.h"
2524 #include <stdlib.h> // For atoi, getenv, setenv
101100 # and its (limited, and maybe biased) of the dominant Jewish community\n\
102101 # in that timezone. When hdate is forced to guess, it alerts the user\n\
103102 # with a message that includes the guessed location.\n\
104 # hdate's guesses will also affect its default behaviour for ouput of\n\
103 # hdate's guesses will also affect its default behaviour for output of\n\
105104 # Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n\
106105 #SUNSET_AWARE=TRUE\n\
107106 # LATITUDE and LONGITUDE may be in decimal format or in the form\n\
2424 /**************************************************
2525 * functions to support hcal and hdate
2626 **************************************************/
27 #define _GNU_SOURCE // For mempcpy, asprintf
2827
2928 #include <hdate.h> // For hebrew date
3029 //include "../../src/hdate.h"
251250
252251 #define DEBUG 0
253252 #if DEBUG
254 printf("\nrevstr: entry: sourcelen = %ld, source = %s\n",source_len, source);
253 printf("\nrevstr: entry: sourcelen = %zd, source = %s\n",source_len, source);
255254 #endif
256255
257256 if (source == NULL) {error(0,0,"revstr: source buffer pointer is NULL"); exit(0);};
258 if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %ld",source_len); exit(0);};
257 if (source_len <= 0) {error(0,0,"revstr: source_len parameter invalid, %zd",source_len); exit(0);};
259258
260259 size_t i,j;
261260 char *temp_buff;
276275 memcpy(source, temp_buff, source_len);
277276 source[source_len] = '\0';
278277 #if DEBUG
279 printf("\nrevstr: before free(tempbuff): sourcelen = %ld, source = %s\n",source_len, source);
278 printf("\nrevstr: before free(tempbuff): sourcelen = %zd, source = %s\n",source_len, source);
280279 #endif
281280 free(temp_buff);
282281 return;
645644 }
646645
647646
648 /************************************************************
649 * Open config file, or create one
650 * - returns filepointer or NULL
651 * - if file does not exist, attempt to create it
652 ************************************************************/
653 FILE* get_config_file( const char* config_dir_name,
654 const char* config_file_name,
655 const char* default_config_file_text )
656 {
657 size_t path_len;
658
659 char* config_home_path_name = "";
660 char* config_sub_path_name = "";
661
662 char* config_dir_path;
663 char* config_file_path;
664
665 FILE* config_file;
666647
667648 /************************************************************
668649 * sub-function to get_config_file: create_config_file
669650 ************************************************************/
670 void create_config_file()
671 {
672 config_file = fopen(config_file_path, "a");
673 if (config_file == NULL)
651 void create_config_file(FILE** config_file, char* config_file_path,
652 const char* default_config_file_text, const char* config_file_name)
653 {
654 *config_file = fopen(config_file_path, "a");
655 if (*config_file == NULL)
674656 {
675657 error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path);
676658 return;
677659 }
678 fprintf(config_file, "%s", default_config_file_text);
660 fprintf(*config_file, "%s", default_config_file_text);
679661 error(0,0,"%s: %s",N_("config file created"), config_file_path);
680 if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name);
662 if (fclose(*config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name);
681663 }
682664
683665 /************************************************************
684666 * sub-function to get_config_file: open_config_file
685667 ************************************************************/
686 int open_config_file()
687 {
688 config_file = fopen(config_file_path, "r");
689 if (config_file == NULL)
668 int open_config_file(FILE** config_file, char* config_file_path,
669 size_t *path_len, const char* config_home_path_name,
670 const char* config_sub_path_name, const char* config_dir_name,
671 const char* default_config_file_text, const char* config_file_name)
672 {
673 char* config_dir_path;
674
675 *config_file = fopen(config_file_path, "r");
676 if (*config_file == NULL)
690677 {
691678 if (errno != ENOENT) return FALSE;
692679 // maybe replace all this with a single line asprintf()
693 path_len = strlen(config_home_path_name)
680 *path_len = strlen(config_home_path_name)
694681 + strlen(config_sub_path_name)
695682 + strlen(config_dir_name) +1;
696 if (path_len < 1) return FALSE;
697 config_dir_path = malloc(path_len);
683 if (*path_len < 1) return FALSE;
684 config_dir_path = malloc(*path_len);
698685 if (config_dir_path == NULL)
699686 {
700687 error(0,errno,"%s",N_("memory allocation failure"));
701688 return FALSE;
702689 }
703 snprintf(config_dir_path, path_len, "%s%s%s",
690 snprintf(config_dir_path, *path_len, "%s%s%s",
704691 config_home_path_name, config_sub_path_name,
705692 config_dir_name);
706693
711698 return FALSE;
712699 }
713700 greetings_to_version_16();
714 create_config_file();
701 create_config_file(config_file, config_file_path, default_config_file_text, config_file_name);
715702 free(config_dir_path);
716703 return FALSE;
717704 }
718705 return TRUE;
719706 }
720707
708 /************************************************************
709 * Open config file, or create one
710 * - returns filepointer or NULL
711 * - if file does not exist, attempt to create it
712 ************************************************************/
713 FILE* get_config_file( const char* config_dir_name,
714 const char* config_file_name,
715 const char* default_config_file_text )
716 {
717 size_t path_len;
718
719 char* config_home_path_name = "";
720 char* config_sub_path_name = "";
721
722 char* config_file_path;
723
724 FILE* config_file;
721725
722726 /************************************************************
723727 * main part of function get_config_file
749753 config_home_path_name, config_sub_path_name,
750754 config_dir_name, config_file_name);
751755
752 if (open_config_file() == TRUE)
756 if (open_config_file(&config_file, config_file_path, &path_len, config_home_path_name,
757 config_sub_path_name, config_dir_name,
758 default_config_file_text, config_file_name) == TRUE)
753759 {
754760 free(config_file_path);
755761 return config_file;
676676 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
677677 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
678678 "# with a message that includes the guessed location.\n"
679 "# hcal's guesses will also affect its default behaviour for ouput of\n"
679 "# hcal's guesses will also affect its default behaviour for output of\n"
680680 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
681681 "#SUNSET_AWARE=TRUE\n"
682682 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
933933 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
934934 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
935935 "# with a message that includes the guessed location.\n"
936 "# hdate's guesses will also affect its default behaviour for ouput of\n"
936 "# hdate's guesses will also affect its default behaviour for output of\n"
937937 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
938938 "#SUNSET_AWARE=TRUE\n"
939939 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
660660 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
661661 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
662662 "# with a message that includes the guessed location.\n"
663 "# hcal's guesses will also affect its default behaviour for ouput of\n"
663 "# hcal's guesses will also affect its default behaviour for output of\n"
664664 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
665665 "#SUNSET_AWARE=TRUE\n"
666666 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
917917 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
918918 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
919919 "# with a message that includes the guessed location.\n"
920 "# hdate's guesses will also affect its default behaviour for ouput of\n"
920 "# hdate's guesses will also affect its default behaviour for output of\n"
921921 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
922922 "#SUNSET_AWARE=TRUE\n"
923923 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
657657 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
658658 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
659659 "# with a message that includes the guessed location.\n"
660 "# hcal's guesses will also affect its default behaviour for ouput of\n"
660 "# hcal's guesses will also affect its default behaviour for output of\n"
661661 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
662662 "#SUNSET_AWARE=TRUE\n"
663663 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
914914 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
915915 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
916916 "# with a message that includes the guessed location.\n"
917 "# hdate's guesses will also affect its default behaviour for ouput of\n"
917 "# hdate's guesses will also affect its default behaviour for output of\n"
918918 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
919919 "#SUNSET_AWARE=TRUE\n"
920920 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
658658 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
659659 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
660660 "# with a message that includes the guessed location.\n"
661 "# hcal's guesses will also affect its default behaviour for ouput of\n"
661 "# hcal's guesses will also affect its default behaviour for output of\n"
662662 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
663663 "#SUNSET_AWARE=TRUE\n"
664664 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
915915 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
916916 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
917917 "# with a message that includes the guessed location.\n"
918 "# hdate's guesses will also affect its default behaviour for ouput of\n"
918 "# hdate's guesses will also affect its default behaviour for output of\n"
919919 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
920920 "#SUNSET_AWARE=TRUE\n"
921921 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
661661 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
662662 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
663663 "# with a message that includes the guessed location.\n"
664 "# hcal's guesses will also affect its default behaviour for ouput of\n"
664 "# hcal's guesses will also affect its default behaviour for output of\n"
665665 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
666666 "#SUNSET_AWARE=TRUE\n"
667667 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
918918 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
919919 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
920920 "# with a message that includes the guessed location.\n"
921 "# hdate's guesses will also affect its default behaviour for ouput of\n"
921 "# hdate's guesses will also affect its default behaviour for output of\n"
922922 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
923923 "#SUNSET_AWARE=TRUE\n"
924924 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
660660 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
661661 "# in that timezone. When hcal is forced to guess, it alerts the user\n"
662662 "# with a message that includes the guessed location.\n"
663 "# hcal's guesses will also affect its default behaviour for ouput of\n"
663 "# hcal's guesses will also affect its default behaviour for output of\n"
664664 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays\n"
665665 "#SUNSET_AWARE=TRUE\n"
666666 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
917917 "# and its (limited, and maybe biased) of the dominant Jewish community\n"
918918 "# in that timezone. When hdate is forced to guess, it alerts the user\n"
919919 "# with a message that includes the guessed location.\n"
920 "# hdate's guesses will also affect its default behaviour for ouput of\n"
920 "# hdate's guesses will also affect its default behaviour for output of\n"
921921 "# Shabbat times, parshiot, and choice of Israel/diaspora hoidays.\n"
922922 "#SUNSET_AWARE=TRUE\n"
923923 "# LATITUDE and LONGITUDE may be in decimal format or in the form\n"
1515 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18 #define _GNU_SOURCE
1918 #include <stdio.h>
2019 #include <stdlib.h>
2120 #include <string.h>
6060 yield a range extending to Hebrew year 11,899, י"א תתצ"ט,
6161 due to the extra ק needed for the '900' century. However,
6262 for readability, I would want a an extra space at that
63 point between the millenium and the century...
63 point between the millennium and the century...
6464 */
6565 #define HEBREW_NUMBER_BUFFER_SIZE 17
6666 #define HEBREW_WNUMBER_BUFFER_SIZE 9
366366 if ((d == 0) || (m == 0))
367367 {
368368 struct tm *tm;
369 long t;
369 time_t t;
370370 /* FIXME: day start at 6:00 or 12:00 like in Gregorian cal. ? */
371371 t = time (0);
372372 tm = localtime (&t);
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 */
1919
20 #define _GNU_SOURCE
2120 #include <stdio.h>
2221 #include <stdlib.h>
2322 #include <string.h>