cmark

My personal build of CMark ✏️

Commit
42ea18599f66a3af00887280770aa9479c453b21
Parent
2aa269f8dcbc0b091a92f89045ff7f6b16ffa09b
Author
John MacFarlane <jgm@berkeley.edu>
Date

Clarify that it's the caller's responsibility to free the buffer...

returned by cmark_render_html etc. Closes #124.

Diffstat

2 files changed, 18 insertions, 8 deletions

Status File Name N° Changes Insertions Deletions
Modified man/man3/cmark.3 17 11 6
Modified src/cmark.h 9 7 2
diff --git a/man/man3/cmark.3 b/man/man3/cmark.3
@@ -1,4 +1,4 @@
-.TH cmark 3 "April 09, 2016" "LOCAL" "Library Functions Manual"
+.TH cmark 3 "April 26, 2016" "LOCAL" "Library Functions Manual"
 .SH
 NAME
 .PP
@@ -599,32 +599,37 @@ Rendering
 \fIchar *\f[] \fBcmark_render_xml\f[](\fIcmark_node *root\f[], \fIint options\f[])
 
 .PP
-Render a \f[I]node\f[] tree as XML.
+Render a \f[I]node\f[] tree as XML. It is the caller's responsibility to
+free the returned buffer.
 
 .PP
 \fIchar *\f[] \fBcmark_render_html\f[](\fIcmark_node *root\f[], \fIint options\f[])
 
 .PP
 Render a \f[I]node\f[] tree as an HTML fragment. It is up to the user to
-add an appropriate header and footer.
+add an appropriate header and footer. It is the caller's responsibility
+to free the returned buffer.
 
 .PP
 \fIchar *\f[] \fBcmark_render_man\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
 
 .PP
-Render a \f[I]node\f[] tree as a groff man page, without the header.
+Render a \f[I]node\f[] tree as a groff man page, without the header. It
+is the caller's responsibility to free the returned buffer.
 
 .PP
 \fIchar *\f[] \fBcmark_render_commonmark\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
 
 .PP
-Render a \f[I]node\f[] tree as a commonmark document.
+Render a \f[I]node\f[] tree as a commonmark document. It is the caller's
+responsibility to free the returned buffer.
 
 .PP
 \fIchar *\f[] \fBcmark_render_latex\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
 
 .PP
-Render a \f[I]node\f[] tree as a LaTeX document.
+Render a \f[I]node\f[] tree as a LaTeX document. It is the caller's
+responsibility to free the returned buffer.
 
 .SS
 Options
diff --git a/src/cmark.h b/src/cmark.h
@@ -465,28 +465,33 @@ cmark_node *cmark_parse_file(FILE *f, int options);
  * ## Rendering
  */
 
-/** Render a 'node' tree as XML.
+/** Render a 'node' tree as XML.  It is the caller's responsibility
+ * to free the returned buffer.
  */
 CMARK_EXPORT
 char *cmark_render_xml(cmark_node *root, int options);
 
 /** Render a 'node' tree as an HTML fragment.  It is up to the user
- * to add an appropriate header and footer.
+ * to add an appropriate header and footer. It is the caller's
+ * responsibility to free the returned buffer.
  */
 CMARK_EXPORT
 char *cmark_render_html(cmark_node *root, int options);
 
 /** Render a 'node' tree as a groff man page, without the header.
+ * It is the caller's responsibility to free the returned buffer.
  */
 CMARK_EXPORT
 char *cmark_render_man(cmark_node *root, int options, int width);
 
 /** Render a 'node' tree as a commonmark document.
+ * It is the caller's responsibility to free the returned buffer.
  */
 CMARK_EXPORT
 char *cmark_render_commonmark(cmark_node *root, int options, int width);
 
 /** Render a 'node' tree as a LaTeX document.
+ * It is the caller's responsibility to free the returned buffer.
  */
 CMARK_EXPORT
 char *cmark_render_latex(cmark_node *root, int options, int width);