#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "HsFFI.h"
struct session;
struct session *c_newSession();
void c_freeSession(struct session*);
struct page;
struct page *c_initialReferer();
void *c_fetchURL(struct session*, char*, char*);
//struct page **c_fetchURLs(struct session*, struct page*, char**);
void c_freePage(struct page*);
char *c_renderDoc(struct session*, struct page*);
char **c_extractLinks(struct page*);
char **c_docLinksAndRendering(struct session*, struct page*);
int main(int argc, char **argv) {
hs_init(&argc, &argv);
struct session *session = c_newSession();
struct page *referer = c_initialReferer();
struct page *page = c_fetchURL(session, "text/xml text/html text/plain", argv[1]);
// char *ssml = c_renderDoc(session, page); // FIXME segfaults alongside extractLinks & the combined function.
printf("%i Hello, world!\n", argc);
c_freePage(page);
c_freePage(referer);
c_freeSession(session);
hs_exit();
}