40 for (i = 0; i < len; i++) {
59 return (*url ==
'/') ? 1 : 0;
76 s = strchr (str,
':');
77 if (s == NULL || s == str) {
82 if (s[1] ==
'\0' || s[1] !=
'/' || s[2] ==
'\0' || s[2] !=
'/') {
106 str = strchr(str, find);
163 if (NULL == url || NULL ==
u) {
194 u = strchr (url->
host,
'@');
197 if (
u == url->
host) {
215 if (
'\0' == *url->
host) {
220 u = strchr (url->
host,
':');
221 if (NULL !=
u && (NULL == url->
path || u < url->path)) {
230 url->
port = atoi (
u);
235 if (
'\0' == *url->
host) {
267 if (NULL == path ||
'\0' == *path) {
273 while (*path ==
'/') path++;
281 path = strchr (path,
'/');
287 }
while (i < max_parts);
320 if (NULL == query ||
'\0' == *query) {
324 params[i++].
key = query;
325 while (i < max_params && NULL != (query = strchr (query, delimiter))) {
327 params[i].
key = ++query;
328 params[i].
val = NULL;
332 if ((params[i - 1].val = strchr (params[i - 1].
key,
'=')) != NULL) {
333 *(params[i - 1].
val)++ =
'\0';
340 if ((params[i - 1].val = strchr (params[i - 1].
key,
'=')) != NULL) {
341 *(params[i - 1].
val)++ =
'\0';
static mp_limb_t u[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
struct GNUNET_HashCode key
The key used in the DHT.
Copyright (C) 2016 Jack Engqvist Johansson.
static char * find_fragment(char *str)
static int is_relative(const char *url)
Check if a URL is relative (no scheme and hostname).
int GNUNET_uri_parse(struct GNUNET_Uri *url, char *u)
Parse a URL to a struct.
static char * find_query(char *str)
static int natoi(const char *str, size_t len)
Copyright (C) 2016,2017 Jack Engqvist Johansson.
int GNUNET_uri_parse_query(char *query, char delimiter, struct GNUNET_UriParam *params, int max_params)
Parse a query string into a key/value struct.
int GNUNET_uri_split_path(char *path, char **parts, int max_parts)
Split a path into several strings.
static char * find_path(char *str)
static char * parse_scheme(char *str)
Parse the scheme of a URL by inserting a null terminator after the scheme.
static char * find_and_terminate(char *str, char find)
Find a character in a string, replace it with '\0' and return the next character in the string.