32 lines
906 B
C
32 lines
906 B
C
#ifndef OMIT_BASE /* <!-- base */
|
|
#include <stdint.h> /* C99 */
|
|
/** Assumes: reverse ordering of byte-fields; unsigned is defined; C11 and GNU
|
|
anonymous unions. */
|
|
union date32 {
|
|
struct { uint32_t day : 5, month : 4, year : 23; }; /* C11, reverse */
|
|
uint32_t u32;
|
|
};
|
|
#else /* base --><!-- !base */
|
|
#undef OMIT_BASE
|
|
#endif /* !base --> */
|
|
|
|
|
|
#ifndef OMIT_DAY /* <!-- page */
|
|
struct tree_day_node;
|
|
struct tree_day_tree { struct tree_day_node *node; unsigned height; };
|
|
struct day_tree { struct tree_day_tree root; };
|
|
#else /* page --><!-- !page */
|
|
#undef OMIT_DAY
|
|
#endif /* !page --> */
|
|
|
|
|
|
#ifndef OMIT_PROTO /* <!-- proto */
|
|
struct journal { struct day_tree days; };
|
|
struct journal journal(void);
|
|
void journal_(struct journal *);
|
|
int journal_is_valid(const struct journal *);
|
|
const char *journal_to_string(const struct journal *);
|
|
#else /* proto --><!-- !proto */
|
|
#undef OMIT_PROTO
|
|
#endif /* !proto --> */
|