"Fossies" - the Fresh Open Source Software Archive

Member "uriparser-0.9.7/src/UriMemory.h" (5 Oct 2022, 2485 Bytes) of package /linux/www/uriparser-0.9.7.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 "UriMemory.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.9.3_vs_0.9.4.

    1 /*
    2  * uriparser - RFC 3986 URI parsing library
    3  *
    4  * Copyright (C) 2018, Weijia Song <songweijia@gmail.com>
    5  * Copyright (C) 2018, 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 #ifndef URI_MEMORY_H
   41 #define URI_MEMORY_H 1
   42 
   43 
   44 
   45 #ifndef URI_DOXYGEN
   46 # include <uriparser/Uri.h>
   47 #endif
   48 
   49 
   50 
   51 #define URI_CHECK_MEMORY_MANAGER(memory)  \
   52     do { \
   53         if (memory == NULL) { \
   54             memory = &defaultMemoryManager; \
   55         } else if (uriMemoryManagerIsComplete(memory) != URI_TRUE) { \
   56             return URI_ERROR_MEMORY_MANAGER_INCOMPLETE; \
   57         } \
   58     } while (0)
   59 
   60 
   61 
   62 #ifdef __cplusplus
   63 # define URIPARSER_EXTERN extern "C"
   64 #else
   65 # define URIPARSER_EXTERN extern
   66 #endif
   67 
   68 URIPARSER_EXTERN UriMemoryManager defaultMemoryManager;
   69 
   70 #undef URIPARSER_EXTERN
   71 
   72 
   73 
   74 UriBool uriMemoryManagerIsComplete(const UriMemoryManager * memory);
   75 
   76 
   77 
   78 #endif /* URI_MEMORY_H */