blob: 7f26aef528b83c86bcfb32379992c9dfb7e10ef6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
.TH HTML_NODE_SET_VALUE_UNESCAPED 3 2023-09-24 0.1.0 "libweb Library Reference"
.SH NAME
html_node_set_value_unescaped \- set value to a HTML node
.SH SYNOPSIS
.LP
.nf
#include <libweb/html.h>
.P
int html_node_set_value_unescaped(struct html_node *\fIn\fP, const char *\fIval\fP);
.fi
.SH DESCRIPTION
The
.IR html_node_set_value_unescaped (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 libweb
allocates a copy of the null-terminated string defined by
.IR val .
As opposed to
.IR html_node_set_value (3),
.IR html_node_set_value_unescaped (3)
does not escape characters that could case syntax errors, such as
.BR <
.BR "" ( "LESS-THAN SIGN" ).
This might make
.IR html_node_set_value_unescaped (3)
interesting to insert serialized HTML nodes as a value.
.SH RETURN VALUE
On success,
.IR html_node_set_value_unescaped (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 (3),
.BR html_node_add_attr (3),
.BR libweb_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.
|