-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
49 lines (32 loc) · 1.49 KB
/
README
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
--------------------------------------------------------------------
The man page below defines the interface for semantic versioning.
A participant in the clibs project.
See https://github.com/clibs/clib/wiki/Packages for more info.
Sat Dec 13 10:12:49 EST 2014
--------------------------------------------------------------------
HTMLESCAPE(3) BSD Library Functions Manual HTMLESCAPE(3)
NAME
htmlescape -- HTML escape the characters '<', '>', '&' and '"'
SYNOPSIS
#include <htmlescape.h>
int
htmlescape(const char *src, char **dst);
DESCRIPTION
The htmlescape function parses a string and converts the characters
listed above to their corresponding HTML entities.
The calling program is responsible for freeing the memory allocated to
*dst.
RETURN VALUE
htmlescape returns 0 on success. If memory could not be allocated for
the destination string, then ENOMEM is returned.
If either argument is null or the src string is empty, 0 is returned and
dst is unchanged.
EXAMPLE
The following code fragment illustrates a simple usage:
char *dst = 0;
htmlescape("forbidden: < > & \\\"", &dst);
printf("dst = '%s'\n", dst);
free(dst);
produces this output:
dst = 'forbidden: < > & "'
BSD December 13, 2014 BSD