diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-05-14 12:33:29 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-05-14 12:35:10 -0700 |
commit | f8271ed0f523f61dae39b2c9edcda7758af2b84d (patch) | |
tree | 0d108df90ac76a3f9093d2017cdbd2e163576a6f /man/man3 | |
parent | 42ea18599f66a3af00887280770aa9479c453b21 (diff) |
Better documentation of memory-freeing responsibilities.
in cmark.h and its man page. Closes #124.
Diffstat (limited to 'man/man3')
-rw-r--r-- | man/man3/cmark.3 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/man/man3/cmark.3 b/man/man3/cmark.3 index 7808aa9..5642e59 100644 --- a/man/man3/cmark.3 +++ b/man/man3/cmark.3 @@ -1,4 +1,4 @@ -.TH cmark 3 "April 26, 2016" "LOCAL" "Library Functions Manual" +.TH cmark 3 "May 14, 2016" "LOCAL" "Library Functions Manual" .SH NAME .PP @@ -15,7 +15,8 @@ Simple Interface .PP Convert \f[I]text\f[] (assumed to be a UTF\-8 encoded string with length \f[I]len\f[]) from CommonMark Markdown to HTML, returning a -null\-terminated, UTF\-8\-encoded string. +null\-terminated, UTF\-8\-encoded string. It is the caller's +responsibility to free the returned buffer. .SS Node Structure @@ -224,8 +225,9 @@ typedef enum { .PP Creates a new iterator starting at \f[I]root\f[]. The current node and -event type are undefined until \f[C]cmark_iter_next\f[] is called for -the first time. +event type are undefined until \f[I]cmark_iter_next\f[] is called for +the first time. The memory allocated for the iterator should be released +using \f[I]cmark_iter_free\f[] when it is no longer needed. .PP \fIvoid\f[] \fBcmark_iter_free\f[](\fIcmark_iter *iter\f[]) @@ -583,14 +585,17 @@ Finish parsing and return a pointer to a tree of nodes. .PP Parse a CommonMark document in \f[I]buffer\f[] of length \f[I]len\f[]. -Returns a pointer to a tree of nodes. +Returns a pointer to a tree of nodes. The memory allocated for the node +tree should be released using \f[I]cmark_node_free\f[] when it is no +longer needed. .PP \fIcmark_node *\f[] \fBcmark_parse_file\f[](\fIFILE *f\f[], \fIint options\f[]) .PP Parse a CommonMark document in file \f[I]f\f[], returning a pointer to a -tree of nodes. +tree of nodes. The memory allocated for the node tree should be released +using \f[I]cmark_node_free\f[] when it is no longer needed. .SS Rendering |