libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
Loading...
Searching...
No Matches
lws-purify.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2019 Andy Green <andy@warmcat.com>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
* IN THE SOFTWARE.
23
*/
24
32
43
LWS_VISIBLE
LWS_EXTERN
const
char
*
44
lws_sql_purify
(
char
*escaped,
const
char
*
string
,
size_t
len);
45
54
int
55
lws_sql_purify_len
(
const
char
*p);
56
82
LWS_VISIBLE
LWS_EXTERN
const
char
*
83
lws_json_purify
(
char
*escaped,
const
char
*
string
,
int
len,
int
*in_used);
84
98
LWS_VISIBLE
LWS_EXTERN
const
char
*
99
lws_json_purify_flags
(
char
*escaped,
const
char
*
string
,
int
len,
int
*in_used,
100
int
flags);
101
102
/*
103
* Also escape chars that, while legal in JSON strings, would be interpreted
104
* as markup if the JSON is inlined into an HTML page. Use this if the JSON
105
* output ends up embedded in HTML, eg, inside a <div> rather than fetched
106
* over XHR.
107
*/
108
#define LWS_JSON_PURIFY_FLAG_HTML_SAFE 1
109
119
LWS_VISIBLE
LWS_EXTERN
int
120
lws_json_purify_len
(
const
char
*
string
);
121
147
LWS_VISIBLE
LWS_EXTERN
void
148
lws_filename_purify_inplace
(
char
*filename);
149
150
LWS_VISIBLE
LWS_EXTERN
int
151
lws_plat_write_cert
(
struct
lws_vhost *vhost,
int
is_key,
int
fd,
void
*buf,
152
size_t
len);
153
LWS_VISIBLE
LWS_EXTERN
int
154
lws_plat_write_file
(
const
char
*filename,
void
*buf,
size_t
len);
155
156
LWS_VISIBLE
LWS_EXTERN
int
157
lws_plat_read_file
(
const
char
*filename,
void
*buf,
size_t
len);
158
159
LWS_VISIBLE
LWS_EXTERN
int
160
lws_plat_recommended_rsa_bits
(
void
);
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:327
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:322
lws_plat_recommended_rsa_bits
LWS_VISIBLE LWS_EXTERN int lws_plat_recommended_rsa_bits(void)
lws_json_purify_flags
LWS_VISIBLE LWS_EXTERN const char * lws_json_purify_flags(char *escaped, const char *string, int len, int *in_used, int flags)
lws_filename_purify_inplace
LWS_VISIBLE LWS_EXTERN void lws_filename_purify_inplace(char *filename)
lws_sql_purify
LWS_VISIBLE LWS_EXTERN const char * lws_sql_purify(char *escaped, const char *string, size_t len)
lws_sql_purify_len
int lws_sql_purify_len(const char *p)
lws_json_purify
LWS_VISIBLE LWS_EXTERN const char * lws_json_purify(char *escaped, const char *string, int len, int *in_used)
lws_json_purify_len
LWS_VISIBLE LWS_EXTERN int lws_json_purify_len(const char *string)
lws_plat_read_file
LWS_VISIBLE LWS_EXTERN int lws_plat_read_file(const char *filename, void *buf, size_t len)
lws_plat_write_cert
LWS_VISIBLE LWS_EXTERN int lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, size_t len)
lws_plat_write_file
LWS_VISIBLE LWS_EXTERN int lws_plat_write_file(const char *filename, void *buf, size_t len)
include
libwebsockets
lws-purify.h
Generated on
for libwebsockets by
1.18.0