[libgrss] Aligned examples to the new namespace



commit c841c4807fcc8270b8a220d5cf0d374e88a5513c
Author: Roberto Guido <bob4mail gmail com>
Date:   Tue Nov 23 20:50:19 2010 +0100

    Aligned examples to the new namespace

 examples/fetcher.c        |   28 +++++++++---------
 examples/parse-outlines.c |   69 ---------------------------------------------
 examples/subscriber.c     |   29 ++++++++++---------
 src/feed-channel.c        |    2 +-
 4 files changed, 30 insertions(+), 98 deletions(-)
---
diff --git a/examples/fetcher.c b/examples/fetcher.c
index 70859f5..33e3db5 100644
--- a/examples/fetcher.c
+++ b/examples/fetcher.c
@@ -20,21 +20,21 @@
 
 #include <libgrss.h>
 
-static void feed_fetched (FeedsPool *pool, FeedChannel *feed, GList *items)
+static void feed_fetched (GrssFeedsPool *pool, GrssFeedChannel *feed, GList *items)
 {
 	GList *iter;
-	FeedItem *item;
+	GrssFeedItem *item;
 
 	if (items == NULL) {
-		printf ("Error while fetching %s\n", feed_channel_get_title (feed));
+		printf ("Error while fetching %s\n", grss_feed_channel_get_title (feed));
 		return;
 	}
 
-	printf ("Fetched from %s\n", feed_channel_get_title (feed));
+	printf ("Fetched from %s\n", grss_feed_channel_get_title (feed));
 
 	for (iter = items; iter; iter = g_list_next (iter)) {
-		item = (FeedItem*) iter->data;
-		printf ("\t\t%s\n", feed_item_get_title (item));
+		item = (GrssFeedItem*) iter->data;
+		printf ("\t\t%s\n", grss_feed_item_get_title (item));
 	}
 
 	printf ("\n\n");
@@ -52,8 +52,8 @@ int main ()
 	};
 	GList *iter;
 	GList *list;
-	FeedChannel *feed;
-	FeedsPool *pool;
+	GrssFeedChannel *feed;
+	GrssFeedsPool *pool;
 
 	g_type_init ();
 	g_thread_init (NULL);
@@ -61,17 +61,17 @@ int main ()
 	list = NULL;
 
 	for (i = 0; example_feeds [i] != NULL; i++) {
-		feed = feed_channel_new ();
-		feed_channel_set_source (feed, example_feeds [i]);
-		feed_channel_set_update_interval (feed, i + 1);
+		feed = grss_feed_channel_new ();
+		grss_feed_channel_set_source (feed, example_feeds [i]);
+		grss_feed_channel_set_update_interval (feed, i + 1);
 		list = g_list_prepend (list, feed);
 	}
 
 	list = g_list_reverse (list);
 
-	pool = feeds_pool_new ();
-	feeds_pool_listen (pool, list);
-	feeds_pool_switch (pool, TRUE);
+	pool = grss_feeds_pool_new ();
+	grss_feeds_pool_listen (pool, list);
+	grss_feeds_pool_switch (pool, TRUE);
 
 	g_signal_connect (pool, "feed-ready", G_CALLBACK (feed_fetched), NULL);
 
diff --git a/examples/subscriber.c b/examples/subscriber.c
index 5cdf7d3..71f45cf 100644
--- a/examples/subscriber.c
+++ b/examples/subscriber.c
@@ -21,19 +21,19 @@
 #include <libgrss.h>
 
 static void
-item_fetched (FeedsSubscriber *subscriber, FeedChannel *feed, FeedItem *item)
+item_fetched (GrssFeedsSubscriber *subscriber, GrssFeedChannel *feed, GrssFeedItem *item)
 {
-	printf ("Received from %s\n", feed_channel_get_title (feed));
-	printf ("\t\t%s\n\n\n", feed_item_get_title (item));
+	printf ("Received from %s\n", grss_feed_channel_get_title (feed));
+	printf ("\t\t%s\n\n\n", grss_feed_item_get_title (item));
 }
 
 static gboolean
 start_subscribe (gpointer data)
 {
-	FeedsSubscriber *sub;
+	GrssFeedsSubscriber *sub;
 
-	sub = (FeedsSubscriber*) data;
-	feeds_subscriber_switch (sub, TRUE);
+	sub = (GrssFeedsSubscriber*) data;
+	grss_feeds_subscriber_switch (sub, TRUE);
 	printf ("Ready, now waiting for events.\n\n");
 	return FALSE;
 }
@@ -50,8 +50,8 @@ main ()
 	};
 	GList *iter;
 	GList *list;
-	FeedChannel *feed;
-	FeedsSubscriber *sub;
+	GrssFeedChannel *feed;
+	GrssFeedsSubscriber *sub;
 
 	g_type_init ();
 
@@ -65,16 +65,17 @@ main ()
 	printf ("... fetching feeds...\n");
 
 	for (i = 0; example_feeds [i] != NULL; i++) {
-		feed = feed_channel_new ();
-		feed_channel_set_source (feed, example_feeds [i]);
-		ok = feed_channel_fetch (feed);
+		feed = grss_feed_channel_new ();
+		grss_feed_channel_set_source (feed, example_feeds [i]);
+		ok = grss_feed_channel_fetch (feed);
 
 		if (ok == FALSE) {
 			g_warning ("Unable to fetch feed at %s", example_feeds [i]);
 			g_object_unref (feed);
 		}
-		else
+		else {
 			list = g_list_prepend (list, feed);
+		}
 	}
 
 	if (list == NULL)
@@ -83,9 +84,9 @@ main ()
 	printf ("... feeds analyzed...\n");
 	list = g_list_reverse (list);
 
-	sub = feeds_subscriber_new ();
+	sub = grss_feeds_subscriber_new ();
 
-	ok = feeds_subscriber_listen (sub, list);
+	ok = grss_feeds_subscriber_listen (sub, list);
 	g_list_free (list);
 
 	if (ok == FALSE) {
diff --git a/src/feed-channel.c b/src/feed-channel.c
index 40b5082..555f9f3 100644
--- a/src/feed-channel.c
+++ b/src/feed-channel.c
@@ -542,7 +542,7 @@ grss_feed_channel_add_contributor (GrssFeedChannel *channel, gchar *contributor)
  * Return value: list of contributors to the channel, or NULL
  */
 const GList*
-grss_feed_channel_get_contributor (GrssFeedChannel *channel)
+grss_feed_channel_get_contributors (GrssFeedChannel *channel)
 {
 	return (const GList*) channel->priv->contributors;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]