aboutsummaryrefslogtreecommitdiff
path: root/gmid.h
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-09 20:32:23 +0000
committerOmar Polo <op@omarpolo.com>2021-01-09 20:32:23 +0000
commitef04b55160759b22db67f14c703a4343c4741e8b (patch)
treefff26b0d56a0506b2ef0ebb84ffa50f2d655ebe6 /gmid.h
parent578ba2d81b2fa5f839314190f42bb9116069db7a (diff)
switch to Bjoern Hoehrmann UTF-8 decoder
It's correct, while my hacked valid_multibyte_utf8 would allow things that aren't technically UTF8.
Diffstat (limited to 'gmid.h')
-rw-r--r--gmid.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gmid.h b/gmid.h
index c8f4514..3ee5fe4 100644
--- a/gmid.h
+++ b/gmid.h
@@ -117,6 +117,12 @@ struct uri {
char *fragment;
};
+struct parser {
+ char *uri;
+ struct uri *parsed;
+ const char *err;
+};
+
enum {
FILE_EXISTS,
FILE_EXECUTABLE,
@@ -151,6 +157,9 @@ void loop(struct tls*, int);
void usage(const char*);
+/* utf8.c */
+int valid_multibyte_utf8(struct parser*);
+
/* uri.c */
int parse_uri(char*, struct uri*, const char**);
int trim_req_uri(char*);