This file is indexed.

/usr/include/hdatepp.h is in libhdate-dev 1.4.20-4build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
/*  libhdate - Hebrew calendar library
 *
 *  Copyright (C) 1984-2003 Amos Shapir, 2004-2007  Yaacov Zamir <kzamir@walla.co.il>
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/** @file hdatepp.h
    @brief libhdate C++ language header.
    
    libhdate - Hebrew calendar library, the C++ language header file.
*/

#ifndef __HDATE_PP_H__
#define __HDATE_PP_H__

#include <hdate.h>

/**
 @brief the libhdate namespace.
 */
namespace hdate 
{
	/**
	 @brief Hdate class.
	
	 class for Hebrew/Gregorian date conversions
	 */
	class Hdate;
		
	/**
	 @brief Hdate class.
	
	 class for Hebrew/Gregorian date conversions
	 */
	class Hdate
	{
		
	public:
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief Hdate constructor.
		 */
		Hdate()
		{
			/* default is this day */
			h = new_hdate();
			
			/* default is in israel */
			diaspora = HDATE_ISRAEL_FLAG;
			
			/* default localeconv is Tel-Aviv winter time */
			latitude = 32.0;
			longitude = -34.0;
			tz = 2;
		}
		
		/**
		 @brief Hdate destructor.
		 */
		~Hdate()
		{
			delete_hdate(h);
		}
		
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief compute date structure from the Gregorian date
		
		 @param d Day of month 1..31
		 @param m Month 1..12 ,  if m or d is 0 return current date.
		 @param y Year in 4 digits e.g. 2001
		 */
		void
		set_gdate (int d, int m, int y)
		{
			hdate_set_gdate (h, d, m, y);
		}
		
		/**
		 @brief compute date structure from the Hebrew date
		
		 @param d Day of month 1..31
		 @param m Month 1..14 ,  if m or d is 0 return current date.
		 @param y Year in 4 digits e.g. 5731
		 */
		void
		set_hdate (int d, int m, int y)
		{
			hdate_set_hdate (h, d, m, y);
		}
		
		/**
		 @brief compute date structure from the Julian day
		
		 @param jd the julian day number.
		 */
		void
		set_jd (int jd)
		{
			hdate_set_jd (h, jd);
		}
		
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief get formated hebrew date.
		
		 return the short ( e.g. "1 Tishrey" ) or 
		 long (e.g. "Tuesday 18 Tishrey 5763 Hol hamoed Sukot" ) formated date.
		
		 @param s short flag.
		 @return a static string of foramted date
		*/
		char *
		get_format_date (int s)
		{
			return hdate_get_format_date (h, diaspora, s);
		}
		
		/**
		 @brief get name of week day.
		
		 @param s short flag 
		   true - returns a short string: sun, false returns: sunday.
		 @return a static string of the day of the week
		*/
		char *
		get_day_of_week_string (int s)
		{
			return hdate_get_day_string (h->hd_dw, s);
		}
		
		/**
		 @brief get name month.
		
		 @param s short flag 
		   true - returns a short string: Mar, false returns: March.
		 @return a static string of month name
		*/
		char *
		get_month_string (int s)
		{
			return hdate_get_month_string (h->gd_mon, s);
		}
		
		/**
		 @brief get name hebrew month.
		
		 @param s short flag 
		   true - returns a short string.
		 @return a static string of hebrew month name
		*/
		char *
		get_hebrew_month_string (int s)
		{
			return hdate_get_hebrew_month_string (h->hd_mon, s);
		}
		
		/**
		 @brief get name hebrew holiday.
		
		 @param s short flag 
		   true - returns a short string.
		 @return a static string of hebrew holiday name
		*/
		char *
		get_holyday_string (int s)
		{
			int holyday;
			
			holyday = hdate_get_holyday (h, diaspora);
			return hdate_get_holyday_string (holyday, s);
		}
		
		/**
		 @brief get the day of the omer
		
		 @return return The day in the omer, starting from 1 (or 0 if not in sfirat ha omer)
		*/
		int
		get_omer_day ()
		{
			return hdate_get_omer_day (h);
		}
		
		/**
		 @brief get the hebrew holiday type.
		
		 @return the holiday type 
		*/
		int
		get_holyday_type ()
		{
			int holyday;
			
			holyday = hdate_get_holyday (h, diaspora);
			return hdate_get_holyday_type (holyday);
		}
		
		/**
		 @brief get name hebrew parasha.
		
		 @param s short flag 
		   true - returns a short string.
		 @return a static string of hebrew parash name
		*/
		char *
		get_parasha_string (int s)
		{
			int parasha;
			
			parasha = hdate_get_parasha (h, diaspora);
			return hdate_get_parasha_string (parasha, s);
		}
		
		/**
		 @brief get name hebrew year.
		
		 @return a static string of hebrew year
		*/
		char *
		get_hebrew_year_string ()
		{
			return hdate_get_int_string (h->hd_year);
		}
		
		/**
		 @brief get name hebrew hebrew day of the month
		
		 @return a static string of hebrew day of the month
		*/
		char *
		get_hebrew_day_string ()
		{
			return hdate_get_int_string (h->hd_day);
		}
		
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief get parash number

		@return the hebrew parasha number
		*/
		int
		get_parasha ()
		{
			return hdate_get_parasha (h, diaspora);
		}
		
		/**
		 @brief get holiday number
		 @return the hebrew holiday number
		*/
		int
		get_holyday ()
		{
			return hdate_get_holyday (h, diaspora);
		}
		
		/**
		 @brief get Gregorian day of the month
		
		 @return the Gregorian day of the month
		*/
		int
		get_gday ()
		{
			return hdate_get_gday (h);
		}
		
		/**
		 @brief get Gregorian month
		
		 @return the Gregorian month
		*/
		int
		get_gmonth ()
		{
			return hdate_get_gmonth (h);
		}
		
		/**
		 @brief get Gregorian year
		
		 @return the Gregorian year
		*/
		int
		get_gyear ()
		{
			return hdate_get_gyear (h);
		}
		
		/**
		 @brief get Hebrew day of the month
		
		 @return the Hebrew day of the month
		*/
		int
		get_hday ()
		{
			return hdate_get_hday (h);
		}
		
		/**
		 @brief get Hebrew month
		
		 @return the Hebrew month
		*/
		int
		get_hmonth ()
		{
			return hdate_get_hmonth (h);
		}
		
		/**
		 @brief get Hebrew year
		
		 @return the Hebrew year
		*/
		int
		get_hyear ()
		{
			return hdate_get_hyear (h);
		}
		
		/**
		 @brief get the day of the week
		
		 @return the day of the week
		*/
		int
		get_day_of_the_week ()
		{
			return hdate_get_day_of_the_week (h);
		}
		
		/**
		 @brief get the size of the Hebrew year in days
		
		 @return the size of the Hebrew year in days
		*/
		int
		get_size_of_year ()
		{
			return hdate_get_size_of_year (h);
		}
		
		/**
		 @brief get the day of the week of hebrew new years
		
		 @return the day of the week of hebrew new years
		*/
		int
		get_new_year_day_of_the_week ()
		{
			return hdate_get_new_year_day_of_the_week (h);
		}
		
		/**
		 @brief get the Julian day number
		
		 @return the Julian day number
		*/
		int
		get_julian ()
		{
			return hdate_get_julian (h);
		}
		
		/**
		 @brief get the number of days sice Tishrey I
		
		 @return the the number of days sice Tishrey I
		*/
		int
		get_days ()
		{
			return hdate_get_days (h);
		}
		
		/**
		 @brief get the number of weeks sice Tishrey I
		
		 @return the the number of weeks sice Tishrey I
		*/
		int
		get_weeks ()
		{
			return hdate_get_weeks (h);
		}
		
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief set location
		
		 @param in_longitude longitude to use in calculations
			degrees, negative values are east
		 @param in_latitude latitude to use in calculations
			degrees, negative values are south
		 @param in_tz time zone
		 */
		void
		set_location (double in_latitude, double in_longitude, int in_tz)
		{
			latitude = in_latitude;
			longitude = in_longitude;
			tz = in_tz;
		}
		
		/**
		 @brief sunrise time
		
		 @return sunrise in minutes after midnight (00:00)
		 */
		int
		get_sunrise ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 
				&sunrise, &sunset);
			
			return sunrise + tz * 60;
		}
		
		/**
		 @brief sunset time
		
		 @return sunset in minutes after midnight (00:00)
		 */
		int
		get_sunset ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 
				&sunrise, &sunset);
			
			return sunset + tz * 60;
		}
		
		/**
		 @brief first light time
		
		 @return first light in minutes after midnight (00:00)
		 */
		int
		get_first_light ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time_deg (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 106.01,
				&sunrise, &sunset);
			
			return sunrise + tz * 60;
		}
		
		/**
		 @brief talit time
		
		 @return talit time in minutes after midnight (00:00)
		 */
		int
		get_talit ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time_deg (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 101.0,
				&sunrise, &sunset);
			
			return sunrise + tz * 60;
		}
		
		/**
		 @brief first stars time
		
		 @return first stars in minutes after midnight (00:00)
		 */
		int
		get_first_stars ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time_deg (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 96.0,
				&sunrise, &sunset);
			
			return sunset + tz * 60;
		}
		
		/**
		 @brief three stars time
		
		 @return three stars in minutes after midnight (00:00)
		 */
		int
		get_three_stars ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time_deg (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude, 98.5,
				&sunrise, &sunset);
			
			return sunset + tz * 60;
		}
		
		/**
		 @brief sun light hour time
		
		 @return sun light hour in minutes
		 */
		int
		get_sun_hour ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude,
				&sunrise, &sunset);
			
			return (sunset - sunrise) / 12;
		}
		
		/**
		 @brief midday hour time
		
		 @return midday hour in minutes
		 */
		int
		get_midday ()
		{
			int sunrise;
			int sunset;
			
			hdate_get_utc_sun_time (h->gd_day, h->gd_mon, h->gd_year, 
				latitude, longitude,
				&sunrise, &sunset);
			
			return (sunset + sunrise) / 2;
		}
		
		////////////////////////////////////////
		////////////////////////////////////////
		
		/**
		 @brief name of translator
		
		 @return a static string with name of translator, or NULL if none
		*/
		char *
		get_translator_string ()
		{
			return hdate_get_translator_string ();
		}
		
		/**
		 @brief set this hdate object to use diaspora holidays and dates
		*/
		void
		set_diaspora ()
		{
			diaspora = HDATE_DIASPORA_FLAG;
		}
		
		/**
		 @brief set this hdate object to use israel holidays and dates
		*/
		void
		set_israel ()
		{
			diaspora = HDATE_ISRAEL_FLAG;
		}
		
	private:
		
		int diaspora;
		double latitude;
		double longitude;
		int tz;
		hdate_struct *h;
	
	};

} // name space

#endif