blob: 2a27c3427763b210b123b56c1e6553f8012f00bc [file] [log] [blame]
Jeff King638794c2010-05-23 05:17:55 -04001#ifndef URL_H
2#define URL_H
3
Elijah Newrenef3ca952018-08-15 10:54:05 -07004struct strbuf;
5
Denton Liu55454422019-04-29 04:28:14 -04006int is_url(const char *url);
7int is_urlschemechar(int first_flag, int ch);
8char *url_decode(const char *url);
9char *url_decode_mem(const char *url, int len);
Matthew DeVoree987df52019-06-27 15:54:08 -070010
11/*
12 * Similar to the url_decode_{,mem} methods above, but doesn't assume there
13 * is a scheme followed by a : at the start of the string. Instead, %-sequences
14 * before any : are also parsed.
15 */
16char *url_percent_decode(const char *encoded);
17
Denton Liu55454422019-04-29 04:28:14 -040018char *url_decode_parameter_name(const char **query);
19char *url_decode_parameter_value(const char **query);
Jeff King638794c2010-05-23 05:17:55 -040020
Denton Liu55454422019-04-29 04:28:14 -040021void end_url_with_slash(struct strbuf *buf, const char *url);
22void str_end_url_with_slash(const char *url, char **dest);
Tay Ray Chuan1966d9f2010-11-25 16:21:04 +080023
Jeff King638794c2010-05-23 05:17:55 -040024#endif /* URL_H */