2 * Copyright (C) 2006 Andrej Kacian <andrej@kacian.sk>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
26 #define FEED_DEFAULT_TIMEOUT 20 /* In seconds */
28 /* ---------------- Structures */
30 typedef struct _Feed Feed;
31 typedef struct _FeedItem FeedItem;
32 typedef struct _FeedParserCtx FeedParserCtx;
46 gboolean ssl_verify_peer;
51 struct _FeedParserCtx {
58 gboolean id_is_permalink;
71 /* ---------------- Prototypes */
73 Feed *feed_new(gchar *url);
74 void feed_free(Feed *feed);
76 void feed_free_items(Feed *feed);
78 void feed_set_timeout(Feed *feed, guint timeout);
79 guint feed_get_timeout(Feed *feed);
81 void feed_set_url(Feed *feed, gchar *url);
82 gchar *feed_get_url(Feed *feed);
84 gchar *feed_get_title(Feed *feed);
85 void feed_set_title(Feed *feed, gchar *new_title);
87 gchar *feed_get_description(Feed *feed);
88 gchar *feed_get_language(Feed *feed);
89 gchar *feed_get_author(Feed *feed);
90 gchar *feed_get_generator(Feed *feed);
91 gchar *feed_get_fetcherror(Feed *feed);
93 gchar *feed_get_cookies_path(Feed *feed);
94 void feed_set_cookies_path(Feed *feed, gchar *path);
96 gboolean feed_get_ssl_verify_peer(Feed *feed);
97 void feed_set_ssl_verify_peer(Feed *feed, gboolean ssl_verify_peer);
99 gint feed_n_items(Feed *feed);
100 FeedItem *feed_nth_item(Feed *feed, guint n);
102 void feed_foreach_item(Feed *feed, GFunc func, gpointer data);
104 gboolean feed_prepend_item(Feed *feed, FeedItem *item);
105 gboolean feed_append_item(Feed *feed, FeedItem *item);
106 gboolean feed_insert_item(Feed *feed, FeedItem *item, gint pos);
108 guint feed_update(Feed *feed, time_t last_update);
110 #define FILL(n) { g_free(n); n = g_strdup(text); } while(0);
112 #include "feeditem.h"
114 #endif /* __FEED_H */