biner/main.c

25 lines
500 B
C
Raw Normal View History

2020-12-20 00:00:00 +00:00
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "./transpile.h"
2020-12-20 00:00:00 +00:00
#include "./tree.h"
2021-01-03 00:00:00 +00:00
int main(int argc, char** argv) {
2020-12-20 00:00:00 +00:00
const uint8_t* zone = biner_tree_parse(stdin);
if (zone == NULL) return EXIT_FAILURE;
2021-01-03 00:00:00 +00:00
if (argc == 0) {
fprintf(stderr, "assertion failure: argc > 1");
return EXIT_FAILURE;
}
biner_transpile_c(&(biner_transpile_param_t) {
.zone = zone,
.dst = stdout,
2021-01-03 00:00:00 +00:00
.argc = argc-1,
.argv = argv+1,
});
2020-12-20 00:00:00 +00:00
return EXIT_SUCCESS;
}