interpret/src/journal.h
2022-12-28 00:03:55 -08:00

33 lines
945 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 */
#include "text.h"
struct journal { struct day_tree days; struct text backing; };
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 --> */