back-dated lily; fixed stuff that last commit broke

This commit is contained in:
Neil 2023-04-22 22:05:54 -07:00
parent fd4797ff83
commit ba87fecb11
4 changed files with 15 additions and 5 deletions

View File

@ -43,7 +43,7 @@ bin/test-kjv: build/text.o build/pair.o build/kjvcite.o build/test_kjv.o
bin/kjv: build/text.o build/pair.o build/journal.o build/kjvcite.o build/kjv.o build/source.o
bin/flight: build/text.o build/pair.o build/journal.o build/source.o build/flights.o build/flighthours.o
bin/score: build/text.o build/pair.o build/journal.o build/scores.o
bin/scan: build/text.o build/journal.o build/pair.o build/driver.o
bin/scan: build/text.o build/journal.o build/pair.o build/scan.o build/driver.o
bin/%:
@echo "\033[1;36mlinking $@\033[0m"
@ -73,7 +73,7 @@ build/%.c: src/%.re.c
# # https://github.com/neil-edelman/cdoc documentation
# -cdoc -o $@ $<
.SECONDARY: build/kjv.c build/journal.c build/source.c build/scan_kjv.c build/flights.c build/kjvcite.c build/scores.c
.SECONDARY: build/kjv.c build/journal.c build/source.c build/scan_kjv.c build/flights.c build/kjvcite.c build/scores.c build/scan.c
.PHONY: clean release test
test: $(projects)

View File

@ -6,6 +6,7 @@
@std C99 */
#include "journal.h"
#include "scores.h"
#include <stdio.h>
#include <errno.h>
#include <assert.h>
@ -13,6 +14,7 @@
int main(void) {
const char *intent = "start";
struct journal jrnl = {0};
struct scores scrs = {0};
errno = 0;
intent = "../journal";
@ -20,10 +22,18 @@ int main(void) {
fprintf(stderr, "Journal: %s.\n", journal_to_string(&jrnl));
if(errno) goto catch;
intent = "parse";
scrs = scores(&jrnl);
fprintf(stderr, "Scores: %s.\n", scores_to_string(&scrs));
if(scores_is_empty(&scrs)) goto catch;
if(!scores_graph(&scrs)) goto catch;
intent = 0;
goto finally;
catch:
perror(intent);
finally:
scores_(&scrs);
journal_(&jrnl);
return intent ? EXIT_FAILURE : EXIT_SUCCESS;
}

View File

@ -214,7 +214,8 @@ struct journal journal(const char *const dir_journal) {
convert all of offsets back to pointers. */
it = day_tree_iterator(&j.days);
while(day_tree_next(&it))
*(v.text = day_tree_value(&it)) = j.backing.data + *v.offset;
v.text = day_tree_value(&it), *v.text = j.backing.data + *v.offset;
goto finally;
catch:
fprintf(stderr, "On date: %s/%d-%.2d-%.2d.\n",

View File

@ -4,6 +4,7 @@
#include <stdint.h>
struct pair { const char *a, *b; };
struct pair pair(const char *const a, const char *const b);
int pair_to_natural(const char *, const char *, uint32_t *);
int pair_colon_to_minutes(const char *, const char *,
@ -14,8 +15,6 @@ int pair_is_equal(struct pair, struct pair);
int pair_is_string(struct pair, const char *);
#include "journal.h" /* date32 */
int pair_to_date(const char *a, union date32 *const d);
/*fixme
uint32_t pair_djb2(const struct pair p);*/
/* Supporting pair -> size_t for looking up in arrays. */
#define TABLE_NAME pairmap