Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_escape.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
20 #ifndef APR_ESCAPE_H
21 #define APR_ESCAPE_H
22 #include "apu.h"
23 #include "apr_general.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
34 /* Simple escape/unescape functions.
35  *
36  */
37 
43 #define APR_ESCAPE_STRING (-1)
44 
48 #define APR_ESCAPE_LDAP_DN (0x01)
49 
53 #define APR_ESCAPE_LDAP_FILTER (0x02)
54 
58 #define APR_ESCAPE_LDAP_ALL (0x03)
59 
72 APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str,
73  apr_ssize_t slen, apr_size_t *len);
74 
87 APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str)
88  __attribute__((nonnull(1)));
89 
107 APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url,
108  apr_ssize_t slen, const char *forbid, const char *reserved, int plus,
109  apr_size_t *len);
110 
127 APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url,
128  const char *forbid, const char *reserved, int plus)
129  __attribute__((nonnull(1)));
130 
142  const char *str, apr_ssize_t slen, apr_size_t *len);
143 
153  const char *str) __attribute__((nonnull(1)));
154 
174 APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path,
175  apr_ssize_t slen, int partial, apr_size_t *len);
176 
195 APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str,
196  int partial) __attribute__((nonnull(1)));
197 
209 APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str,
210  apr_ssize_t slen, apr_size_t *len);
211 
222  const char *str) __attribute__((nonnull(1)));
223 
240 APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str,
241  apr_ssize_t slen, int toasc, apr_size_t *len);
242 
254 APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str,
255  int toasc) __attribute__((nonnull(1)));
256 
272 APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str,
273  apr_ssize_t slen, apr_size_t *len);
274 
287 APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str)
288  __attribute__((nonnull(1)));
289 
309 APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str,
310  apr_ssize_t slen, int quote, apr_size_t *len);
311 
329 APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str,
330  int quote);
331 
341 APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src,
342  apr_size_t srclen, int colon, apr_size_t *len);
343 
354 APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src,
355  apr_size_t slen, int colon) __attribute__((nonnull(1)));
356 
367 APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str,
368  apr_ssize_t slen, int colon, apr_size_t *len);
369 
381 APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str,
382  int colon, apr_size_t *len);
383 
395 APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src,
396  apr_ssize_t srclen, int flags, apr_size_t *len);
397 
410 APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src,
411  apr_ssize_t slen, int flags) __attribute__((nonnull(1)));
412 
414 #ifdef __cplusplus
415 }
416 #endif
417 
418 #endif /* !APR_ESCAPE_H */
size_t apr_size_t
Definition: apr.h:375
const char * apr_pescape_shell(apr_pool_t *p, const char *str) __attribute__((nonnull(1)))
const char * apr_pescape_path_segment(apr_pool_t *p, const char *str) __attribute__((nonnull(1)))
const char * apr_pescape_ldap(apr_pool_t *p, const void *src, apr_ssize_t slen, int flags) __attribute__((nonnull(1)))
apr_status_t apr_escape_path(char *escaped, const char *path, apr_ssize_t slen, int partial, apr_size_t *len)
const char * apr_pescape_hex(apr_pool_t *p, const void *src, apr_size_t slen, int colon) __attribute__((nonnull(1)))
apr_status_t apr_escape_ldap(char *dest, const void *src, apr_ssize_t srclen, int flags, apr_size_t *len)
apr_status_t __attribute__((nonnull(1)))
apr_status_t apr_escape_echo(char *escaped, const char *str, apr_ssize_t slen, int quote, apr_size_t *len)
const void * apr_punescape_hex(apr_pool_t *p, const char *str, int colon, apr_size_t *len)
apr_status_t apr_escape_urlencoded(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len)
apr_status_t apr_unescape_hex(void *dest, const char *str, apr_ssize_t slen, int colon, apr_size_t *len)
apr_status_t apr_unescape_url(char *escaped, const char *url, apr_ssize_t slen, const char *forbid, const char *reserved, int plus, apr_size_t *len)
APR Miscellaneous library routines.
const char * apr_punescape_url(apr_pool_t *p, const char *url, const char *forbid, const char *reserved, int plus) __attribute__((nonnull(1)))
apr_status_t apr_unescape_entity(char *unescaped, const char *str, apr_ssize_t slen, apr_size_t *len)
const char * apr_pescape_echo(apr_pool_t *p, const char *str, int quote)
apr_status_t apr_escape_shell(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len)
dav_error * src
Definition: mod_dav.h:186
char * path
Definition: apr_arch_dso.h:40
proxy_worker proxy_server_conf char * url
Definition: mod_proxy.h:602
apr_pool_t * p
const char * apr_punescape_entity(apr_pool_t *p, const char *str) __attribute__((nonnull(1)))
const char * apr_pescape_entity(apr_pool_t *p, const char *str, int toasc) __attribute__((nonnull(1)))
apr_status_t apr_escape_path_segment(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len)
#define APR_DECLARE(x)
Definition: macros.h:6
ssize_t apr_ssize_t
Definition: apr.h:376
dav_buffer const char * str
Definition: mod_dav.h:465
apr_status_t apr_escape_hex(char *dest, const void *src, apr_size_t srclen, int colon, apr_size_t *len)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1350
apr_status_t apr_escape_entity(char *escaped, const char *str, apr_ssize_t slen, int toasc, apr_size_t *len)
const char * apr_pescape_urlencoded(apr_pool_t *p, const char *str) __attribute__((nonnull(1)))
const char * apr_pescape_path(apr_pool_t *p, const char *str, int partial) __attribute__((nonnull(1)))