From: <svn...@op...> - 2005-03-21 17:03:59
|
Author: azrael Date: 2005-03-21 18:04:35 +0100 (Mon, 21 Mar 2005) New Revision: 384 Modified: trunk/formats/vformats-xml/vformat.c trunk/formats/vformats-xml/xml-evolution.c trunk/formats/vformats-xml/xml-kde.c trunk/formats/vformats-xml/xml-support.c trunk/formats/vformats-xml/xml-vcal.c trunk/formats/vformats-xml/xml-vcard.c trunk/formats/vformats-xml/xml-vnote.c trunk/opensync/opensync_db.c trunk/opensync/opensync_env.c trunk/opensync/opensync_group.c trunk/opensync/opensync_hashtable.c trunk/opensync/opensync_member.c trunk/tools/osyncdump.c Log: Made opensync compile with gcc4. Thanks to pierre for the patch Modified: trunk/formats/vformats-xml/vformat.c =================================================================== --- trunk/formats/vformats-xml/vformat.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/vformat.c 2005-03-21 17:04:35 UTC (rev 384) @@ -916,7 +916,7 @@ break; } case VF_ENCODING_QP: { - char *qp_data = quoted_encode_simple (value, len); + char *qp_data = quoted_encode_simple ((unsigned char*)value, len); GString *decoded = g_string_new (value); /* make sure the decoded list is up to date */ @@ -1483,7 +1483,7 @@ static size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save) { unsigned char base64_rank[256]; - base64_init(base64_rank); + base64_init((char*)base64_rank); register unsigned char *inptr, *outptr; unsigned char *inend, c; @@ -1540,7 +1540,7 @@ out = g_malloc (len * 4 / 3 + 5); outlen = base64_encode_close ((unsigned char *)data, len, FALSE, - out, &state, &save); + out, &state, (int*)&save); out[outlen] = '\0'; return (char *)out; } Modified: trunk/formats/vformats-xml/xml-evolution.c =================================================================== --- trunk/formats/vformats-xml/xml-evolution.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-evolution.c 2005-03-21 17:04:35 UTC (rev 384) @@ -27,7 +27,7 @@ static xmlNode *handle_x_aim_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling x-aim attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-AIM", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-AIM", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -35,7 +35,7 @@ static xmlNode *handle_file_as_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling FileAs attribute"); - xmlNode *current = xmlNewChild(root, NULL, "FileAs", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"FileAs", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -43,7 +43,7 @@ static xmlNode *handle_manager_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Manager attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Manager", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Manager", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -51,7 +51,7 @@ static xmlNode *handle_assistant_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Assistant attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Assistant", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Assistant", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -59,7 +59,7 @@ static xmlNode *handle_anniversary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Anniversary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Anniversary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Anniversary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -67,7 +67,7 @@ static xmlNode *handle_spouse_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Spouse attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Spouse", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Spouse", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -75,7 +75,7 @@ static xmlNode *handle_blog_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling BlogUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "BlogUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"BlogUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -83,7 +83,7 @@ static xmlNode *handle_calendar_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling CalendarUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "CalendarUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"CalendarUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -91,7 +91,7 @@ static xmlNode *handle_free_busy_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling FreeBusyUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "FreeBusyUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"FreeBusyUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -99,7 +99,7 @@ static xmlNode *handle_video_chat_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling VideoUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "VideoUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"VideoUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -107,7 +107,7 @@ static xmlNode *handle_wants_html_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling WantsHtml attribute"); - xmlNode *current = xmlNewChild(root, NULL, "WantsHtml", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"WantsHtml", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -115,7 +115,7 @@ static xmlNode *handle_yahoo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-Yahoo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Yahoo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Yahoo", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -123,7 +123,7 @@ static xmlNode *handle_icq_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-ICQ attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-ICQ", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-ICQ", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -131,7 +131,7 @@ static xmlNode *handle_groupwise_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling GroupwiseDirectory attribute"); - xmlNode *current = xmlNewChild(root, NULL, "GroupwiseDirectory", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"GroupwiseDirectory", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -139,7 +139,7 @@ static xmlNode *handle_jabber_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Jabber attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Jabber", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Jabber", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -147,7 +147,7 @@ static xmlNode *handle_msn_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling MSN attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-MSN", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-MSN", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -156,7 +156,7 @@ static xmlNode *handle_role_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling role attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Profession", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Profession", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -164,37 +164,38 @@ static void handle_slot_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Slot parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Slot", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Slot", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_assistant_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Assistant parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Assistant"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Assistant"); } static void handle_callback_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Callback parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Callback"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Callback"); } static void handle_company_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Company parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Company"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Company"); } static void handle_telex_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Telex parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Telex"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Telex"); } static void handle_radio_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Radio parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Radio"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Radio"); } static osync_bool init_x_evo_to_xml(void *input) @@ -244,7 +245,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -266,11 +267,11 @@ if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -436,7 +437,7 @@ static void handle_xml_slot_parameter(VFormatAttribute *attr, xmlNode *current) { osync_trace(TRACE_INTERNAL, "Handling slot xml parameter"); - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "X-EVOLUTION-UI-SLOT", content); g_free(content); } Modified: trunk/formats/vformats-xml/xml-kde.c =================================================================== --- trunk/formats/vformats-xml/xml-kde.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-kde.c 2005-03-21 17:04:35 UTC (rev 384) @@ -27,7 +27,7 @@ static xmlNode *handle_aim_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling x-aim attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-AIM", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-AIM", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -35,7 +35,7 @@ static xmlNode *handle_manager_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Manager attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Manager", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Manager", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -43,7 +43,7 @@ static xmlNode *handle_assistant_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Assistant attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Assistant", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Assistant", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -51,7 +51,7 @@ static xmlNode *handle_anniversary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Anniversary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Anniversary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Anniversary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -59,7 +59,7 @@ static xmlNode *handle_spouse_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Spouse attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Spouse", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Spouse", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -67,7 +67,7 @@ static xmlNode *handle_yahoo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-Yahoo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Yahoo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Yahoo", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -75,7 +75,7 @@ static xmlNode *handle_icq_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-ICQ attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-ICQ", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-ICQ", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -83,7 +83,7 @@ static xmlNode *handle_jabber_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Jabber attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Jabber", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Jabber", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -91,7 +91,7 @@ static xmlNode *handle_msn_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling MSN attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-MSN", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-MSN", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -103,7 +103,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Department", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -116,7 +116,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Unit", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -125,7 +125,7 @@ static xmlNode *handle_profession_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling profession attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Profession", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Profession", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -133,7 +133,7 @@ static xmlNode *handle_gadu_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling gadu attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-GaduGadu", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-GaduGadu", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -141,7 +141,7 @@ static xmlNode *handle_irc_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IRC attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IRC", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IRC", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -149,7 +149,7 @@ static xmlNode *handle_sms_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling SMS attribute"); - xmlNode *current = xmlNewChild(root, NULL, "SMS", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"SMS", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -161,7 +161,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Name", vformat_attribute_get_nth_value(attr, 0)); osxml_node_add(current, "Department", vformat_attribute_get_nth_value(attr, 1)); @@ -179,7 +179,7 @@ static xmlNode *handle_x_kde_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling X-KDE attribute"); - xmlNode *current = xmlNewChild(root, NULL, "KDE-Extension", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"KDE-Extension", NULL); osxml_node_add(current, "ExtName", vformat_attribute_get_name(attr)); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -230,7 +230,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -252,11 +252,11 @@ if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -356,19 +356,19 @@ int i = 0; while (root) { - char *content = xmlNodeGetContent(root); - if (!strcmp(root->name, "Name")) { + char *content = (char*)xmlNodeGetContent(root); + if (!strcmp((char*)root->name, "Name")) { org = vformat_attribute_new(NULL, "ORG"); vformat_attribute_add_value(org, content); vformat_add_attribute(vcard, org); } - if (!strcmp(root->name, "Department")) { + if (!strcmp((char*)root->name, "Department")) { attr = vformat_attribute_new(NULL, "X-KADDRESSBOOK-X-Department"); vformat_attribute_add_value(attr, content); vformat_add_attribute(vcard, attr); } - if (!strcmp(root->name, "Unit")) { + if (!strcmp((char*)root->name, "Unit")) { switch (i) { case 0: attr = vformat_attribute_new(NULL, "X-KADDRESSBOOK-X-Office"); Modified: trunk/formats/vformats-xml/xml-support.c =================================================================== --- trunk/formats/vformats-xml/xml-support.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-support.c 2005-03-21 17:04:35 UTC (rev 384) @@ -23,7 +23,7 @@ xmlNode *osxml_node_add_root(xmlDoc *doc, const char *name) { - doc->children = xmlNewDocNode(doc, NULL, name, NULL); + doc->children = xmlNewDocNode(doc, NULL, (xmlChar*)name, NULL); return doc->children; } @@ -47,10 +47,10 @@ void osxml_node_set(xmlNode *node, const char *name, const char *data, OSyncXMLEncoding encoding) { if (name) - xmlNodeSetName(node, name); //FIXME Free previous name? + xmlNodeSetName(node, (xmlChar*)name); //FIXME Free previous name? if (data) - xmlNewTextChild(node, NULL, "Content", data); + xmlNewTextChild(node, NULL, (xmlChar*)"Content", (xmlChar*)data); } xmlNode *osxml_node_add(xmlNode *parent, const char *name, const char *data) @@ -59,24 +59,24 @@ return NULL; if (strlen(data) == 0) return NULL; - xmlNode *node = xmlNewTextChild(parent, NULL, name, data); + xmlNode *node = xmlNewTextChild(parent, NULL, (xmlChar*)name, (xmlChar*)data); return node; } void osxml_node_add_property(xmlNode *parent, const char *name, const char *data) { - xmlNewProp(parent, name, data); + xmlNewProp(parent, (xmlChar*)name, (xmlChar*)data); } void osxml_node_mark_unknown(xmlNode *parent) { - if (!xmlHasProp(parent, "Type")) - xmlNewProp(parent, "Type", "Unknown"); + if (!xmlHasProp(parent, (xmlChar*)"Type")) + xmlNewProp(parent, (xmlChar*)"Type", (xmlChar*)"Unknown"); } void osxml_node_remove_unknown_mark(xmlNode *node) { - xmlAttr *attr = xmlHasProp(node, "Type"); + xmlAttr *attr = xmlHasProp(node, (xmlChar*)"Type"); if (!attr) return; xmlRemoveProp(attr); @@ -95,7 +95,7 @@ char *osxml_find_node(xmlNode *parent, const char *name) { - return xmlNodeGetContent(osxml_get_node(parent, name)); + return (char*)xmlNodeGetContent(osxml_get_node(parent, name)); } xmlXPathObject *osxml_get_nodeset(xmlDoc *doc, const char *expression) @@ -111,7 +111,7 @@ } /* Evaluate xpath expression */ - xpathObj = xmlXPathEvalExpression(expression, xpathCtx); + xpathObj = xmlXPathEvalExpression((xmlChar*)expression, xpathCtx); if(xpathObj == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression \"%s\"\n", expression); xmlXPathFreeContext(xpathCtx); @@ -160,24 +160,24 @@ osync_bool osxml_has_property_full(xmlNode *parent, const char *name, const char *data) { if (osxml_has_property(parent, name)) - return (strcmp(xmlGetProp(parent, name), data) == 0); + return (strcmp((char*)xmlGetProp(parent, (xmlChar*)name), data) == 0); return FALSE; } char *osxml_find_property(xmlNode *parent, const char *name) { - return xmlGetProp(parent, name); + return (char*)xmlGetProp(parent, (xmlChar*)name); } osync_bool osxml_has_property(xmlNode *parent, const char *name) { - return (xmlHasProp(parent, name) != NULL); + return (xmlHasProp(parent, (xmlChar*)name) != NULL); } static osync_bool osxml_compare_node(xmlNode *leftnode, xmlNode *rightnode) { osync_trace(TRACE_ENTRY, "%s(%p:%s, %p:%s)", __func__, leftnode, leftnode->name, rightnode, rightnode->name); - if (strcmp(leftnode->name, rightnode->name)) { + if (strcmp((char*)leftnode->name, (char*)rightnode->name)) { osync_trace(TRACE_EXIT, "%s: FALSE: Different Name", __func__); return FALSE; } @@ -197,17 +197,17 @@ } do { - if (!strcmp("UnknownParam", leftnode->name)) + if (!strcmp("UnknownParam", (char*)leftnode->name)) continue; - if (!strcmp("Order", leftnode->name)) + if (!strcmp("Order", (char*)leftnode->name)) continue; rightnode = rightstartnode; - char *leftcontent = xmlNodeGetContent(leftnode); + char *leftcontent = (char*)xmlNodeGetContent(leftnode); do { - if (!strcmp("UnknownParam", rightnode->name)) + if (!strcmp("UnknownParam", (char*)rightnode->name)) continue; - char *rightcontent = xmlNodeGetContent(rightnode); + char *rightcontent = (char*)xmlNodeGetContent(rightnode); osync_trace(TRACE_INTERNAL, "leftcontent %s (%s), rightcontent %s (%s)", leftcontent, leftnode->name, rightcontent, rightnode->name); if (leftcontent == rightcontent) { Modified: trunk/formats/vformats-xml/xml-vcal.c =================================================================== --- trunk/formats/vformats-xml/xml-vcal.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-vcal.c 2005-03-21 17:04:35 UTC (rev 384) @@ -26,100 +26,118 @@ static void handle_unknown_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling unknown parameter %s", vformat_attribute_param_get_name(param)); - xmlNode *property = xmlNewChild(current, NULL, "UnknownParam", vformat_attribute_param_get_nth_value(param, 0)); + xmlNode *property = xmlNewChild(current, NULL, (xmlChar*)"UnknownParam", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); osxml_node_add(property, "ParamName", vformat_attribute_param_get_name(param)); } static void handle_tzid_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling tzid parameter"); - xmlNewChild(current, NULL, "TimezoneID", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"TimezoneID", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_value_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Value", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Value", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_altrep_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "AlternateRep", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"AlternateRep", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_cn_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "CommonName", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"CommonName", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_delegated_from_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "DelegatedFrom", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"DelegatedFrom", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_delegated_to_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "DelegatedTo", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"DelegatedTo", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_dir_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Directory", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Directory", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_format_type_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "FormaType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"FormaType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_fb_type_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "FreeBusyType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"FreeBusyType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_member_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Member", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Member", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_partstat_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "PartStat", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"PartStat", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_range_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Range", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Range", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_related_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Related", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Related", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_reltype_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "RelationType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"RelationType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_role_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Role", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Role", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_rsvp_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "RSVP", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"RSVP", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_sent_by_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "SentBy", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"SentBy", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static xmlNode *handle_unknown_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling unknown attribute %s", vformat_attribute_get_name(attr)); - xmlNode *current = xmlNewChild(root, NULL, "UnknownNode", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"UnknownNode", NULL); osxml_node_add(current, "NodeName", vformat_attribute_get_name(attr)); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -133,7 +151,7 @@ static xmlNode *handle_prodid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling prodid attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ProductID", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ProductID", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -141,7 +159,7 @@ static xmlNode *handle_method_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling method attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Method", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Method", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -149,7 +167,7 @@ static xmlNode *handle_dtstamp_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling dtstamp attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateCalendarCreated", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateCalendarCreated", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -157,7 +175,7 @@ static xmlNode *handle_percent_complete_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling percent complete attribute"); - xmlNode *current = xmlNewChild(root, NULL, "PercentComplete", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"PercentComplete", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -165,7 +183,7 @@ static xmlNode *handle_created_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling created attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateCreated", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateCreated", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -173,7 +191,7 @@ static xmlNode *handle_dtstart_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling dtstart attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateStarted", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateStarted", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -181,7 +199,7 @@ static xmlNode *handle_rrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling rrule attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -196,7 +214,7 @@ static xmlNode *handle_description_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling description attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Description", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Description", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -204,7 +222,7 @@ static xmlNode *handle_summary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling summary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Summary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Summary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -212,7 +230,7 @@ static xmlNode *handle_categories_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Categories attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Categories", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Categories", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -227,7 +245,7 @@ static xmlNode *handle_class_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Class attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Class", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Class", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -235,7 +253,7 @@ static xmlNode *handle_due_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling due attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateDue", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateDue", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -243,7 +261,7 @@ static xmlNode *handle_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Url attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Url", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Url", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -251,7 +269,7 @@ /*static xmlNode *handle_uid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Uid attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Uid", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Uid", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; }*/ @@ -259,7 +277,7 @@ static xmlNode *handle_priority_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling priority attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Priority", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Priority", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -267,7 +285,7 @@ static xmlNode *handle_sequence_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling sequence attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Sequence", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Sequence", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -275,7 +293,7 @@ static xmlNode *handle_last_modified_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "LastModified", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"LastModified", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -283,7 +301,7 @@ /*static xmlNode *handle_rrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; }*/ @@ -291,7 +309,7 @@ static xmlNode *handle_rdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceDate", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceDate", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -299,7 +317,7 @@ static xmlNode *handle_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Location", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Location", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -307,7 +325,7 @@ static xmlNode *handle_geo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling geo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Geo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Geo", NULL); osxml_node_add(current, "Latitude", vformat_attribute_get_nth_value(attr, 0)); osxml_node_add(current, "Longitude", vformat_attribute_get_nth_value(attr, 1)); return current; @@ -316,7 +334,7 @@ static xmlNode *handle_completed_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Completed", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Completed", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -324,7 +342,7 @@ static xmlNode *handle_organizer_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Organizer", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Organizer", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -332,7 +350,7 @@ static xmlNode *handle_recurid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceID", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceID", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -340,7 +358,7 @@ static xmlNode *handle_status_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Status", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Status", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -348,7 +366,7 @@ static xmlNode *handle_duration_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Duration", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Duration", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -356,7 +374,7 @@ static xmlNode *handle_attach_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Attach", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Attach", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -364,7 +382,7 @@ static xmlNode *handle_attendee_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Attendee", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Attendee", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -372,7 +390,7 @@ static xmlNode *handle_contact_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Contact", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Contact", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -380,7 +398,7 @@ static xmlNode *handle_exdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ExclusionDate", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ExclusionDate", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -388,7 +406,7 @@ static xmlNode *handle_exrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ExclusionRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ExclusionRule", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -396,7 +414,7 @@ static xmlNode *handle_rstatus_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RStatus", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RStatus", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -404,7 +422,7 @@ static xmlNode *handle_related_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Related", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Related", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -412,7 +430,7 @@ static xmlNode *handle_resources_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Resources", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Resources", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -420,7 +438,7 @@ static xmlNode *handle_dtend_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateEnd", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateEnd", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -428,7 +446,7 @@ static xmlNode *handle_transp_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Transparency", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Transparency", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -436,7 +454,7 @@ static xmlNode *handle_calscale_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "CalendarScale", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"CalendarScale", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -444,43 +462,49 @@ static xmlNode *handle_tzid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzid attribute"); - return xmlNewChild(root, NULL, "TimezoneID", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneID", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tz_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tz location attribute"); - return xmlNewChild(root, NULL, "Location", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"Location", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzoffsetfrom_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzoffsetfrom attribute"); - return xmlNewChild(root, NULL, "TZOffsetFrom", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TZOffsetFrom", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzoffsetto_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzoffsetto attribute"); - return xmlNewChild(root, NULL, "TZOffsetTo", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TZOffsetTo", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzname_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzname attribute"); - return xmlNewChild(root, NULL, "TimezoneName", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneName", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzdtstart_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "DateStarted", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"DateStarted", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzrrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzrrule attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -495,25 +519,28 @@ static xmlNode *handle_tz_last_modified_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "LastModified", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"LastModified", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzurl_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "TimezoneUrl", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneUrl", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzrdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "TimezoneDate", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneDate", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_atrigger_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - xmlNode *current = xmlNewChild(root, NULL, "AlarmTrigger", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"AlarmTrigger", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -521,43 +548,50 @@ static xmlNode *handle_arepeat_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmRepeat", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmRepeat", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aduration_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmDuration", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmDuration", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aaction_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAction", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAction", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aattach_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAttach", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAttach", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_adescription_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmDescription", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmDescription", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aattendee_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAttendee", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAttendee", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_asummary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmSummary", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmSummary", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static void vcard_handle_parameter(GHashTable *hooks, xmlNode *current, VFormatParam *param) @@ -636,25 +670,25 @@ //Handling supcomponent a = a->next; if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VTIMEZONE")) { - xmlNode *current = xmlNewChild(root, NULL, "Timezone", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Timezone", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "DAYLIGHT")) { - xmlNode *current = xmlNewChild(root, NULL, "DaylightSavings", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DaylightSavings", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "STANDARD")) { - xmlNode *current = xmlNewChild(root, NULL, "Standard", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Standard", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VTODO")) { - xmlNode *current = xmlNewChild(root, NULL, "Todo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Todo", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VEVENT")) { - xmlNode *current = xmlNewChild(root, NULL, "Event", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Event", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VJOURNAL")) { - xmlNode *current = xmlNewChild(root, NULL, "Journal", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Journal", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VALARM")) { - xmlNode *current = xmlNewChild(root, NULL, "Alarm", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Alarm", NULL); vcal_parse_attributes(hooks, hooks->alarmtable, &a, current); } } else if (!strcmp(vformat_attribute_get_name(attr), "END")) { @@ -681,7 +715,7 @@ osync_trace(TRACE_INTERNAL, "Creating xml doc"); //Create a new xml document - xmlDoc *doc = xmlNewDoc("1.0"); + xmlDoc *doc = xmlNewDoc((xmlChar*)"1.0"); xmlNode *root = osxml_node_add_root(doc, "vcal"); osync_trace(TRACE_INTERNAL, "parsing attributes"); @@ -709,7 +743,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -729,18 +763,18 @@ { char *tmp = NULL; if (!name) - tmp = xmlNodeGetContent(parent); + tmp = (char*)xmlNodeGetContent(parent); else tmp = osxml_find_node(parent, name); if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -752,133 +786,133 @@ static void xml_handle_unknown_parameter(VFormatAttribute *attr, xmlNode *current) { osync_trace(TRACE_INTERNAL, "Handling unknown xml parameter %s", current->name); - char *content = xmlNodeGetContent(current); - vformat_attribute_add_param_with_value(attr, current->name, content); + char *content = (char*)xmlNodeGetContent(current); + vformat_attribute_add_param_with_value(attr, (char*)current->name, content); g_free(content); } static void handle_xml_category_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_value(attr, content); g_free(content); } static void handle_xml_rule_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_value(attr, content); g_free(content); } static void handle_xml_value_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "VALUE", content); g_free(content); } static void handle_xml_altrep_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "ALTREP", content); g_free(content); } static void handle_xml_cn_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "CN", content); g_free(content); } static void handle_xml_delegated_from_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DELEGATED-FROM", content); g_free(content); } static void handle_xml_delegated_to_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DELEGATED-TO", content); g_free(content); } static void handle_xml_dir_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DIR", content); g_free(content); } static void handle_xml_format_type_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "FMTTYPE", content); g_free(content); } static void handle_xml_fb_type_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "FBTYPE", content); g_free(content); } static void handle_xml_member_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "MEMBER", content); g_free(content); } static void handle_xml_partstat_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "PARTSTAT", content); g_free(content); } static void handle_xml_range_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "RANGE", content); g_free(content); } static void handle_xml_reltype_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(curre... [truncated message content] |