New initial RSS code. Parser written by Sisu (Mikko Sysikaski) with more portable...
[monky] / src / prss.h
1 #ifndef PRSS_H
2 #define PRSS_H
3
4 #include <libxml/parser.h>
5
6 typedef struct PRSS_Item_ {
7         char* title;
8         char* link;
9         char* description;
10         char* category;
11         char* pubdate;
12 } PRSS_Item;
13
14 typedef struct PRSS_ {
15         xmlDocPtr _data;
16         
17         char* title;
18         char* link;
19         char* description;
20         char* language;
21
22         PRSS_Item* items;
23         int item_count;
24 } PRSS;
25
26 /* Functions for parsing RSS-data */
27 PRSS* prss_parse_data(const char *xml_data);
28 PRSS* prss_parse_file(const char *xml_file);
29
30 /* Frees the PRSS-stucture returned by prss_parse_*.
31  * The memory area pointed by data becomes invalid
32  * after call to this function. */
33 void prss_free(PRSS* data);
34
35 #endif  // PRSS_H