Coda Distributed File System
urlquote.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15
16#*/
17
18#ifndef _URLQUOTE_H_
19#define _URLQUOTE_H_
20
21/* Functions for escaping unsafe characters in a string. The worst case
22 * behaviour when `quoting', is that destination string is 3 times larger
23 * compared to the source string. The used encoding is similar to the one used
24 * for URL's, [a-zA-Z0-9_,.-] are considered safe. All the other characters
25 * are converted to %XX, where XX is the 2digit hexadecimal representation of
26 * the quoted character. In addition, '+' is also interpreted as a space. */
27
28/* The most important ones if you are hand editing some place where encoded
29 * strings are used (like the filenames in the repair fixfile) are probably:
30 * ' ' = %20 or '+'
31 * '%' = %25
32 * '+' = %2b
33 */
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#include <sys/types.h>
40
41int quote(char *dest, char *src, size_t n);
42int unquote(char *dest, char *src, size_t n);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif /* _URLQUOTE_H_ */
int unquote(char *dest, char *src, size_t n)
Definition: urlquote.c:70
int quote(char *dest, char *src, size_t n)
Definition: urlquote.c:20