This commit is contained in:
Neil 2022-12-27 13:55:58 -08:00
parent a795b70859
commit 8a3718b840
2 changed files with 6 additions and 1 deletions

View File

@ -164,7 +164,9 @@ void kjv_(struct kjv *const kjv) {
verse_table_(&kjv->verses);
}
/** Loads 66 files from the "kjv/" directory. */
/** Loads 66 files from the "kjv/" directory. Prints out something if it
doesn't work, but does not call `perror` or reset `errno`. Use
<fn:kjv_is_valid> to tell. */
struct kjv kjv(void) {
const char *const dir_kjv = "kjv";
struct text backing;

View File

@ -2,6 +2,7 @@
#include <stdio.h>
#include <inttypes.h> /* C99 */
#include <stdlib.h>
#include <assert.h>
int main(void) {
int success = EXIT_SUCCESS;
@ -12,6 +13,8 @@ int main(void) {
kjv_add(&k, (union kjvcite){ .book = Genesis, .chapter = 1, .verse = 2 });
kjv_add(&k, (union kjvcite){ .book = Genesis, .chapter = 1, .verse = 1 });
fprintf(stderr, "%zu of which: %s.\n", k.set_words, kjv_set_to_string(&k));
assert(k.total_words == 789633);
assert(k.set_words == 39);
goto finally;
catch:
success = EXIT_FAILURE, perror("kjv");