From 697ff734ecfc1136b27cc72aa88b89171e14661e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 21 May 2008 17:24:41 +0000 Subject: [PATCH] * Commented out the 'PrintFlat' and 'PrintFile' functions because they are only used in debug tests that are also commented out. Silences a compiler warning. * Removed parse_url() from libcitadel. No longer necessary because libcurl handles all this stuff for us now. --- libcitadel/lib/libcitadel.h | 1 - libcitadel/lib/mime_parser.c | 3 ++ libcitadel/lib/tools.c | 56 ------------------------------------ 3 files changed, 3 insertions(+), 57 deletions(-) diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 8c90357a9..e9e964807 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -316,7 +316,6 @@ int GetCount(HashList *Hash); const void *GetSearchPayload(const void *HashVoid); void SortByPayload(HashList *Hash, CompareFunc SortBy); void convert_spaces_to_underscores(char *str); -int parse_url(char *url, char *hostname, int *port, char *identifier); /* * Convert 4 bytes char into an Integer. diff --git a/libcitadel/lib/mime_parser.c b/libcitadel/lib/mime_parser.c index 45a6fc700..0d9c66984 100644 --- a/libcitadel/lib/mime_parser.c +++ b/libcitadel/lib/mime_parser.c @@ -754,6 +754,7 @@ static void DeleteIcon(void *IconNamePtr) free(Icon->FileName); } +/* static const char *PrintFlat(void *IconNamePtr) { IconName *Icon = (IconName*) IconNamePtr; @@ -764,6 +765,8 @@ static const char *PrintFile(void *IconNamePtr) IconName *Icon = (IconName*) IconNamePtr; return Icon->FileName; } +*/ + #define GENSTR "x-generic" #define IGNORE_PREFIX_1 "gnome-mime" int LoadIconDir(const char *DirName) diff --git a/libcitadel/lib/tools.c b/libcitadel/lib/tools.c index 60168fe91..fac3cb5ad 100644 --- a/libcitadel/lib/tools.c +++ b/libcitadel/lib/tools.c @@ -1032,59 +1032,3 @@ void convert_spaces_to_underscores(char *str) } -/* - * Parse a URL into host, port number, and resource identifier. - * (This is used by various functions which might need to fetch web pages.) - */ -int parse_url(char *url, char *hostname, int *port, char *identifier) -{ - char protocol[1024]; - char scratch[1024]; - char *ptr = NULL; - char *nptr = NULL; - - strcpy(scratch, url); - ptr = (char *)strchr(scratch, ':'); - if (!ptr) { - return(1); /* no protocol specified */ - } - - strcpy(ptr, ""); - strcpy(protocol, scratch); - if (strcmp(protocol, "http")) { - return(2); /* not HTTP */ - } - - strcpy(scratch, url); - ptr = (char *) strstr(scratch, "//"); - if (!ptr) { - return(3); /* no server specified */ - } - ptr += 2; - - strcpy(hostname, ptr); - nptr = (char *)strchr(ptr, ':'); - if (!nptr) { - *port = 80; /* default */ - nptr = (char *)strchr(hostname, '/'); - } - else { - sscanf(nptr, ":%d", port); - nptr = (char *)strchr(hostname, ':'); - } - - if (nptr) { - *nptr = '\0'; - } - - nptr = (char *)strchr(ptr, '/'); - - if (!nptr) { - return(4); /* no url specified */ - } - - strcpy(identifier, nptr); - return(0); -} - - -- 2.30.2