From 6a92d91ec485203b19e0c3253c8b5cb3cf39dfa1 Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Fri, 22 Oct 2021 17:14:09 -0400 Subject: [PATCH] Remove unused article attributes --- xml.c | 51 --------------------------------------------------- xml.h | 10 ---------- 2 files changed, 61 deletions(-) diff --git a/xml.c b/xml.c index ea56e99..49b8284 100644 --- a/xml.c +++ b/xml.c @@ -20,15 +20,6 @@ freeItem(itemStruct *item) &item->title, &item->link, &item->description, - &item->author, - &item->comments, - &item->guid, - &item->pubDate, - &item->sourceName, - &item->sourceUrl, - &item->categories, - &item->enclosureUrl, - &item->enclosureType, }; for (unsigned long int i = 0; i < LEN(mems); i++) { @@ -102,21 +93,11 @@ parseXml(xmlDocPtr doc, "title", "link", "description", - "author", - "comments", - "guid", - "pubDate", - "source" }; char **atts[] = { &item->title, &item->link, &item->description, - &item->author, - &item->comments, - &item->guid, - &item->pubDate, - &item->sourceName, }; if (itemKey) { @@ -128,38 +109,6 @@ parseXml(xmlDocPtr doc, } } - if (TAGIS(itemNode, "category")) { - if (item->categories) { - erealloc(item->categories, - strlen(item->categories) + strlen(itemKey) + 2); - - strcat(item->categories, " "); - strcat(item->categories, itemKey); - } else { - item->categories = ecalloc( - strlen(itemKey) + 2, - sizeof(char)); - strcpy(item->categories, itemKey); - } - } - - if (TAGIS(itemNode, "enclosure")) { - item->enclosureUrl = - (char *) xmlGetProp(itemNode, (xmlChar *) "url"); - item->enclosureType = - (char *) xmlGetProp(itemNode, (xmlChar *) "type"); - - char *endPtr; - errno = 0; - - item->enclosureLen = strtoul( - (char *) xmlGetProp(itemNode, (xmlChar *) "length"), - &endPtr, - 10); - - if (errno) - logMsg(1, "Invalid RSS: enclosure length is invalid.\n"); - } xmlFree(itemKey); } diff --git a/xml.h b/xml.h index b4e19a0..46f5891 100644 --- a/xml.h +++ b/xml.h @@ -3,16 +3,6 @@ struct itemStruct { char *title; char *link; char *description; - char *author; - char *categories; - char *comments; - char *enclosureUrl; - char *enclosureType; - unsigned long long enclosureLen; - char *guid; - char *pubDate; - char *sourceName; - char *sourceUrl; itemStruct *next; };