pinosaur
/
smdp.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
draft main application with file io + fixed Makefiles
[smdp.git]
/
tmp.c
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <errno.h>
4
5
#include "include/markdown.h"
6
7
int main(int argc, char *argv[]) {
8
9
FILE *input;
10
document_t *doc;
11
12
if (argc > 1) {
13
if(!strcmp(argv[1], "-")) {
14
input = stdin;
15
} else {
16
input = fopen(argv[1],"r");
17
if(!input) {
18
fprintf(stderr, "Unable to open '%s': %s\n",
19
argv[1], strerror(errno));
20
exit(EXIT_FAILURE);
21
}
22
}
23
} else {
24
input = stdin;
25
}
26
27
doc = markdown_load(input);
28
}
29