aboutsummaryrefslogtreecommitdiff
path: root/doc/man3/html_node_set_value.3
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-09-27 01:09:04 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-09-27 21:55:58 +0200
commitadb0973bb355b9f7eb27d9842116e43c7f77d261 (patch)
tree295eba8a1f2fde6e6d500fbe7b32ac5330d0bbbe /doc/man3/html_node_set_value.3
parent0d54bbf08674174c1e7b91ce39984c29b78cf0ba (diff)
Add man pages
Diffstat (limited to 'doc/man3/html_node_set_value.3')
-rw-r--r--doc/man3/html_node_set_value.380
1 files changed, 80 insertions, 0 deletions
diff --git a/doc/man3/html_node_set_value.3 b/doc/man3/html_node_set_value.3
new file mode 100644
index 0000000..bc6dc9c
--- /dev/null
+++ b/doc/man3/html_node_set_value.3
@@ -0,0 +1,80 @@
+.TH HTML_NODE_SET_VALUE 3 2023-09-24 0.1.0 "slweb Library Reference"
+
+.SH NAME
+html_node_set_value \- set value to a HTML node
+
+.SH SYNOPSIS
+.LP
+.nf
+#include <slweb/html.h>
+.P
+int html_node_set_value(struct html_node *\fIn\fP, const char *\fIval\fP);
+.fi
+
+.SH DESCRIPTION
+The
+.IR html_node_set_value (3)
+function sets a value to a
+.I struct html_node
+object pointed to by
+.IR n ,
+previously returned by
+.IR html_node_alloc (3)
+or
+.IR html_node_add_child (3).
+.I val
+is a null-terminated string with the value to be assigned to the node.
+
+.I slweb
+allocates a copy of the null-terminated string defined by
+.IR val .
+
+As opposed to
+.IR html_node_set_value_unescaped (3),
+.IR html_node_set_value (3)
+escapes characters that could case syntax errors, such as
+.B <
+.BR "" ( "LESS-THAN SIGN" )
+being translated to
+.BR &lt; .
+
+.SH RETURN VALUE
+On success,
+.IR html_node_set_value (3)
+returns zero. On failure, a negative integer is returned.
+
+.SH EXAMPLE
+A
+.I struct html_node
+object with
+.B example
+as tag name and
+.B hello
+as its value and no attributes would be translated by the HTML
+serializer to:
+
+.PP
+.in +4n
+.EX
+<example>hello</example>
+.EE
+.in
+.PP
+
+.SH ERRORS
+No errors are defined.
+
+.SH SEE ALSO
+.BR html_node_alloc (3),
+.BR html_node_free (3),
+.BR html_node_set_value_unescaped (3),
+.BR html_node_add_attr (3),
+.BR slweb_http (7).
+
+.SH COPYRIGHT
+Copyright (C) 2023 Xavier Del Campo Romero.
+.P
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.