diff options
Diffstat (limited to 'libcmark-gfm/tests/basic/driver.c')
-rw-r--r-- | libcmark-gfm/tests/basic/driver.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libcmark-gfm/tests/basic/driver.c b/libcmark-gfm/tests/basic/driver.c new file mode 100644 index 0000000..e38e03a --- /dev/null +++ b/libcmark-gfm/tests/basic/driver.c @@ -0,0 +1,28 @@ +/* + * file : tests/basic/driver.c + * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC + * license : FreeBSD License; see accompanying COPYING file + */ + +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#include <cmark-gfm.h> +#include <cmark-gfm-extension_api.h> + +int +main (int argc, const char* argv[]) +{ + assert (argc == 2); + + const char* from = argv[1]; + + char* to = cmark_markdown_to_html (from, + strlen (from), + CMARK_OPT_DEFAULT | + CMARK_OPT_VALIDATE_UTF8); + printf ("%s", to); + cmark_get_default_mem_allocator ()->free (to); + return 0; +} |