aboutsummaryrefslogtreecommitdiff
path: root/uri.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-28 18:10:44 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-28 18:10:44 +0000
commit608cc746ad60bc2aa8db22814fe887fece4ea89b (patch)
tree6802af00849249465a9756139fa46b3cbc0c29f8 /uri.h
parentselection: debug log of data offer mime-types and actions (diff)
uri: add uri_parse() - new function extracts components from an URI
Diffstat (limited to 'uri.h')
-rw-r--r--uri.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/uri.h b/uri.h
new file mode 100644
index 00000000..b63290c5
--- /dev/null
+++ b/uri.h
@@ -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);