8char* readFile(char* file)
10 FILE* f = fopen(file, "rb");
11 fseek(f, 0, SEEK_END);
13 fseek(f, 0, SEEK_SET);
14 char* res = malloc(len + 1);
17 size_t n = fread(res, 1, len, f);
23char* example = "<?xml version=\"1.0\" lang=\"ja\"?><foo><bar baz=\"qux\">quux</bar><bar baz=\"bar\">hoge</bar><piyo>>piyopiyo<</piyo></foo><foo2 />";
25int main(int argc, char **argv)
28 char* body = argv[1] == NULL ? example : readFile(argv[1]);
29 document* doc = hexml_document_parse(body, -1);
30 char* err = hexml_document_error(doc);
33 int len = hexml_node_render(doc, hexml_document_node(doc), NULL, 0);
34 char* s = malloc(len + 1);
36 hexml_node_render(doc, hexml_document_node(doc), s, len);
38 printf("Parse successful\n"); // , %s\n", s);
43 printf("Parse failed, %s\n", err);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list