diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | clectio.c | 17 | ||||
| -rw-r--r-- | config.def.h | 8 |
3 files changed, 20 insertions, 6 deletions
@@ -27,6 +27,7 @@ Edit `config.h` (copied from `config.def.h` on first build), then `make`: * `FORM_OF` / `FORM_EF` — Ordinary Form (1969) or Extraordinary Form (1962) * `SIGLA_ENGLISH` / `SIGLA_LATIN` — citation dialect (`Jer 14` vs `Ier 14`) * `COLOR` — colour the day name with its liturgical colour + * `GOSPEL_ONLY` — print every reading (0, default) or just the Gospel (1) One form per binary; for both, build twice. The interface is English only. @@ -67,18 +67,23 @@ static const char *citation(int r) { static void print_day(long off, const char *datestr) { const Day *d = &days[cal[off]]; - unsigned k, ri; + unsigned ri; + int n; if (usecolor) - printf("%s%s\033[0m", colansi[d->colour], names[d->name]); + printf("%s%s\033[0m\n", colansi[d->colour], names[d->name]); else - printf("%s \xc2\xb7 %s", names[d->name], colname[d->colour]); - printf("\n%s for %s\n", FORMNAME, datestr); - for (k = 0; k < d->rlen; k++) + printf("%s \xc2\xb7 %s\n", names[d->name], colname[d->colour]); + n = printf("%s for %s\n", FORMNAME, datestr) - 1; /* underline that line */ + while (n-- > 0) putchar('='); putchar('\n'); for (ri = 0; ri < d->rlen; ri++) { const Reading *r = &readings[rpool[d->roff + ri]]; unsigned v; +#if GOSPEL_ONLY + if (strcmp(parts[r->part], "Gospel") != 0) + continue; +#endif printf("\n%s (%s)\n\n", parts[r->part], citation(rpool[d->roff + ri])); for (v = 0; v < r->vlen; v++) printf("%s\n", verse[vpool[r->voff + v]]); @@ -95,7 +100,7 @@ int main(int argc, char **argv) { if (argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) { fprintf(stderr, "usage: clectio [YYYY-MM-DD] (default: today)\n" - " compiled: %s, %s, %d-%d\n", FORMNAME, SIGLANAME, EPOCH_Y, EPOCH_Y + (NDAYS / 366)); + " compiled: %s, %s, %s, %d-%d\n", FORMNAME, SIGLANAME, READMODE, EPOCH_Y, EPOCH_Y + (NDAYS / 366)); return 0; } if (argc > 1) { diff --git a/config.def.h b/config.def.h index 0447669..e22075f 100644 --- a/config.def.h +++ b/config.def.h @@ -12,7 +12,15 @@ /* --- Colourize the day name with its liturgical colour on a terminal. ---- */ #define COLOR 1 +/* --- Which readings to print. -------------------------------------------- */ +#define GOSPEL_ONLY 0 /* 0 = all readings; 1 = the Gospel only */ + /* ------------------------- derived (do not edit) ------------------------- */ +#if GOSPEL_ONLY +# define READMODE "Gospel only" +#else +# define READMODE "all readings" +#endif #ifdef FORM_EF # define LITURGY "gen/liturgy_ef.h" # define FORMNAME "Extraordinary Form (1962)" |
