-
-/* If the string contains unsafe characters, duplicate it with
- encode_string, otherwise just copy it with strdup. */
-#define CLEANDUP(x) (contains_unsafe (x) ? encode_string (x) : xstrdup (x))
-
-/* Structure containing info on a URL. */
-struct urlinfo
-{
- char *url; /* Unchanged URL */
- uerr_t proto; /* URL protocol */
- char *host; /* Extracted hostname */
- unsigned short port;
- char ftp_type;
- char *path, *dir, *file, *qstring;
- /* Path, dir, file, and query string
- (properly decoded) */
- char *user, *passwd; /* Username and password */
- struct urlinfo *proxy; /* The exact string to pass to proxy
- server */
- char *referer; /* The source from which the request
- URI was obtained */
- char *local; /* The local filename of the URL
- document */
+/* This represents how many characters less than the OS max name length a file
+ * should be. More precisely, a file name should be at most
+ * (NAME_MAX - CHOMP_BUFFER) characters in length. This number was arrived at
+ * by adding the lengths of all possible strings that could be appended to a
+ * file name later in the code (e.g. ".orig", ".html", etc.). This is
+ * hopefully plenty of extra characters, but I am not guaranteeing that a file
+ * name will be of the proper length by the time the code wants to open a
+ * file descriptor. */
+#define CHOMP_BUFFER 19
+
+/* Specifies how, or whether, user auth information should be included
+ * in URLs regenerated from URL parse structures. */
+enum url_auth_mode {
+ URL_AUTH_SHOW,
+ URL_AUTH_HIDE_PASSWD,
+ URL_AUTH_HIDE