Adding gender to the config
build / build (push) Successful in 19s

This commit is contained in:
ml
2026-07-16 22:49:06 +02:00
parent 1ebbfebe31
commit 7a77c4a07d
26 changed files with 470 additions and 109 deletions
+7 -5
View File
@@ -3,9 +3,10 @@
#include <math.h>
void reading_generate(const char *tarot_seed, const BirthData *birth,
void reading_generate(const char *tarot_seed, const BirthData *birth, Gender gender,
time_t utc_moment, DailyReading *out) {
out->utc_moment = utc_moment;
out->gender = gender;
astro_compute_natal_chart(birth, &out->natal);
astro_compute_daily_transits(utc_moment, &out->natal, &out->transits);
tarot_draw_celtic_cross(tarot_seed, &out->spread);
@@ -66,10 +67,10 @@ void reading_print_text(const DailyReading *r, FILE *out) {
fprintf(out, "===== %s =====\n", ui("ui.celtic_cross", "Celtic Cross"));
for (int i = 0; i < TAROT_SPREAD_SIZE; i++) {
const TarotDraw *draw = &r->spread.positions[i];
fprintf(out, "%-16s %s%s%s\n", tarot_position_name((CelticCrossPosition)i),
fprintf(out, "%-16s %s%s%s\n", tarot_position_name((CelticCrossPosition)i, r->gender),
tarot_card_name(draw->card), draw->reversed ? " " : "",
draw->reversed ? ui("ui.reversed", "(Reversed)") : "");
fprintf(out, " %s\n", tarot_position_description((CelticCrossPosition)i));
fprintf(out, " %s\n", tarot_position_description((CelticCrossPosition)i, r->gender));
fprintf(out, " %s\n", tarot_card_meaning(draw->card, draw->reversed));
}
}
@@ -138,12 +139,12 @@ void reading_print_html(const DailyReading *r, FILE *out) {
" <div class=\"desc\">%s</div>\n"
" <div class=\"meaning\">%s</div>\n"
"</div>\n",
tarot_position_name((CelticCrossPosition)i),
tarot_position_name((CelticCrossPosition)i, r->gender),
draw->reversed ? "reversed" : "",
tarot_card_image_file(draw->card), tarot_card_name(draw->card),
tarot_card_name(draw->card), draw->reversed ? " " : "",
draw->reversed ? ui("ui.reversed", "(Reversed)") : "",
tarot_position_description((CelticCrossPosition)i),
tarot_position_description((CelticCrossPosition)i, r->gender),
tarot_card_meaning(draw->card, draw->reversed));
}
fprintf(out, "</div>\n</body></html>\n");
@@ -163,6 +164,7 @@ void reading_print_json(const DailyReading *r, FILE *out) {
struct tm *utc = gmtime(&r->utc_moment);
fprintf(out, " \"date\": \"%04d-%02d-%02d\",\n", utc->tm_year + 1900, utc->tm_mon + 1, utc->tm_mday);
fprintf(out, " \"gender\": \"%s\",\n", tarot_gender_slug(r->gender));
fprintf(out, " \"natal\": {\n \"bodies\": [\n");
for (int b = 0; b < NUM_BODIES; b++) {