Remove url_parent.

This commit is contained in:
Michael Drake 2012-10-06 14:11:29 +01:00
parent 639d2cb659
commit aeac82ff17
2 changed files with 0 additions and 50 deletions

View File

@ -482,55 +482,6 @@ url_func_result url_canonical_root(const char *url, char **result)
}
/**
* Strip the topmost segment of the path
*
* \param url an absolute URL
* \param result pointer to pointer to buffer to hold result
* \return URL_FUNC_OK on success
*/
url_func_result url_parent(const char *url, char **result)
{
url_func_result status;
struct url_components components;
int len, path_len;
assert(url);
status = url_get_components(url, &components);
if (status == URL_FUNC_OK) {
if ((!components.scheme) || (!components.authority) ||
(!components.path)) {
status = URL_FUNC_FAILED;
} else {
if (strcmp(components.path, "/")) {
path_len = strlen(components.path);
if (components.path[path_len - 1] == '/')
path_len--;
while (components.path[path_len - 1] != '/')
path_len--;
} else {
path_len = 1;
}
len = strlen(components.scheme) +
strlen(components.authority) +
path_len + 4;
*result = malloc(len);
if (!(*result))
status = URL_FUNC_NOMEM;
else
snprintf((*result), len, "%s://%s%s",
components.scheme,
components.authority,
components.path);
}
}
url_destroy_components(&components);
return status;
}
/**
* Extract path segment from an URL
*

View File

@ -57,7 +57,6 @@ url_func_result url_escape(const char *unescaped, size_t toskip,
bool sptoplus, const char *escexceptions, char **result);
url_func_result url_unescape(const char *str, char **result);
url_func_result url_canonical_root(const char *url, char **result);
url_func_result url_parent(const char *url, char **result);
url_func_result url_path(const char *url, char **result);
url_func_result url_compare(const char *url1, const char *url2,
bool nofrag, bool *result);