RSSyl: support HTTP basic auth in libfeed
[claws.git] / src / plugins / rssyl / libfeed / feed.h
index af9fc3b696e046d5058fcf6e4ba01ef487646471..5abde34bf2b9321d437da0aaf0fc65d4e472ec20 100644 (file)
 typedef struct _Feed Feed;
 typedef struct _FeedItem FeedItem;
 typedef struct _FeedParserCtx FeedParserCtx;
+typedef struct _FeedAuth FeedAuth;
+
+typedef enum {
+       FEED_AUTH_NONE,
+       FEED_AUTH_BASIC
+} FeedAuthType;
+
+struct _FeedAuth {
+       FeedAuthType type;
+       gchar *username;
+       gchar *password;
+};
        
 struct _Feed {
        gchar *url;
+       FeedAuth *auth;
        gchar *title;
        gchar *description;
        gchar *language;
@@ -66,7 +79,8 @@ typedef enum {
        FEED_ERR_NOFEED,
        FEED_ERR_NOURL,
        FEED_ERR_INIT,
-       FEED_ERR_FETCH
+       FEED_ERR_FETCH,
+       FEED_ERR_UNAUTH
 } FeedErrCodes;
 
 /* ---------------- Prototypes */
@@ -82,6 +96,9 @@ guint feed_get_timeout(Feed *feed);
 void feed_set_url(Feed *feed, gchar *url);
 gchar *feed_get_url(Feed *feed);
 
+void feed_set_auth(Feed *feed, FeedAuth *auth);
+FeedAuth *feed_get_auth(Feed *feed);
+
 gchar *feed_get_title(Feed *feed);
 void feed_set_title(Feed *feed, gchar *new_title);