summaryrefslogtreecommitdiff
path: root/src/main.c
blob: 64c5de25fc859a7ca260f5b4babdec4abfc4e91a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

#include "include/fileops.h"
#include "include/parser.h"

int main(int argc, char **argv)
{
  if (argc != 2)
    exit(1);
  char *filename = argv[1];
  
  uint8_t *buf = readdb(filename);
  if (buf == NULL)
    exit(0);
  struct byte *bytes = parse(buf);
  for (int i = 0; i < blen; ++i) {
    printf("%d\n", bytes[i].type);
  }

  free(bytes);
  free(buf);
  exit(0);
}