From 60b6962db0b0488667180e11cc6cfb1cec1b41ea Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 3 Jan 2017 22:08:38 -0800 Subject: Revert "Change types for source map offsets (#174)" This reverts commit 4fbe344df43ed7f60a3d3a53981088334cb709fc. --- src/cmark.h | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'src/cmark.h') diff --git a/src/cmark.h b/src/cmark.h index 5ce6d10..034f0e6 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -2,6 +2,7 @@ #define CMARK_H #include +#include #include #include @@ -22,7 +23,7 @@ extern "C" { /** Convert 'text' (assumed to be a UTF-8 encoded string with length * 'len') from CommonMark Markdown to HTML, returning a null-terminated, * UTF-8-encoded string. It is the caller's responsibility - * to free the returned buffer. Returns NULL on error. + * to free the returned buffer. */ CMARK_EXPORT char *cmark_markdown_to_html(const char *text, size_t len, int options); @@ -98,12 +99,6 @@ typedef enum { CMARK_PAREN_DELIM } cmark_delim_type; -typedef enum { - CMARK_ERR_NONE, - CMARK_ERR_OUT_OF_MEMORY, - CMARK_ERR_INPUT_TOO_LARGE -} cmark_err_type; - typedef struct cmark_node cmark_node; typedef struct cmark_parser cmark_parser; typedef struct cmark_iter cmark_iter; @@ -494,22 +489,12 @@ cmark_parser *cmark_parser_new_with_mem(int options, cmark_mem *mem); CMARK_EXPORT void cmark_parser_free(cmark_parser *parser); -/** Return the error code after a failed operation. - */ -CMARK_EXPORT -cmark_err_type cmark_parser_get_error(cmark_parser *parser); - -/** Return the error code after a failed operation. - */ -CMARK_EXPORT -const char *cmark_parser_get_error_message(cmark_parser *parser); - /** Feeds a string of length 'len' to 'parser'. */ CMARK_EXPORT void cmark_parser_feed(cmark_parser *parser, const char *buffer, size_t len); -/** Finish parsing and return a pointer to a tree of nodes or NULL on error. +/** Finish parsing and return a pointer to a tree of nodes. */ CMARK_EXPORT cmark_node *cmark_parser_finish(cmark_parser *parser); @@ -522,7 +507,7 @@ cmark_source_extent *cmark_parser_get_first_source_extent(cmark_parser *parser); /** Parse a CommonMark document in 'buffer' of length 'len'. * Returns a pointer to a tree of nodes. The memory allocated for * the node tree should be released using 'cmark_node_free' - * when it is no longer needed. Returns NULL on error. + * when it is no longer needed. */ CMARK_EXPORT cmark_node *cmark_parse_document(const char *buffer, size_t len, int options); @@ -530,23 +515,22 @@ cmark_node *cmark_parse_document(const char *buffer, size_t len, int options); /** Parse a CommonMark document in file 'f', returning a pointer to * a tree of nodes. The memory allocated for the node tree should be * released using 'cmark_node_free' when it is no longer needed. - * Returns NULL on error. */ CMARK_EXPORT cmark_node *cmark_parse_file(FILE *f, int options); -/** +/** * ## Source map API */ /* Return the index, in bytes, of the start of this extent */ CMARK_EXPORT -size_t cmark_source_extent_get_start(cmark_source_extent *extent); +uint64_t cmark_source_extent_get_start(cmark_source_extent *extent); -/* Return the index, in bytes, of the stop of this extent. This +/* Return the index, in bytes, of the stop of this extent. This * index is not included in the extent*/ CMARK_EXPORT -size_t cmark_source_extent_get_stop(cmark_source_extent *extent); +uint64_t cmark_source_extent_get_stop(cmark_source_extent *extent); /* Return the extent immediately following 'extent' */ CMARK_EXPORT -- cgit v1.2.3