* Please see COPYING for details
*
* Copyright (c) 2007 Toni Spets
- * Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
*
* $Id$ */
-#include <stdio.h>
-#include <string.h>
+#include "conky.h"
+#include "prss.h"
#include <time.h>
#include <assert.h>
-#include "prss.h"
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
-#include "conky.h"
#define MAX_FEEDS 16
return realsize;
}
-int rss_delay(int *wait, int delay)
+int rss_delay(int *wait_time, int delay)
{
time_t now = time(NULL);
}
delay *= 60;
- if (!*wait) {
- *wait = now + delay;
+ if (!*wait_time) {
+ *wait_time = now + delay;
return 1;
}
- if (now >= *wait + delay) {
- *wait = now + delay;
+ if (now >= *wait_time + delay) {
+ *wait_time = now + delay;
return 1;
}
return 0;
}
-void init_rss_info()
+void init_rss_info(void)
{
int i;
}
}
-void free_rss_info()
+void free_rss_info(void)
{
int i;
CURL *curl = NULL;
CURLcode res;
- // curl temps
- struct MemoryStruct chunk;
-
- chunk.memory = NULL;
- chunk.size = 0;
-
// pointers to struct
feed *curfeed = NULL;
PRSS *curdata = NULL;
int i;
+ // curl temps
+ struct MemoryStruct chunk;
+
+ chunk.memory = NULL;
+ chunk.size = 0;
+
// first seek for the uri in list
for (i = 0; i < num_feeds; i++) {
if (feeds[i].uri != NULL) {
return NULL;
}
curfeed = &feeds[num_feeds];
- curfeed->uri = strdup(uri);
+ curfeed->uri = strndup(uri, text_buffer_size);
num_feeds++;
}