work on making RSS aggregator instances and roomlists consistant.
[citadel.git] / citadel / modules / rssclient / rss_atom_parser.h
index e2f6e4d094a5c89aafa9373833a8223184f3e47b..e6deb8a8a3d8972f37838ee094eae09055b6c803 100644 (file)
 #define RSS_ATOM        (1<<2)
 #define RSS_REQUIRE_BUF (1<<3)
 
-typedef struct _rss_item {
+typedef struct rss_aggregator rss_aggregator;
+typedef struct rss_item rss_item;
+typedef struct rss_room_counter rss_room_counter;
+
+typedef void (*rss_handler_func)(StrBuf *CData, 
+                                rss_item *ri, 
+                                rss_aggregator *Cfg, 
+                                const char** Attr);
+
+
+typedef struct __rss_xml_handler {
+       int              Flags;
+       rss_handler_func Handler;
+}rss_xml_handler;
+
+struct rss_item {
        int     done_parsing;
        int     item_tag_nesting;
-       int     roomlist_parts;
        time_t  pubdate;
-       StrBuf *roomlist;
        StrBuf *guid;
        StrBuf *title;
        StrBuf *link;
@@ -41,43 +54,40 @@ typedef struct _rss_item {
        StrBuf *author_or_creator;
        StrBuf *author_url;
        StrBuf *author_email;
-}rss_item;
-
-typedef struct __rssnetcfg {
-       int     Attached;
-       int     ItemType;
-       int     roomlist_parts;
-       time_t  last_error_when;
-       time_t  next_poll;
-       StrBuf *Url;
-       StrBuf *rooms;
-}rssnetcfg;
+};
 
-typedef void (*rss_handler_func)(StrBuf *CData, 
-                                rss_item *ri, 
-                                rssnetcfg *Cfg, 
-                                const char** Attr);
+struct rss_room_counter {
+       int count;
+       long QRnumber;
+};
 
-typedef struct __rss_xml_handler {
-       int              Flags;
-       rss_handler_func Handler;
-}rss_xml_handler;
-
-typedef struct _rsscollection {
+struct rss_aggregator {
        AsyncIO          IO;
        XML_Parser       xp;
+
+       int              RefCount;
+       int              ItemType;
+       int              roomlist_parts;
+
+       time_t           last_error_when;
+       time_t           next_poll;
+       StrBuf          *Url;
+       StrBuf          *rooms;
+       long             QRnumber;
+       HashList        *OtherQRnumbers;
                        
-       StrBuf          *CData;
-       StrBuf          *Key;
+       StrBuf          *CData;
+       StrBuf          *Key;
                        
        rss_item        *Item;
-       rssnetcfg       *Cfg;
        
        rss_xml_handler *Current;
-} rsscollection;
+};
+
+
 
 
 
 eNextState ParseRSSReply(AsyncIO *IO);
 
-void rss_save_item(rss_item *ri);
+void rss_save_item(rss_item *ri, rss_aggregator *Cfg);