uri: add uri_parse() - new function extracts components from an URI

This commit is contained in:
Daniel Eklöf 2020-10-28 19:10:44 +01:00
parent 9580c04dd3
commit 608cc746ad
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 286 additions and 0 deletions

11
uri.h Normal file
View file

@ -0,0 +1,11 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
bool uri_parse(const char *uri, size_t len,
char **scheme, char **user, char **password, char **host,
uint16_t *port, char **path, char **query, char **fragment);
bool hostname_is_localhost(const char *hostname);