-
Notifications
You must be signed in to change notification settings - Fork 0
/
calrom.h
81 lines (66 loc) · 1.58 KB
/
calrom.h
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
/**
* libcalrom
*
* C library for calendar computations according to
* the Roman Catholic liturgical calendar as instituted by
* MP Mysterii Paschalis of Paul VI. (AAS 61 (1969), pp. 222-226).
*
* This header file declares the only public interface of the library.
*/
#ifndef CALROM_H
#define CALROM_H
#include <glib.h>
typedef enum {
CR_SEASON_ADVENT,
CR_SEASON_CHRISTMAS,
CR_SEASON_LENT,
CR_SEASON_EASTER,
CR_SEASON_ORDINARY
} CRSeason;
typedef struct {
CRSeason season;
short week;
} CRSeasonInfo;
typedef GDateYear CRLiturgicalYear;
typedef struct {
GDate first_advent_date;
GDate nativity_date;
GDate baptism_of_lord_date;
GDate ash_wednesday_date;
GDate easter_date;
GDate pentecost_date;
GDate last_date;
} CRTemporale;
typedef struct {
} CRSanctorale;
typedef struct {
CRLiturgicalYear year;
GDate beginning_date;
GDate end_date;
CRTemporale temporale;
} CRCalendar;
typedef struct {
} CRCelebration;
typedef struct {
GDate date;
CRSeasonInfo season_info;
} CRDay;
/**
* Determines liturgical year.
*/
CRLiturgicalYear calrom_year(const GDate *date);
/**
* Builds calendar for the specified liturgical year.
*/
void calrom_build_calendar(CRCalendar *calendar, CRLiturgicalYear year, const CRSanctorale *sanctorale);
/**
* Populates day with liturgical calendar data for the given date.
* Returns 1 on success or an error code (negative number).
*/
int calrom_day(CRDay *day, const GDate *date, const CRCalendar *calendar);
/**
* Result codes returned by calrom_day()
*/
#define CR_SUCCESS 1
#define CR_ERROR_DATE_OUT_OF_YEAR_RANGE -10
#endif