Debian Codegraph @

components/playlist/xspf/uriparser/UriCommon.h

raw symbols SCIP
1 /*
2 * uriparser - RFC 3986 URI parsing library
3 *
4 * Copyright (C) 2007, Weijia Song <[email protected]>
5 * Copyright (C) 2007, Sebastian Pipping <[email protected]>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above
13 * copyright notice, this list of conditions and the following
14 * disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials
19 * provided with the distribution.
20 *
21 * 3. Neither the name of the copyright holder nor the names of
22 * its contributors may be used to endorse or promote products
23 * derived from this software without specific prior written
24 * permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
30 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
37 * OF THE POSSIBILITY OF SUCH DAMAGE.
38 */
39
40 #if (defined(URI_PASS_ANSI) && !defined(URI_COMMON_H_ANSI)) \
41 || (defined(URI_PASS_UNICODE) && !defined(URI_COMMON_H_UNICODE)) \
42 || (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
43 /* What encodings are enabled? */
44 # include <uriparser/UriDefsConfig.h>
45 # if (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
46 /* Include SELF twice */
47 # ifdef URI_ENABLE_ANSI
48 # define URI_PASS_ANSI 1
49 # include "UriCommon.h"
50 # undef URI_PASS_ANSI
51 # endif
52 # ifdef URI_ENABLE_UNICODE
53 # define URI_PASS_UNICODE 1
54 # include "UriCommon.h"
55 # undef URI_PASS_UNICODE
56 # endif
57 /* Only one pass for each encoding */
58 # elif (defined(URI_PASS_ANSI) && !defined(URI_COMMON_H_ANSI) \
59 && defined(URI_ENABLE_ANSI)) \
60 || (defined(URI_PASS_UNICODE) && !defined(URI_COMMON_H_UNICODE) \
61 && defined(URI_ENABLE_UNICODE))
62 # ifdef URI_PASS_ANSI
63 # define URI_COMMON_H_ANSI 1
64 # include <uriparser/UriDefsAnsi.h>
65 # else
66 # define URI_COMMON_H_UNICODE 1
67 # include <uriparser/UriDefsUnicode.h>
68 # endif
69
70 /* Used to point to from empty path segments.
71 * X.first and X.afterLast must be the same non-NULL value then. */
72 extern const URI_CHAR * const URI_FUNC(SafeToPointTo);
73 extern const URI_CHAR * const URI_FUNC(ConstPwd);
74 extern const URI_CHAR * const URI_FUNC(ConstParent);
75
76 void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri);
77
78 int URI_FUNC(FreeUriPath)(URI_TYPE(Uri) * uri, UriMemoryManager * memory);
79
80 int URI_FUNC(CompareRange)(const URI_TYPE(TextRange) * a, const URI_TYPE(TextRange) * b);
81
82 UriBool URI_FUNC(CopyRange)(URI_TYPE(TextRange) * destRange,
83 const URI_TYPE(TextRange) * sourceRange,
84 UriMemoryManager * memory);
85 UriBool URI_FUNC(CopyRangeAsNeeded)(URI_TYPE(TextRange) * destRange,
86 const URI_TYPE(TextRange) * sourceRange,
87 UriMemoryManager * memory);
88
89 UriBool URI_FUNC(RemoveDotSegmentsAbsolute)(URI_TYPE(Uri) * uri,
90 UriMemoryManager * memory);
91 UriBool URI_FUNC(RemoveDotSegmentsEx)(URI_TYPE(Uri) * uri, UriBool relative,
92 UriBool pathOwned, UriMemoryManager * memory);
93
94 unsigned char URI_FUNC(HexdigToInt)(URI_CHAR hexdig);
95 URI_CHAR URI_FUNC(HexToLetterEx)(unsigned int value, UriBool uppercase);
96
97 UriBool URI_FUNC(CopyPath)(URI_TYPE(Uri) * dest, const URI_TYPE(Uri) * source,
98 UriMemoryManager * memory);
99 UriBool URI_FUNC(CopyAuthority)(URI_TYPE(Uri) * dest, const URI_TYPE(Uri) * source,
100 UriMemoryManager * memory);
101
102 UriBool URI_FUNC(FixAmbiguity)(URI_TYPE(Uri) * uri, UriMemoryManager * memory);
103 UriBool URI_FUNC(FixPathNoScheme)(URI_TYPE(Uri) * uri, UriMemoryManager * memory);
104 UriBool URI_FUNC(EnsureThatPathIsNotMistakenForHost)(URI_TYPE(Uri) * uri,
105 UriMemoryManager * memory);
106 void URI_FUNC(FixEmptyTrailSegment)(URI_TYPE(Uri) * uri, UriMemoryManager * memory);
107
108 # endif
109 #endif