#include #include #include "mem.h" #include "dom.h" int main(int argc, char *argv[]) { if (argc < 2) errx(1, "usage: glacier "); unveil(argv[1], "r"); unveil(NULL, NULL); pledge("stdio rpath", NULL); FILE *file; char *html; long len; file = fopen("test.html", "rb"); fseek(file, 0, SEEK_END); len = ftell(file); fseek(file, 0, SEEK_SET); html = MALLOC((size_t)len + 1); fread(html, 1, len, file); html[len] = '\0'; fclose(file); init_dom(html); free(html); return 0; }