"Fossies" - the Fresh Open Source Software Archive

Member "uriparser-0.9.5/src/UriCommon.h" (18 Mar 2021, 4105 Bytes) of package /linux/www/uriparser-0.9.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "UriCommon.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.9.4_vs_0.9.5.

    1 /*
    2  * uriparser - RFC 3986 URI parsing library
    3  *
    4  * Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
    5  * Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
    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)) || (defined(URI_PASS_UNICODE) \
   60     && !defined(URI_COMMON_H_UNICODE) && defined(URI_ENABLE_UNICODE))
   61 # ifdef URI_PASS_ANSI
   62 #  define URI_COMMON_H_ANSI 1
   63 #  include <uriparser/UriDefsAnsi.h>
   64 # else
   65 #  define URI_COMMON_H_UNICODE 1
   66 #  include <uriparser/UriDefsUnicode.h>
   67 # endif
   68 
   69 
   70 
   71 /* Used to point to from empty path segments.
   72  * X.first and X.afterLast must be the same non-NULL value then. */
   73 extern const URI_CHAR * const URI_FUNC(SafeToPointTo);
   74 extern const URI_CHAR * const URI_FUNC(ConstPwd);
   75 extern const URI_CHAR * const URI_FUNC(ConstParent);
   76 
   77 
   78 
   79 void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri);
   80 
   81 int URI_FUNC(CompareRange)(
   82         const URI_TYPE(TextRange) * a,
   83         const URI_TYPE(TextRange) * b);
   84 
   85 UriBool URI_FUNC(RemoveDotSegmentsAbsolute)(URI_TYPE(Uri) * uri,
   86         UriMemoryManager * memory);
   87 UriBool URI_FUNC(RemoveDotSegmentsEx)(URI_TYPE(Uri) * uri,
   88         UriBool relative, UriBool pathOwned, UriMemoryManager * memory);
   89 
   90 unsigned char URI_FUNC(HexdigToInt)(URI_CHAR hexdig);
   91 URI_CHAR URI_FUNC(HexToLetter)(unsigned int value);
   92 URI_CHAR URI_FUNC(HexToLetterEx)(unsigned int value, UriBool uppercase);
   93 
   94 UriBool URI_FUNC(IsHostSet)(const URI_TYPE(Uri) * uri);
   95 
   96 UriBool URI_FUNC(CopyPath)(URI_TYPE(Uri) * dest, const URI_TYPE(Uri) * source,
   97         UriMemoryManager * memory);
   98 UriBool URI_FUNC(CopyAuthority)(URI_TYPE(Uri) * dest,
   99         const URI_TYPE(Uri) * source, UriMemoryManager * memory);
  100 
  101 UriBool URI_FUNC(FixAmbiguity)(URI_TYPE(Uri) * uri, UriMemoryManager * memory);
  102 void URI_FUNC(FixEmptyTrailSegment)(URI_TYPE(Uri) * uri,
  103         UriMemoryManager * memory);
  104 
  105 
  106 #endif
  107 #endif