interpret/src/driver.c

30 lines
598 B
C

/** @license 2023 Neil Edelman, distributed under the terms of the
[MIT License](https://opensource.org/licenses/MIT).
Scan source files for meanings.
@std C99 */
#include "journal.h"
#include <stdio.h>
#include <errno.h>
#include <assert.h>
int main(void) {
const char *intent = "start";
struct journal jrnl = {0};
errno = 0;
intent = "loading journal";
jrnl = journal("../journal");
fprintf(stderr, "Journal: %s.\n", journal_to_string(&jrnl));
if(errno) goto catch;
goto finally;
catch:
perror(intent);
finally:
journal_(&jrnl);
return intent ? EXIT_FAILURE : EXIT_SUCCESS;
}