interpret/src/driver.c

30 lines
583 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 *fail = 0;
struct journal jrnl = {0};
errno = 0;
jrnl = journal("../journal");
fprintf(stderr, "Journal: %s.\n", journal_to_string(&jrnl));
if(errno) goto catch;
goto finally;
catch:
if(!fail) fail = "scan";
perror(fail);
finally:
journal_(&jrnl);
return fail ? EXIT_FAILURE : EXIT_SUCCESS;
}