From b743b0a080770f22df05e7e460788524eb840d17 Mon Sep 17 00:00:00 2001 From: Olof Hagsand Date: Fri, 22 Dec 2017 19:02:20 +0100 Subject: [PATCH] minor edits --- CHANGELOG.md | 2 +- lib/src/clixon_xml.c | 13 ++++++++++++- lib/src/clixon_xsl.c | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f6213f..4452d678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.4.0 (Upcoming) -* Clixon_backend now returns -1/255 on error instead of NULL. Useful for systemd restarts, for example. +* Clixon_backend now returns -1/255 on error instead of 0. Useful for systemd restarts, for example. * Fixed bug that deletes running on startup if backup started with -m running. When clixon starts again, running is lost. diff --git a/lib/src/clixon_xml.c b/lib/src/clixon_xml.c index f5434155..e12eabdd 100644 --- a/lib/src/clixon_xml.c +++ b/lib/src/clixon_xml.c @@ -747,6 +747,15 @@ xml_rm(cxobj *xc) * @param[out] xcp xml child node. New root * @retval 0 OK * @retval -1 Error + * @code + * cxobj *xt = NULL; + * if (xml_parse_string("2", NULL, &xt) < 0) + * err; + * # Here xt will be: 2 + * if (xml_rootchild(xt, 0, &xt) < 0) + * err; + * # Here xt will be: 2 + * @endcode * @see xml_child_rm */ int @@ -1057,6 +1066,7 @@ xml_print(FILE *f, * cb = cbuf_new(); * if (clicon_xml2cbuf(cb, xn, 0, 1) < 0) * goto err; + * fprintf(stderr, "%s", cbuf_get(cb)); * cbuf_free(cb); * @endcode * @see clicon_xml2file @@ -1341,7 +1351,8 @@ xml_parse_file(int fd, * @endcode * @see xml_parse_file * @see xml_parse_va - * @note you need to free the xml parse tree after use, using xml_free() + * @note You need to free the xml parse tree after use, using xml_free() + * @note If empty on entry, a new TOP xml will be created named "top" */ int xml_parse_string(const char *str, diff --git a/lib/src/clixon_xsl.c b/lib/src/clixon_xsl.c index e33cecc1..1d140440 100644 --- a/lib/src/clixon_xsl.c +++ b/lib/src/clixon_xsl.c @@ -1030,7 +1030,7 @@ xpath_each(cxobj *xcur, * @retval -1 error. * * @code - * cxobj **xvec; + * cxobj **xvec = NULL; * size_t xlen; * if (xpath_vec(xcur, "//symbol/foo", &xvec, &xlen) < 0) * goto err;