/*
* urlparse.c
- *
- * Decompose a URL into its components.
*/
#include <string.h>
#include <stdio.h>
#include "url.h"
+/*
+ * Decompose a URL into its components. This is done in-place;
+ * this routine does not allocate any additional storage. Freeing the
+ * original buffer frees all storage used.
+ */
void parse_url(struct url_info *ui, char *url)
{
char *p = url;
}
}
+/*
+ * Escapes unsafe characters in a URL. Returns a malloc'd buffer.
+ */
char *url_escape_unsafe(const char *input)
{
const char *p = input;
return -1;
}
+/*
+ * Unescapes a buffer, optionally ending at an *unescaped* terminator
+ * (like ; for TFTP). The unescaping is done in-place.
+ *
+ * If a terminator is reached, return a pointer to the first character
+ * after the terminator.
+ */
char *url_unescape(char *buffer, char terminator)
{
char *p = buffer;