From b237924585e61532ada774bf9e70eadff00666dc Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 18 Jan 2020 23:12:37 +0100 Subject: Use C string instead of chunk for link URL and title Use zero-terminated C strings instead of cmark_chunks without storing the length. This introduces a few additional strlen computations, but overhead should be low. Allows to reduce size of struct cmark_node later. --- src/inlines.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/inlines.h') diff --git a/src/inlines.h b/src/inlines.h index 39d3363..800ed0c 100644 --- a/src/inlines.h +++ b/src/inlines.h @@ -1,12 +1,15 @@ #ifndef CMARK_INLINES_H #define CMARK_INLINES_H +#include "chunk.h" +#include "references.h" + #ifdef __cplusplus extern "C" { #endif -cmark_chunk cmark_clean_url(cmark_mem *mem, cmark_chunk *url); -cmark_chunk cmark_clean_title(cmark_mem *mem, cmark_chunk *title); +unsigned char *cmark_clean_url(cmark_mem *mem, cmark_chunk *url); +unsigned char *cmark_clean_title(cmark_mem *mem, cmark_chunk *title); void cmark_parse_inlines(cmark_mem *mem, cmark_node *parent, cmark_reference_map *refmap, int options); -- cgit v1.2.3