Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
--------------------------------------------------------------------
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