X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=tmp.c;fp=tmp.c;h=bcdfeedf015b0348857b100a8a051cc48f6317ef;hb=66fa8273ac6f360864e8a594da3310f42379ae1e;hp=0000000000000000000000000000000000000000;hpb=76cedc9066d3fd65788f86ea5d0b71db98bb6e24;p=smdp.git diff --git a/tmp.c b/tmp.c new file mode 100644 index 0000000..bcdfeed --- /dev/null +++ b/tmp.c @@ -0,0 +1,29 @@ +#include +#include +#include + +#include "include/markdown.h" + +int main(int argc, char *argv[]) { + + FILE *input; + document_t *doc; + + if (argc > 1) { + if(!strcmp(argv[1], "-")) { + input = stdin; + } else { + input = fopen(argv[1],"r"); + if(!input) { + fprintf(stderr, "Unable to open '%s': %s\n", + argv[1], strerror(errno)); + exit(EXIT_FAILURE); + } + } + } else { + input = stdin; + } + + doc = markdown_load(input); +} +