Added a labs.csv.

This commit is contained in:
Neil 2023-09-06 09:12:35 -07:00
parent 7f8937db55
commit 1f6f226943
2 changed files with 12 additions and 1 deletions

View File

@ -64,7 +64,7 @@ int main(void) {
if(!freopen(intent, "w", stdout)) goto catch;
scan_score_graph(&scn);
intent = "labs.gnu";
intent = "labs.csv";
if(!freopen(intent, "w", stdout)) goto catch;
scan_labs_graph(&scn);

View File

@ -1215,10 +1215,21 @@ void scan_score_graph(struct scan *const scan) {
void scan_labs_graph(struct scan *const scan) {
struct linekvpair_tree_iterator it
= linekvpair_tree_iterator(&scan->labs);
union line64 line;
struct kvpair *kv;
assert(scan);
fprintf(stderr, "*** Labs graph %s.\n",
linekvpair_tree_to_string(&scan->labs));
while(linekvpair_tree_next(&it)) {
char datestr[12];
line = linekvpair_tree_key(&it);
kv = linekvpair_tree_value(&it);
date32_to_string(line.date, &datestr);
printf("%s, \"%.*s\", \"%.*s\"\n",
datestr, (int)(kv->key.b - kv->key.a), kv->key.a,
(int)(kv->value.b - kv->value.a), kv->value.a);
}
fprintf(stderr, "\n");
}