Commit 5606c9ce authored by Lucian Langa's avatar Lucian Langa
Browse files

various cleanups part3

parent 7fa9068d
2009-05-06 Lucian Langa <lucilanga@gnome.org>
* src/parser.c (html_set_base), (parse_html),
(layer_find_innerelement), (html_find), (layer_find),
(layer_find_all), (content_rss), (dublin_core_rss), (wfw_rss),
(layer_find_ns_tag), (layer_find_tag), (media_rss),
(layer_find_tag_prop), (layer_find_innerhtml), (layer_find_pos),
(tree_walk), (parse_channel_line):
* src/rss.c (browsercb), (feed_to_xml), (xml_set_content),
(xml_set_prop), (xml_set_bool), (feed_new_from_xml),
(feeds_uid_from_xml), (read_feeds), (org_gnome_cooly_format_rss),
(search_rss), (setup_feed), (generic_finish_feed), (fetch_feed),
(finish_website), (print_comments), (finish_update_feed_image),
(store_folder_renamed), (org_gnome_cooly_rss_startup): various
cleanups part 3
2009-05-05 Lucian Langa <lucilanga@gnome.org>
* src/Makefile.am:
......
......@@ -40,24 +40,24 @@ html_set_base(xmlNode *doc, char *base, char *tag, char *prop, char *basehref)
SoupURI *base_uri = soup_uri_new (base);
#endif
while ((doc = html_find((xmlNode *)doc, tag))) {
if ((url = xmlGetProp(doc, prop))) {
if ((url = (gchar *)xmlGetProp(doc, (xmlChar *)prop))) {
if (!strncmp(tag, "img", 3) && !strncmp(prop, "src", 3)) {
gchar *tmpurl = strplchr(url);
xmlSetProp(doc, prop, tmpurl);
xmlSetProp(doc, (xmlChar *)prop, (xmlChar *)tmpurl);
g_free(tmpurl);
}
d(g_print("DEBUG: parsing: %s\n", url));
if (url[0] == '/' && url[1] != '/') {
gchar *server = get_server_from_uri(base);
gchar *tmp = g_strdup_printf("%s/%s", server, url);
xmlSetProp(doc, prop, tmp);
xmlSetProp(doc, (xmlChar *)prop, (xmlChar *)tmp);
g_free(tmp);
g_free(server);
}
if (url[0] == '/' && url[1] == '/') {
/*FIXME handle ssl */
gchar *tmp = g_strdup_printf("%s%s", "http:", url);
xmlSetProp(doc, prop, tmp);
xmlSetProp(doc, (xmlChar *)prop, (xmlChar *)tmp);
g_free(tmp);
}
if (url[0] != '/' && !g_str_has_prefix(url, "http://")
......@@ -77,7 +77,7 @@ html_set_base(xmlNode *doc, char *base, char *tag, char *prop, char *basehref)
//xmlSetProp(doc, prop, g_strdup_printf("%s/%s", get_server_from_uri(base), url));
if (newuri) {
newuristr = soup_uri_to_string (newuri, FALSE);
xmlSetProp(doc, prop, (xmlChar *)newuristr);
xmlSetProp(doc, (xmlChar *)prop, (xmlChar *)newuristr);
g_free(newuristr);
soup_uri_free(newuri);
}
......@@ -218,7 +218,7 @@ parse_html(char *url, const char *html, int len)
return NULL;
doc = src;
gchar *newbase = NULL;
newbase = xmlGetProp(html_find((xmlNode *)doc, "base"), "href");
newbase = (gchar *)xmlGetProp(html_find((xmlNode *)doc, "base"), (xmlChar *)"href");
d(g_print("newbase:|%s|\n", newbase));
xmlDoc *tmpdoc = (xmlDoc *)html_find((xmlNode *)doc, "base");
xmlUnlinkNode((xmlNode *)tmpdoc);
......@@ -302,8 +302,8 @@ layer_find_innerelement (xmlNodePtr node,
xmlDebugDumpNode (stdout, node, 32);
printf("%s.\n", node->name);
#endif
if (strcasecmp (node->name, match)==0) {
return xmlGetProp(node, el);
if (strcasecmp ((char *)node->name, match)==0) {
return (char *)xmlGetProp(node, (xmlChar *)el);
}
node = node->next;
}
......@@ -339,7 +339,7 @@ g_print("parser error 3_2 -> return NULL!!!\n");
}
if (node->name) {
if (!strcmp (node->name, match))
if (!strcmp ((char *)node->name, match))
{
#ifdef RDF_DEBUG
g_print("parser error 3_3 -> return NULL!!!\n");
......@@ -366,9 +366,9 @@ layer_find (xmlNodePtr node,
xmlDebugDumpNode (stdout, node, 32);
printf("%s.\n", node->name);
#endif
if (strcasecmp (node->name, match)==0) {
if (strcasecmp ((char *)node->name, match)==0) {
if (node->children != NULL && node->children->content != NULL) {
return node->children->content;
return (char *)(node->children->content);
} else {
return fail;
}
......@@ -392,10 +392,10 @@ layer_find_all (xmlNodePtr node,
xmlDebugDumpNode (stdout, node, 32);
printf("%s.\n", node->name);
#endif
if (strcasecmp (node->name, match)==0) {
while (strcasecmp (node->name, match)==0) {
if (strcasecmp ((char *)node->name, match)==0) {
while (strcasecmp ((char *)node->name, match)==0) {
if (node->children != NULL && node->children->content != NULL) {
category = g_list_append(category, g_strdup(node->children->content));
category = g_list_append(category, g_strdup((char *)node->children->content));
}
node = node->next;
}
......@@ -424,7 +424,7 @@ content_rss(xmlNode *node, gchar *fail)
{
gchar *content;
content = xmlNodeGetContent(node);
content = (char *)xmlNodeGetContent(node);
if (content)
return content;
else
......@@ -436,7 +436,7 @@ dublin_core_rss(xmlNode *node, gchar *fail)
{
gchar *content;
content = xmlNodeGetContent(node);
content = (char *)xmlNodeGetContent(node);
if (content)
return content;
else
......@@ -454,7 +454,7 @@ wfw_rss(xmlNode *node, gchar *fail)
{
gchar *content;
content = xmlNodeGetContent(node);
content = (char *)xmlNodeGetContent(node);
if (content)
return content;
else
......@@ -481,10 +481,10 @@ layer_find_ns_tag(xmlNodePtr node,
while (node!=NULL) {
if (node->ns && node->ns->prefix) {
for (i=0; i < 5; i++) {
if (!strcasecmp (node->ns->prefix, standard_rss_modules[i][1])) {
if (!strcasecmp ((char *)node->ns->prefix, standard_rss_modules[i][1])) {
func = (gpointer)standard_rss_modules[i][2];
if (strcasecmp (node->ns->prefix, nsmatch) == 0
&& strcasecmp (node->name, match) == 0 ) {
if (strcasecmp ((char *)node->ns->prefix, nsmatch) == 0
&& strcasecmp ((char *)node->name, match) == 0 ) {
return func(node, fail);
}
}
......@@ -514,29 +514,29 @@ layer_find_tag (xmlNodePtr node,
#endif
if (node->ns && node->ns->prefix) {
for (i=0; i < 4; i++) {
if (!strcasecmp (node->ns->prefix, standard_rss_modules[i][1])) {
if (!strcasecmp ((char *)node->ns->prefix, standard_rss_modules[i][1])) {
func = (gpointer)standard_rss_modules[i][2];
if (strcasecmp (node->ns->prefix, match)==0) {
if (strcasecmp ((char *)node->ns->prefix, match)==0) {
xmlBufferFree(buf);
return func(node, fail);
}
}
}
}
if (strcasecmp (node->name, match)==0) {
if (strcasecmp ((char *)node->name, match)==0) {
if (node->children != NULL) {
if (node->children->type == 1 //XML_NODE_ELEMENT
/* || node->children->type == 3 */ //XML_NODE_TEXT
|| node->children->next != NULL) {
d(g_print("NODE DUMP:%s|\n", xmlNodeGetContent(node->children->next)));
gchar *nodetype = xmlGetProp(node, "type");
gchar *nodetype = (gchar *)xmlGetProp(node, (xmlChar *)"type");
if (!strcasecmp(nodetype, "xhtml")) { // test this with "html" or smth else
//this looses html entities
len = xmlNodeDump(buf, node->doc, node->children, 0, 0);
content = g_strdup_printf("%s", xmlBufferContent(buf));
xmlBufferFree(buf);
} else
content = xmlNodeGetContent(node->children);
content = (char *)xmlNodeGetContent(node->children);
if (nodetype)
xmlFree(nodetype);
return content;
......@@ -558,7 +558,7 @@ media_rss(xmlNode *node, gchar *search, gchar *fail)
gchar *content;
g_print("media_rss()\n");
content = xmlGetProp(node, search);
content = (gchar *)xmlGetProp(node, (xmlChar *)search);
if (content)
return content;
else
......@@ -588,10 +588,10 @@ layer_find_tag_prop (xmlNodePtr node,
{
for (i=0; i < 1; i++)
{
if (!strcasecmp (node->ns->prefix, property_rss_modules[i][1]))
if (!strcasecmp ((char *)node->ns->prefix, property_rss_modules[i][1]))
{
func = (gpointer)property_rss_modules[i][2];
if (strcasecmp (node->ns->prefix, match)==0)
if (strcasecmp ((char *)node->ns->prefix, match)==0)
{
g_print("URL:%s\n", func(node, search, fail));
}
......@@ -613,7 +613,7 @@ layer_find_innerhtml (xmlNodePtr node,
xmlDebugDumpNode (stdout, node, 32);
printf("%s.\n", node->name);
#endif
if (strcasecmp (node->name, match)==0 && node->children) {
if (strcasecmp ((char *)node->name, match)==0 && node->children) {
return layer_find(node->children->next, submatch, fail);
}
node = node->next;
......@@ -631,10 +631,10 @@ layer_find_pos (xmlNodePtr node,
xmlDebugDumpNode (stdout, node, 32);
printf("%s.\n", node->name);
#endif
if (strcasecmp (node->name, match)==0 && node->children) {
if (strcasecmp ((char *)node->name, match)==0 && node->children) {
subnode = node->children;
while (subnode!=NULL) {
if (strcasecmp (subnode->name, submatch)==0 && subnode->children)
if (strcasecmp ((char *)subnode->name, submatch)==0 && subnode->children)
{
return subnode->children->next;
}
......@@ -725,7 +725,7 @@ tree_walk (xmlNodePtr root, RDF *r)
#ifdef RDF_DEBUG
printf ("%p, %s\n", walk, walk->name);
#endif
if (strcasecmp (walk->name, "rdf") == 0) {
if (strcasecmp ((char *)walk->name, "rdf") == 0) {
// xmlNode *node = walk;
rewalk = walk->children;
walk = walk->next;
......@@ -740,14 +740,14 @@ tree_walk (xmlNodePtr root, RDF *r)
// xmlFree(ver);
continue;
}
if (strcasecmp (walk->name, "rss") == 0){
if (strcasecmp ((char *)walk->name, "rss") == 0){
xmlNode *node = walk;
rewalk = walk->children;
walk = walk->next;
if (!r->type)
r->type = g_strdup("RSS");
r->type_id = RSS_FEED;
gchar *ver = xmlGetProp(node, "version");
gchar *ver = (gchar *)xmlGetProp(node, (xmlChar *)"version");
if (r->version)
g_free(r->version);
r->version = g_strdup(ver);
......@@ -755,12 +755,12 @@ tree_walk (xmlNodePtr root, RDF *r)
xmlFree(ver);
continue;
}
if (strcasecmp (walk->name, "feed") == 0) {
if (strcasecmp ((char *)walk->name, "feed") == 0) {
xmlNode *node = walk;
if (!r->type)
r->type = g_strdup("ATOM");
r->type_id = ATOM_FEED;
gchar *ver = xmlGetProp(node, "version");
gchar *ver = (gchar *)xmlGetProp(node, (xmlChar *)"version");
if (ver)
{
if (r->version)
......@@ -780,21 +780,21 @@ tree_walk (xmlNodePtr root, RDF *r)
#ifdef RDF_DEBUG
printf ("Top level '%s'.\n", walk->name);
#endif
if (strcasecmp (walk->name, "channel") == 0) {
if (strcasecmp ((char *)walk->name, "channel") == 0) {
channel = walk;
rewalk = channel->children;
}
if (strcasecmp (walk->name, "feed") == 0) {
if (strcasecmp ((char *)walk->name, "feed") == 0) {
channel = walk;
rewalk = channel->children;
}
if (strcasecmp (walk->name, "image") == 0) {
if (strcasecmp ((char *)walk->name, "image") == 0) {
image = walk;
}
if (strcasecmp (walk->name, "item") == 0) {
if (strcasecmp ((char *)walk->name, "item") == 0) {
g_array_append_val(item, walk);
}
if (strcasecmp (walk->name, "entry") == 0) {
if (strcasecmp ((char *)walk->name, "entry") == 0) {
g_array_append_val(item, walk);
}
walk = walk->next;
......@@ -981,27 +981,25 @@ parse_channel_line(xmlNode *top, gchar *feed_name, char *main_date)
if (feed_name) {
xmlDoc *src = (xmlDoc *)parse_html_sux(tmp, strlen(tmp));
if (src)
{
if (src) {
xmlNode *doc = (xmlNode *)src;
while (doc = html_find(doc, "img"))
{
while ((doc = html_find(doc, "img"))) {
gchar *name = NULL;
xmlChar *url = xmlGetProp(doc, "src");
xmlChar *url = xmlGetProp(doc, (xmlChar *)"src");
if (url) {
if (name = fetch_image(url, link)) {
xmlSetProp(doc, "src", name);
if ((name = fetch_image((gchar *)url, link))) {
xmlSetProp(doc, (xmlChar *)"src", (xmlChar *)name);
g_free(name);
}
xmlFree(url);
}
}
xmlDocDumpMemory(src, &buff, &size);
xmlDocDumpMemory(src, &buff, (int*)&size);
xmlFree(src);
}
g_free(tmp);
b=buff;
b=(gchar *)buff;
}
else
b = tmp;
......
......@@ -511,7 +511,7 @@ browsercb(NetStatusType status, gpointer statusdata, gpointer data)
// g_print("chunk:%s\n", progress->chunk);
g_print("total:%d\n", progress->total);
g_print("curent:%d\n", progress->current);
g_print("--------------\n chunk: %d \n=============\n", progress->chunksize);
g_print("--------------\n chunk: %d \n=============\n", GPOINTER_TO_INT(progress->chunksize));
//browser_write(progress->chunk, progress->chunksize, data);
// browser_fill+=progress->chunksize;
break;
......@@ -816,42 +816,42 @@ feed_to_xml(gchar *key)
int n;
gchar *ctmp;
doc = xmlNewDoc ("1.0");
doc = xmlNewDoc ((xmlChar *)"1.0");
root = xmlNewDocNode (doc, NULL, "feed", NULL);
root = xmlNewDocNode (doc, NULL, (xmlChar *)"feed", NULL);
xmlDocSetRootElement (doc, root);
xmlSetProp (root, "uid", g_hash_table_lookup(rf->hrname, key));
xmlSetProp (root, "enabled", g_hash_table_lookup(rf->hre, lookup_key(key)) ? "true" : "false");
xmlSetProp (root, "html", g_hash_table_lookup(rf->hrh, lookup_key(key)) ? "true" : "false");
xmlSetProp (root, (xmlChar *)"uid", (xmlChar *)(g_hash_table_lookup(rf->hrname, key)));
xmlSetProp (root, (xmlChar *)"enabled", (xmlChar *)(g_hash_table_lookup(rf->hre, lookup_key(key)) ? "true" : "false"));
xmlSetProp (root, (xmlChar *)"html", (xmlChar *)(g_hash_table_lookup(rf->hrh, lookup_key(key)) ? "true" : "false"));
xmlNewTextChild (root, NULL, "name", key);
xmlNewTextChild (root, NULL, "url", g_hash_table_lookup(rf->hr, lookup_key(key)));
xmlNewTextChild (root, NULL, "type", g_hash_table_lookup(rf->hrt, lookup_key(key)));
xmlNewTextChild (root, NULL, (xmlChar *)"name", (xmlChar *)key);
xmlNewTextChild (root, NULL, (xmlChar *)"url", (xmlChar *)g_hash_table_lookup(rf->hr, lookup_key(key)));
xmlNewTextChild (root, NULL, (xmlChar *)"type", (xmlChar *)g_hash_table_lookup(rf->hrt, lookup_key(key)));
src = xmlNewTextChild (root, NULL, "delete", NULL);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrdel_feed, lookup_key(key)));
xmlSetProp (src, "option", ctmp);
src = xmlNewTextChild (root, NULL, (xmlChar *)"delete", NULL);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrdel_feed, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"option", (xmlChar *)ctmp);
g_free(ctmp);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrdel_days, lookup_key(key)));
xmlSetProp (src, "days", ctmp);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrdel_days, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"days", (xmlChar *)ctmp);
g_free(ctmp);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrdel_messages, lookup_key(key)));
xmlSetProp (src, "messages", ctmp);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrdel_messages, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"messages", (xmlChar *)ctmp);
g_free(ctmp);
xmlSetProp (src, "unread",
g_hash_table_lookup(rf->hrdel_unread, lookup_key(key)) ? "true" : "false");
xmlSetProp (src, (xmlChar *)"unread",
(xmlChar *)(g_hash_table_lookup(rf->hrdel_unread, lookup_key(key)) ? "true" : "false"));
src = xmlNewTextChild (root, NULL, "ttl", NULL);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrupdate, lookup_key(key)));
xmlSetProp (src, "option", ctmp);
src = xmlNewTextChild (root, NULL, (xmlChar *)"ttl", NULL);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrupdate, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"option", (xmlChar *)ctmp);
g_free(ctmp);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrttl, lookup_key(key)));
xmlSetProp (src, "value", ctmp);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrttl, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"value", (xmlChar *)ctmp);
g_free(ctmp);
ctmp = g_strdup_printf("%d", g_hash_table_lookup(rf->hrttl_multiply, lookup_key(key)));
xmlSetProp (src, "factor", ctmp);
ctmp = g_strdup_printf("%d", GPOINTER_TO_INT(g_hash_table_lookup(rf->hrttl_multiply, lookup_key(key))));
xmlSetProp (src, (xmlChar *)"factor", (xmlChar *)ctmp);
g_free(ctmp);
xmlDocDumpMemory (doc, &xmlbuf, &n);
......@@ -1009,7 +1009,7 @@ xml_set_content (xmlNodePtr node, char **val)
char *buf;
int res;
buf = xmlNodeGetContent(node);
buf = (char *)xmlNodeGetContent(node);
if (buf == NULL) {
res = (*val != NULL);
if (res) {
......@@ -1034,7 +1034,7 @@ xml_set_prop (xmlNodePtr node, const char *name, char **val)
char *buf;
int res;
buf = xmlGetProp (node, name);
buf = (char *)xmlGetProp (node, (xmlChar *)name);
if (buf == NULL) {
res = (*val != NULL);
if (res) {
......@@ -1059,7 +1059,7 @@ xml_set_bool (xmlNodePtr node, const char *name, gboolean *val)
gboolean gbool;
char *buf;
if ((buf = xmlGetProp (node, name))) {
if ((buf = (char *)xmlGetProp (node, (xmlChar *)name))) {
gbool = (!strcmp (buf, "true") || !strcmp (buf, "yes"));
xmlFree (buf);
......@@ -1093,11 +1093,11 @@ feed_new_from_xml(char *xml)
guint update=0;
gchar *ctmp = NULL;
if (!(doc = xmlParseDoc ((char *)xml)))
if (!(doc = xmlParseDoc ((xmlChar *)xml)))
return FALSE;
node = doc->children;
if (strcmp (node->name, "feed") != 0) {
if (strcmp ((char *)node->name, "feed") != 0) {
xmlFreeDoc (doc);
return FALSE;
}
......@@ -1107,25 +1107,25 @@ feed_new_from_xml(char *xml)
xml_set_bool (node, "html", &html);
for (node = node->children; node; node = node->next) {
if (!strcmp (node->name, "name")) {
if (!strcmp ((char *)node->name, "name")) {
xml_set_content (node, &name);
}
if (!strcmp (node->name, "url")) {
if (!strcmp ((char *)node->name, "url")) {
xml_set_content (node, &url);
}
if (!strcmp (node->name, "type")) {
if (!strcmp ((char *)node->name, "type")) {
xml_set_content (node, &type);
}
if (!strcmp (node->name, "delete")) {
if (!strcmp ((char *)node->name, "delete")) {
xml_set_prop (node, "option", &ctmp);
del_feed = atoi(ctmp);
xml_set_prop (node, "days", &ctmp);
del_days = atoi(ctmp);
xml_set_prop (node, "messages", &ctmp);
del_messages = atoi(ctmp);
xml_set_bool (node, "unread", &del_unread);
xml_set_bool (node, "unread", (gboolean *)&del_unread);
}
if (!strcmp (node->name, "ttl")) {
if (!strcmp ((char *)node->name, "ttl")) {
xml_set_prop (node, "option", &ctmp);
update = atoi(ctmp);
xml_set_prop (node, "value", &ctmp);
......@@ -1179,11 +1179,11 @@ feeds_uid_from_xml (const char *xml)
xmlDocPtr doc;
char *uid = NULL;
if (!(doc = xmlParseDoc ((char *)xml)))
if (!(doc = xmlParseDoc ((xmlChar *)xml)))
return NULL;
node = doc->children;
if (strcmp (node->name, "feed") != 0) {
if (strcmp ((char *)node->name, "feed") != 0) {
xmlFreeDoc (doc);
return NULL;
}
......@@ -1287,7 +1287,7 @@ read_feeds(rssfeed *rf)
load_gconf_feed();
res = 1;
out: g_free(feed_file);
g_free(feed_file);
return res;
}
......@@ -1963,7 +1963,7 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t) //camelmimepart
CamelDataWrapper *content = camel_medium_get_content_object(CAMEL_MEDIUM(t->part));
camel_data_wrapper_write_to_stream(content, (CamelStream *)stream);
g_byte_array_append (buffer, "", 1);
g_byte_array_append (buffer, (unsigned char *)"", 1);
//#ifdef EVOLUTION_2_12 //aparently this ("?" char parsing) is fixed in 2.12
// //then again this does not work in evo > 2.12 perhaps is gtkhtml related
// buff = buffer->data;
......@@ -1971,12 +1971,12 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t) //camelmimepart
gchar *tmp;
if (camel_content_type_is(type, "text", "evolution-rss-feed")) //old evolution-rss content type
{
tmp = decode_utf8_entities(buffer->data);
tmp = decode_utf8_entities((gchar *)(buffer->data));
}
else
tmp = g_strdup(buffer->data);
tmp = g_strdup((gchar *)(buffer->data));
buff=tmp;
buff=(xmlChar *)tmp;
g_byte_array_free (buffer, 1);
// char *buff = decode_html_entities(buffer2);
/// buff=tmp;
......@@ -1989,7 +1989,7 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t) //camelmimepart
"<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 2px; color: #%06x;\">",
frame_colour & 0xffffff, content_colour & 0xEDECEB & 0xffffff, text_colour & 0xffffff);
if (g_file_test(feed_file, G_FILE_TEST_EXISTS))
if (pixbuf = gdk_pixbuf_new_from_file(feed_file, NULL)) {
if ((pixbuf = gdk_pixbuf_new_from_file(feed_file, NULL))) {
camel_stream_printf (fstream,
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<img height=16 src=%s>"
......@@ -2041,7 +2041,7 @@ render_body: if (category)
frame_colour & 0xffffff, content_colour & 0xffffff, text_colour & 0xffffff, result);
commstream = NULL;
} else {
fetch_comments(comments, t->format);
fetch_comments(comments, (EMFormatHTML *)t->format);
}
camel_stream_printf (fstream, "</div>");
}
......@@ -2200,11 +2200,11 @@ search_rss(char *buffer, int len)
xmlNode *doc = (xmlNode *)parse_html_sux (buffer, len);
while (doc) {
doc = html_find(doc, "link");
app = xmlGetProp(doc, "type");
app = (gchar *)xmlGetProp(doc, (xmlChar *)"type");
if (!g_ascii_strcasecmp(app, "application/atom+xml")
|| !g_ascii_strcasecmp(app, "application/xml")
|| !g_ascii_strcasecmp(app, "application/rss+xml")) {
return xmlGetProp(doc, "href");
return (gchar *)xmlGetProp(doc, (xmlChar *)"href");
}
xmlFree(app);
}
......@@ -2338,9 +2338,9 @@ top: d(g_print("adding feed->feed_url:%s\n", feed->feed_url));
root = xmlDocGetRootElement(doc);
if ((doc != NULL && root != NULL)
&& (strcasestr(root->name, "rss")
|| strcasestr(root->name, "rdf")
|| strcasestr(root->name, "feed"))) {
&& (strcasestr((char *)root->name, "rss")
|| strcasestr((char *)root->name, "rdf")
|| strcasestr((char *)root->name, "feed"))) {
r->cache = doc;
r->uri = feed->feed_url;
r->progress = feed->progress;
......@@ -2582,7 +2582,8 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
msg->status_code != SOUP_STATUS_CANCELLED) {
g_set_error(&err, NET_ERROR, NET_ERROR_GENERIC,
soup_status_get_phrase(msg->status_code));
gchar *tmsg = g_strdup_printf("\n%s\n%s", user_data, err->message);
gchar *tmsg = g_strdup_printf("\n%s\n%s", (gchar *)user_data,
(gchar *)err->message);
rss_error(user_data, NULL, _("Error fetching feed."), tmsg);
g_free(tmsg);
goto out;
......@@ -2627,7 +2628,7 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
GString *response = g_string_new_len(msg->body, msg->length);
g_print("feed %s\n", user_data);
g_print("feed %s\n", (gchar *)user_data);
while (gtk_events_pending ())
gtk_main_iteration ();
......@@ -2638,7 +2639,7 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
r->cache = xml_parse_sux (response->str, response->len);
if (rsserror) {
xmlError *err = xmlGetLastError();
gchar *tmsg = g_strdup_printf("\n%s\nInvalid feed: %s", user_data, err->message);
gchar *tmsg = g_strdup_printf("\n%s\nInvalid feed: %s", (gchar *)user_data, err->message);
rss_error(user_data, NULL, _("Error while parsing feed."), tmsg);
g_free(tmsg);
goto out;
......@@ -2693,7 +2694,7 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
#ifdef EVOLUTION_2_12
if (rf->sr_feed && !deleted)