uriparser 0.9.8
|
Data Structures | |
struct | UriIp4Struct |
struct | UriIp6Struct |
struct | UriMemoryManagerStruct |
Typedefs | |
typedef int | UriBool |
typedef struct UriIp4Struct | UriIp4 |
typedef struct UriIp6Struct | UriIp6 |
typedef void *(* | UriFuncMalloc) (struct UriMemoryManagerStruct *, size_t) |
typedef void *(* | UriFuncCalloc) (struct UriMemoryManagerStruct *, size_t, size_t) |
typedef void *(* | UriFuncRealloc) (struct UriMemoryManagerStruct *, void *, size_t) |
typedef void *(* | UriFuncReallocarray) (struct UriMemoryManagerStruct *, void *, size_t, size_t) |
typedef void(* | UriFuncFree) (struct UriMemoryManagerStruct *, void *) |
typedef struct UriMemoryManagerStruct | UriMemoryManager |
typedef enum UriBreakConversionEnum | UriBreakConversion |
typedef enum UriNormalizationMaskEnum | UriNormalizationMask |
typedef enum UriResolutionOptionsEnum | UriResolutionOptions |
Enumerations | |
enum | UriBreakConversionEnum { URI_BR_TO_LF , URI_BR_TO_CRLF , URI_BR_TO_CR , URI_BR_TO_UNIX = URI_BR_TO_LF , URI_BR_TO_WINDOWS = URI_BR_TO_CRLF , URI_BR_TO_MAC = URI_BR_TO_CR , URI_BR_DONT_TOUCH } |
enum | UriNormalizationMaskEnum { URI_NORMALIZED = 0 , URI_NORMALIZE_SCHEME = 1 << 0 , URI_NORMALIZE_USER_INFO = 1 << 1 , URI_NORMALIZE_HOST = 1 << 2 , URI_NORMALIZE_PATH = 1 << 3 , URI_NORMALIZE_QUERY = 1 << 4 , URI_NORMALIZE_FRAGMENT = 1 << 5 } |
enum | UriResolutionOptionsEnum { URI_RESOLVE_STRICTLY = 0 , URI_RESOLVE_IDENTICAL_SCHEME_COMPAT = 1 << 0 } |
Functions | |
int | uriCompleteMemoryManager (UriMemoryManager *memory, UriMemoryManager *backend) |
void * | uriEmulateCalloc (UriMemoryManager *memory, size_t nmemb, size_t size) |
void * | uriEmulateReallocarray (UriMemoryManager *memory, void *ptr, size_t nmemb, size_t size) |
int | uriTestMemoryManager (UriMemoryManager *memory) |
Holds definitions independent of the encoding pass.
typedef int UriBool |
Boolean type
typedef enum UriBreakConversionEnum UriBreakConversion |
Specifies a line break conversion mode.
"
Specifies a line break conversion mode. "
typedef void *(* UriFuncCalloc) (struct UriMemoryManagerStruct *, size_t, size_t) |
Function signature that custom calloc(3) functions must conform to
typedef void(* UriFuncFree) (struct UriMemoryManagerStruct *, void *) |
Function signature that custom free(3) functions must conform to
typedef void *(* UriFuncMalloc) (struct UriMemoryManagerStruct *, size_t) |
Function signature that custom malloc(3) functions must conform to
typedef void *(* UriFuncRealloc) (struct UriMemoryManagerStruct *, void *, size_t) |
Function signature that custom realloc(3) functions must conform to
typedef void *(* UriFuncReallocarray) (struct UriMemoryManagerStruct *, void *, size_t, size_t) |
Function signature that custom reallocarray(3) functions must conform to
typedef struct UriIp4Struct UriIp4 |
Holds an IPv4 address.
"
Holds an IPv4 address. "
typedef struct UriIp6Struct UriIp6 |
Holds an IPv6 address.
"
Holds an IPv6 address. "
typedef struct UriMemoryManagerStruct UriMemoryManager |
Class-like interface of custom memory managers
"
Class-like interface of custom memory managers
typedef enum UriNormalizationMaskEnum UriNormalizationMask |
Specifies which component of a URI has to be normalized.
"
Specifies which component of a URI has to be normalized. "
typedef enum UriResolutionOptionsEnum UriResolutionOptions |
Specifies how to resolve URI references.
"
Specifies how to resolve URI references. "
Specifies a line break conversion mode.
Specifies which component of a URI has to be normalized.
int uriCompleteMemoryManager | ( | UriMemoryManager * | memory, |
UriMemoryManager * | backend ) |
Wraps a memory manager backend that only provides malloc and free to make a complete memory manager ready to be used.
The core feature of this wrapper is that you don't need to implement realloc if you don't want to. The wrapped memory manager uses backend->malloc, memcpy, and backend->free and soieof(size_t) extra bytes per allocation to emulate fallback realloc for you.
memory->calloc is uriEmulateCalloc. memory->free uses backend->free and handles the size header. memory->malloc uses backend->malloc and adds a size header. memory->realloc uses memory->malloc, memcpy, and memory->free and reads the size header. memory->reallocarray is uriEmulateReallocarray.
The internal workings behind memory->free, memory->malloc, and memory->realloc may change so the functions exposed by these function pointer sshould be consided internal and not public API.
memory | OUT: Where to write the wrapped memory manager to |
backend | IN: Memory manager to use as a backend |
void * uriEmulateCalloc | ( | UriMemoryManager * | memory, |
size_t | nmemb, | ||
size_t | size ) |
Offers emulation of calloc(3) based on memory->malloc and memset. See "man 3 calloc" as well.
memory | IN: Memory manager to use, should not be NULL |
nmemb | IN: Number of elements to allocate |
size | IN: Size in bytes per element |
void * uriEmulateReallocarray | ( | UriMemoryManager * | memory, |
void * | ptr, | ||
size_t | nmemb, | ||
size_t | size ) |
Offers emulation of reallocarray(3) based on memory->realloc. See "man 3 reallocarray" as well.
memory | IN: Memory manager to use, should not be NULL |
ptr | IN: Pointer allocated using memory->malloc/... or NULL |
nmemb | IN: Number of elements to allocate |
size | IN: Size in bytes per element |
int uriTestMemoryManager | ( | UriMemoryManager * | memory | ) |
Run multiple tests against a given memory manager. For example, one test
It is recommended to compile with AddressSanitizer enabled to take full advantage of uriTestMemoryManager.
memory | IN: Memory manager to use, should not be NULL |