mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
cpp-ify prss.c
This commit is contained in:
parent
526e8d346e
commit
325a29e438
@ -191,7 +191,7 @@ static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root)
|
||||
if (res->version) free(res->version);
|
||||
res->version = strndup("2.0", text_buffer_size);
|
||||
if (res->items) free_rss_items(res);
|
||||
res->items = malloc(items * sizeof(PRSS_Item));
|
||||
res->items = (PRSS_Item*) malloc(items * sizeof(PRSS_Item));
|
||||
res->item_count = 0;
|
||||
|
||||
for (n = channel->children; n; n = n->next) {
|
||||
@ -224,7 +224,7 @@ static inline int parse_rss_1_0(PRSS *res, xmlNodePtr root)
|
||||
if (res->version) free(res->version);
|
||||
res->version = strndup("1.0", text_buffer_size);
|
||||
if (res->items) free_rss_items(res);
|
||||
res->items = malloc(items * sizeof(PRSS_Item));
|
||||
res->items = (PRSS_Item*) malloc(items * sizeof(PRSS_Item));
|
||||
res->item_count = 0;
|
||||
|
||||
for (n = root->children; n; n = n->next) {
|
||||
|
@ -20,10 +20,6 @@
|
||||
|
||||
#include <libxml/parser.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct PRSS_Item_ {
|
||||
char *title;
|
||||
char *link;
|
||||
@ -64,8 +60,4 @@ PRSS *prss_parse_doc(xmlDocPtr doc); */
|
||||
* after call to this function. */
|
||||
void prss_free(PRSS *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PRSS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user