[evolution-data-server] Fix compiler warnings in servers.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-data-server] Fix compiler warnings in servers.
- Date: Mon, 1 Jun 2009 18:47:41 -0400 (EDT)
commit baba4e981176f0765d6f21b2d85e3af93f966471
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Jun 1 01:20:44 2009 -0400
Fix compiler warnings in servers.
---
servers/exchange/lib/e2k-action.c | 4 +-
servers/exchange/lib/e2k-autoconfig.c | 28 +-
servers/exchange/lib/e2k-context.c | 83 +++--
servers/exchange/lib/e2k-freebusy.c | 2 +-
servers/exchange/lib/e2k-global-catalog.c | 38 +-
servers/exchange/lib/e2k-properties.c | 2 +-
servers/exchange/lib/e2k-result.c | 41 ++-
servers/exchange/lib/e2k-rule-xml.c | 376 ++++++++++++++------
servers/exchange/lib/e2k-rule.c | 4 +-
servers/exchange/lib/e2k-security-descriptor.c | 26 +-
servers/exchange/lib/e2k-utils.c | 22 +-
servers/exchange/lib/e2k-xml-utils.c | 2 +-
servers/exchange/lib/e2k-xml-utils.h | 4 +-
servers/exchange/storage/e-folder-exchange.c | 85 +++--
servers/exchange/storage/e-folder-type-registry.c | 3 +-
servers/exchange/storage/e-folder.c | 4 +-
servers/exchange/storage/e-storage.c | 4 +-
servers/exchange/storage/exchange-esource.h | 3 -
servers/exchange/storage/exchange-folder-size.c | 4 +-
.../exchange/storage/exchange-hierarchy-foreign.c | 16 +-
.../exchange/storage/exchange-hierarchy-webdav.c | 4 +-
servers/exchange/xntlm/xntlm.c | 20 +-
.../google/libgdata-google/gdata-google-service.c | 10 +-
servers/groupwise/e-gw-connection.c | 18 +-
servers/groupwise/e-gw-filter.c | 2 +-
servers/groupwise/e-gw-item.c | 54 ++--
servers/groupwise/e-gw-sendoptions.c | 4 +-
27 files changed, 527 insertions(+), 336 deletions(-)
diff --git a/servers/exchange/lib/e2k-action.c b/servers/exchange/lib/e2k-action.c
index 881d077..889ae82 100644
--- a/servers/exchange/lib/e2k-action.c
+++ b/servers/exchange/lib/e2k-action.c
@@ -708,14 +708,14 @@ append_action (GByteArray *ba, E2kAction *act)
e2k_rule_append_uint16 (ba, act->act.xfer.store_entryid->len +
E2K_ACTION_XFER_STORE_ENTRYID_PREFIX_LEN);
- g_byte_array_append (ba, E2K_ACTION_XFER_STORE_ENTRYID_PREFIX,
+ g_byte_array_append (ba, (guint8 *) E2K_ACTION_XFER_STORE_ENTRYID_PREFIX,
E2K_ACTION_XFER_STORE_ENTRYID_PREFIX_LEN);
g_byte_array_append (ba, act->act.xfer.store_entryid->data,
act->act.xfer.store_entryid->len);
e2k_rule_append_uint16 (ba, 49);
type = MAPI_FOLDER;
- g_byte_array_append (ba, &type, 1);
+ g_byte_array_append (ba, (guint8 *) &type, 1);
g_byte_array_append (ba, act->act.xfer.folder_source_key->data,
act->act.xfer.folder_source_key->len);
break;
diff --git a/servers/exchange/lib/e2k-autoconfig.c b/servers/exchange/lib/e2k-autoconfig.c
index dc2055c..9b552a0 100644
--- a/servers/exchange/lib/e2k-autoconfig.c
+++ b/servers/exchange/lib/e2k-autoconfig.c
@@ -574,11 +574,11 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
for (node = doc->children; node; node = e2k_xml_find (node, "meta")) {
gboolean ex55 = FALSE;
- equiv = xmlGetProp (node, "http-equiv");
- content = xmlGetProp (node, "content");
+ equiv = xmlGetProp (node, (xmlChar *) "http-equiv");
+ content = xmlGetProp (node, (xmlChar *) "content");
if (equiv && content &&
- !g_ascii_strcasecmp (equiv, "REFRESH") &&
- strstr (content, "/logon.asp"))
+ !g_ascii_strcasecmp ((gchar *) equiv, "REFRESH") &&
+ xmlStrstr (content, (xmlChar *) "/logon.asp"))
ex55 = TRUE;
if (equiv)
xmlFree (equiv);
@@ -596,9 +596,9 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
if (node) {
/* We won */
*result = E2K_AUTOCONFIG_OK;
- href = xmlGetProp (node, "href");
+ href = xmlGetProp (node, (xmlChar *) "href");
g_free (ac->home_uri);
- ac->home_uri = g_strdup (href);
+ ac->home_uri = g_strdup ((gchar *) href);
xmlFree (href);
} else
*result = E2K_AUTOCONFIG_FAILED;
@@ -728,13 +728,13 @@ e2k_autoconfig_check_exchange (E2kAutoconfig *ac, E2kOperation *op)
if (doc) {
for (node = e2k_xml_find (doc->children, "img"); node; node = e2k_xml_find (node, "img")) {
- prop = xmlGetProp (node, "src");
- if (prop && strstr (prop, "public") && node->parent) {
+ prop = xmlGetProp (node, (xmlChar *) "src");
+ if (prop && xmlStrstr (prop, (xmlChar *) "public") && node->parent) {
node = node->parent;
xmlFree (prop);
- prop = xmlGetProp (node, "href");
+ prop = xmlGetProp (node, (xmlChar *) "href");
if (prop) {
- euri = e2k_uri_new (prop);
+ euri = e2k_uri_new ((gchar *) prop);
ac->pf_server = g_strdup (euri->host);
e2k_uri_free (euri);
xmlFree (prop);
@@ -821,13 +821,13 @@ find_global_catalog (E2kAutoconfig *ac)
/* Skip query */
count = ntohs (header->qdcount);
while (count-- && p < end) {
- p += dn_expand (answer, end, p, namebuf, sizeof (namebuf));
+ p += dn_expand (answer, end, p, (gchar *) namebuf, sizeof (namebuf));
p += 4;
}
/* Read answers */
while (count-- && p < end) {
- p += dn_expand (answer, end, p, namebuf, sizeof (namebuf));
+ p += dn_expand (answer, end, p, (gchar *) namebuf, sizeof (namebuf));
GETSHORT (type, p);
GETSHORT (qclass, p);
GETLONG (ttl, p);
@@ -841,10 +841,10 @@ find_global_catalog (E2kAutoconfig *ac)
GETSHORT (priority, p);
GETSHORT (weight, p);
GETSHORT (port, p);
- p += dn_expand (answer, end, p, namebuf, sizeof (namebuf));
+ p += dn_expand (answer, end, p, (gchar *) namebuf, sizeof (namebuf));
/* FIXME: obey priority and weight */
- ac->gc_server = g_strdup (namebuf);
+ ac->gc_server = g_strdup ((gchar *) namebuf);
ac->gc_server_autodetected = TRUE;
return;
}
diff --git a/servers/exchange/lib/e2k-context.c b/servers/exchange/lib/e2k-context.c
index e3beed4..b2a8083 100644
--- a/servers/exchange/lib/e2k-context.c
+++ b/servers/exchange/lib/e2k-context.c
@@ -551,7 +551,8 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
static gboolean in_fba_auth = FALSE;
gint status, len;
SoupBuffer *response = NULL;
- gchar *action, *method, *name, *value;
+ gchar *action;
+ xmlChar *method, *name, *value;
xmlDoc *doc = NULL;
xmlNode *node;
SoupMessage *post_msg;
@@ -597,15 +598,15 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
if (!node)
goto failed;
- method = xmlGetProp (node, "method");
- if (!method || g_ascii_strcasecmp (method, "post") != 0) {
+ method = xmlGetProp (node, (xmlChar *) "method");
+ if (!method || g_ascii_strcasecmp ((gchar *) method, "post") != 0) {
if (method)
xmlFree (method);
goto failed;
}
xmlFree (method);
- value = xmlGetProp (node, "action");
+ value = xmlGetProp (node, (xmlChar *) "action");
if (!value || !*value)
goto failed;
if (*value == '/') {
@@ -613,10 +614,10 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
suri = soup_uri_new (ctx->priv->owa_uri);
g_free (suri->path);
- suri->path = g_strdup (value);
+ suri->path = g_strdup ((gchar *) value);
action = soup_uri_to_string (suri, FALSE);
soup_uri_free (suri);
- } else if (strncmp(value, "http", 4) != 0) {
+ } else if (xmlStrncmp (value, (xmlChar *) "http", 4) != 0) {
SoupURI *suri;
gchar *path_end;
const gchar *location;
@@ -632,8 +633,8 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
path_end = strrchr (suri->path, '/') + 1;
*path_end = '\0';
suri->path = g_realloc (suri->path,
- path_end - suri->path + strlen (value) + 1);
- strcat (suri->path, value);
+ path_end - suri->path + xmlStrlen (value) + 1);
+ strcat (suri->path, (gchar *) value);
g_free (suri->query);
suri->query = NULL;
action = soup_uri_to_string (suri, FALSE);
@@ -641,47 +642,57 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
}
}
} else
- action = g_strdup (value);
+ action = g_strdup ((gchar *) value);
xmlFree (value);
form_data = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL, g_free);
while ((node = e2k_xml_find (node, "input"))) {
- name = xmlGetProp (node, "name");
+ name = xmlGetProp (node, (xmlChar *) "name");
if (!name)
continue;
- value = xmlGetProp (node, "value");
-
- if (!g_ascii_strcasecmp (name, "destination") && value) {
- g_hash_table_insert (form_data, "destination",
- g_strdup (value));
- } else if (!g_ascii_strcasecmp (name, "flags")) {
- g_hash_table_insert (form_data, "flags",
- g_strdup (E2K_FBA_FLAG_TRUSTED));
- } else if (!g_ascii_strcasecmp (name, "username")) {
- g_hash_table_insert (form_data, "username",
- g_strdup (ctx->priv->username));
- } else if (!g_ascii_strcasecmp (name, "password")) {
- g_hash_table_insert (form_data, "password",
- g_strdup (ctx->priv->password));
+ value = xmlGetProp (node, (xmlChar *) "value");
+
+ if (!g_ascii_strcasecmp ((gchar *) name, "destination") && value) {
+ g_hash_table_insert (
+ form_data,
+ (gpointer) "destination",
+ g_strdup ((gchar *) value));
+ } else if (!g_ascii_strcasecmp ((gchar *) name, "flags")) {
+ g_hash_table_insert (
+ form_data,
+ (gpointer) "flags",
+ g_strdup (E2K_FBA_FLAG_TRUSTED));
+ } else if (!g_ascii_strcasecmp ((gchar *) name, "username")) {
+ g_hash_table_insert (
+ form_data,
+ (gpointer) "username",
+ g_strdup (ctx->priv->username));
+ } else if (!g_ascii_strcasecmp ((gchar *) name, "password")) {
+ g_hash_table_insert (
+ form_data,
+ (gpointer) "password",
+ g_strdup (ctx->priv->password));
}
if (value)
xmlFree (value);
xmlFree (name);
}
- g_hash_table_insert (form_data, "trusted",
- g_strdup (E2K_FBA_FLAG_TRUSTED));
+ g_hash_table_insert (
+ form_data, (gpointer) "trusted",
+ g_strdup (E2K_FBA_FLAG_TRUSTED));
xmlFreeDoc (doc);
doc = NULL;
form_body = soup_form_encode_hash (form_data);
g_hash_table_destroy (form_data);
- post_msg = e2k_soup_message_new_full (ctx, action, "POST",
- "application/x-www-form-urlencoded",
- SOUP_MEMORY_TAKE,
- form_body, strlen (form_body));
+ post_msg = e2k_soup_message_new_full (
+ ctx, action, "POST",
+ "application/x-www-form-urlencoded",
+ SOUP_MEMORY_TAKE,
+ form_body, strlen (form_body));
if (!post_msg)
goto failed;
@@ -700,12 +711,12 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
cookie_str = g_string_new (NULL);
for (c = cookies; c; c = c->next) {
- value = c->data;
- len = strcspn (value, ";");
+ gchar *string = c->data;
+ len = strcspn (string, ";");
if (cookie_str->len)
g_string_append (cookie_str, "; ");
- g_string_append_len (cookie_str, value, len);
+ g_string_append_len (cookie_str, string, len);
}
ctx->priv->cookie = cookie_str->str;
ctx->priv->cookie_verified = FALSE;
@@ -2403,7 +2414,7 @@ polled (SoupSession *session, SoupMessage *msg, gpointer user_data)
E2kResult *results;
gint nresults, i;
xmlNode *ids;
- gchar *id;
+ xmlChar *id;
sub->poll_msg = NULL;
if (msg->status_code != E2K_HTTP_MULTI_STATUS) {
@@ -2421,7 +2432,7 @@ polled (SoupSession *session, SoupMessage *msg, gpointer user_data)
if (!ids)
continue;
for (ids = ids->xmlChildrenNode; ids; ids = ids->next) {
- if (strcmp (ids->name, "li") != 0 ||
+ if (xmlStrcmp (ids->name, (xmlChar *) "li") != 0 ||
!ids->xmlChildrenNode ||
!ids->xmlChildrenNode->content)
continue;
@@ -2557,7 +2568,7 @@ renew_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
#define E2K_SUBSCRIPTION_MAX_LIFETIME 57600 /* 16 hours */
/* This must be kept in sync with E2kSubscriptionType */
-static gchar *subscription_type[] = {
+static const gchar *subscription_type[] = {
"update", /* E2K_SUBSCRIPTION_OBJECT_CHANGED */
"update/newmember", /* E2K_SUBSCRIPTION_OBJECT_ADDED */
"delete", /* E2K_SUBSCRIPTION_OBJECT_REMOVED */
diff --git a/servers/exchange/lib/e2k-freebusy.c b/servers/exchange/lib/e2k-freebusy.c
index 06e8a59..6ed069d 100644
--- a/servers/exchange/lib/e2k-freebusy.c
+++ b/servers/exchange/lib/e2k-freebusy.c
@@ -502,7 +502,7 @@ add_events (GArray *events_array, E2kProperties *props,
startend[1] = evt_start >> 8;
startend[2] = evt_end & 0xFF;
startend[3] = evt_end >> 8;
- g_byte_array_append (data, startend, 4);
+ g_byte_array_append (data, (guint8 *) startend, 4);
i++;
}
diff --git a/servers/exchange/lib/e2k-global-catalog.c b/servers/exchange/lib/e2k-global-catalog.c
index 5718237..c6983c6 100644
--- a/servers/exchange/lib/e2k-global-catalog.c
+++ b/servers/exchange/lib/e2k-global-catalog.c
@@ -73,7 +73,7 @@ class_init (GObjectClass *object_class)
* below) takes a *really* long time to scan the sasl modules
* when running under gdb. We're not using sasl anyway, so...
*/
- putenv("SASL_PATH=");
+ g_setenv ("SASL_PATH", "", TRUE);
parent_class = g_type_class_ref (PARENT_TYPE);
@@ -240,7 +240,7 @@ ntlm_bind (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
/* Create and send NTLM request */
ba = xntlm_negotiate ();
ldap_buf.bv_len = ba->len;
- ldap_buf.bv_val = ba->data;
+ ldap_buf.bv_val = (gchar *) ba->data;
ldap_error = ldap_ntlm_bind (ldap, "NTLM", LDAP_AUTH_NTLM_REQUEST,
&ldap_buf, NULL, NULL, &msgid);
g_byte_array_free (ba, TRUE);
@@ -276,7 +276,7 @@ ntlm_bind (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
ba = xntlm_authenticate (nonce, gc->priv->nt_domain ? gc->priv->nt_domain : default_domain,
gc->priv->user, gc->priv->password, NULL);
ldap_buf.bv_len = ba->len;
- ldap_buf.bv_val = ba->data;
+ ldap_buf.bv_val = (gchar *) ba->data;
ldap_error = ldap_ntlm_bind (ldap, "NTLM", LDAP_AUTH_NTLM_RESPONSE,
&ldap_buf, NULL, NULL, &msgid);
g_byte_array_free (ba, TRUE);
@@ -567,7 +567,7 @@ get_sid_values (E2kGlobalCatalog *gc, E2kOperation *op,
ldap_value_free (values);
entry->sid = e2k_sid_new_from_binary_sid (
- type, bsid_values[0]->bv_val, entry->display_name);
+ type, (guint8 *) bsid_values[0]->bv_val, entry->display_name);
entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_SID;
ldap_value_free_len (bsid_values);
@@ -750,14 +750,14 @@ e2k_global_catalog_lookup (E2kGlobalCatalog *gc,
attrs = g_ptr_array_new ();
if (!entry->display_name)
- g_ptr_array_add (attrs, "displayName");
+ g_ptr_array_add (attrs, (guint8 *) "displayName");
if (!entry->email) {
- g_ptr_array_add (attrs, "mail");
+ g_ptr_array_add (attrs, (guint8 *) "mail");
if (flags & E2K_GLOBAL_CATALOG_LOOKUP_EMAIL)
need_flags |= E2K_GLOBAL_CATALOG_LOOKUP_EMAIL;
}
if (!entry->legacy_exchange_dn) {
- g_ptr_array_add (attrs, "legacyExchangeDN");
+ g_ptr_array_add (attrs, (guint8 *) "legacyExchangeDN");
if (flags & E2K_GLOBAL_CATALOG_LOOKUP_LEGACY_EXCHANGE_DN)
need_flags |= E2K_GLOBAL_CATALOG_LOOKUP_LEGACY_EXCHANGE_DN;
}
@@ -765,27 +765,27 @@ e2k_global_catalog_lookup (E2kGlobalCatalog *gc,
lookup_flags = flags & ~entry->mask;
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_SID) {
- g_ptr_array_add (attrs, "objectSid");
- g_ptr_array_add (attrs, "objectCategory");
+ g_ptr_array_add (attrs, (guint8 *) "objectSid");
+ g_ptr_array_add (attrs, (guint8 *) "objectCategory");
need_flags |= E2K_GLOBAL_CATALOG_LOOKUP_SID;
}
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_MAILBOX) {
- g_ptr_array_add (attrs, "mailNickname");
- g_ptr_array_add (attrs, "homeMTA");
+ g_ptr_array_add (attrs, (guint8 *) "mailNickname");
+ g_ptr_array_add (attrs, (guint8 *) "homeMTA");
need_flags |= E2K_GLOBAL_CATALOG_LOOKUP_MAILBOX;
}
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_DELEGATES)
- g_ptr_array_add (attrs, "publicDelegates");
+ g_ptr_array_add (attrs, (guint8 *) "publicDelegates");
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_DELEGATORS)
- g_ptr_array_add (attrs, "publicDelegatesBL");
+ g_ptr_array_add (attrs, (guint8 *) "publicDelegatesBL");
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_QUOTA) {
- g_ptr_array_add (attrs, "mDBUseDefaults");
- g_ptr_array_add (attrs, "mDBStorageQuota");
- g_ptr_array_add (attrs, "mDBOverQuotaLimit");
- g_ptr_array_add (attrs, "mDBOverHardQuotaLimit");
+ g_ptr_array_add (attrs, (guint8 *) "mDBUseDefaults");
+ g_ptr_array_add (attrs, (guint8 *) "mDBStorageQuota");
+ g_ptr_array_add (attrs, (guint8 *) "mDBOverQuotaLimit");
+ g_ptr_array_add (attrs, (guint8 *) "mDBOverHardQuotaLimit");
}
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_ACCOUNT_CONTROL)
- g_ptr_array_add (attrs, "userAccountControl");
+ g_ptr_array_add (attrs, (guint8 *) "userAccountControl");
if (attrs->len == 0) {
E2K_GC_DEBUG_MSG(("\nGC: returning cached info for %s\n", key));
@@ -1148,7 +1148,7 @@ do_delegate_op (E2kGlobalCatalog *gc, E2kOperation *op, gint deleg_op,
return E2K_GLOBAL_CATALOG_ERROR;
mod.mod_op = deleg_op;
- mod.mod_type = "publicDelegates";
+ mod.mod_type = (gchar *) "publicDelegates";
mod.mod_values = values;
values[0] = (gchar *)delegate_dn;
values[1] = NULL;
diff --git a/servers/exchange/lib/e2k-properties.c b/servers/exchange/lib/e2k-properties.c
index af30169..4e86047 100644
--- a/servers/exchange/lib/e2k-properties.c
+++ b/servers/exchange/lib/e2k-properties.c
@@ -679,7 +679,7 @@ static void
setup_namespaces (void)
{
namespaces = g_hash_table_new (prop_hash, prop_equal);
- g_hash_table_insert (namespaces, "DAV", GINT_TO_POINTER ('D'));
+ g_hash_table_insert (namespaces, (gpointer) "DAV", GINT_TO_POINTER ('D'));
}
/**
diff --git a/servers/exchange/lib/e2k-result.c b/servers/exchange/lib/e2k-result.c
index a39b348..e7b7cf3 100644
--- a/servers/exchange/lib/e2k-result.c
+++ b/servers/exchange/lib/e2k-result.c
@@ -48,7 +48,7 @@ prop_get_binary_array (E2kResult *result, const gchar *propname, xmlNode *node)
gsize length = 0;
data = g_base64_decode (
- node->xmlChildrenNode->content, &length);
+ (gchar *) node->xmlChildrenNode->content, &length);
g_byte_array_append (byte_array, data, length);
g_free (data);
}
@@ -67,7 +67,7 @@ prop_get_string_array (E2kResult *result, const gchar *propname,
array = g_ptr_array_new ();
for (node = node->xmlChildrenNode; node; node = node->next) {
if (node->xmlChildrenNode && node->xmlChildrenNode->content)
- g_ptr_array_add (array, g_strdup (node->xmlChildrenNode->content));
+ g_ptr_array_add (array, g_strdup ((gchar *) node->xmlChildrenNode->content));
else
g_ptr_array_add (array, g_strdup (""));
}
@@ -87,7 +87,7 @@ prop_get_binary (E2kResult *result, const gchar *propname, xmlNode *node)
gsize length = 0;
data = g_base64_decode (
- node->xmlChildrenNode->content, &length);
+ (gchar *) node->xmlChildrenNode->content, &length);
g_byte_array_append (byte_array, data, length);
g_free (data);
}
@@ -102,7 +102,7 @@ prop_get_string (E2kResult *result, const gchar *propname,
gchar *content;
if (node->xmlChildrenNode && node->xmlChildrenNode->content)
- content = g_strdup (node->xmlChildrenNode->content);
+ content = g_strdup ((gchar *) node->xmlChildrenNode->content);
else
content = g_strdup ("");
@@ -120,14 +120,15 @@ prop_get_xml (E2kResult *result, const gchar *propname, xmlNode *node)
static void
prop_parse (xmlNode *node, E2kResult *result)
{
- gchar *name, *type;
+ gchar *name;
+ xmlChar *type;
g_return_if_fail (node->ns != NULL);
if (!result->props)
result->props = e2k_properties_new ();
- if (!strncmp (node->ns->href, E2K_NS_MAPI_ID, E2K_NS_MAPI_ID_LEN)) {
+ if (!strncmp ((gchar *) node->ns->href, E2K_NS_MAPI_ID, E2K_NS_MAPI_ID_LEN)) {
/* Reinsert the illegal initial '0' that was stripped out
* by sanitize_bad_multistatus. (This also covers us in
* the cases where the server returns the property without
@@ -137,22 +138,25 @@ prop_parse (xmlNode *node, E2kResult *result)
} else
name = g_strdup_printf ("%s%s", node->ns->href, node->name);
- type = xmlGetNsProp (node, "dt", E2K_NS_TYPE);
- if (type && !strcmp (type, "mv.bin.base64"))
+ type = xmlGetNsProp (
+ node,
+ (xmlChar *) "dt",
+ (xmlChar *) E2K_NS_TYPE);
+ if (type && !xmlStrcmp (type, (xmlChar *) "mv.bin.base64"))
prop_get_binary_array (result, name, node);
- else if (type && !strcmp (type, "mv.int"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "mv.int"))
prop_get_string_array (result, name, E2K_PROP_TYPE_INT_ARRAY, node);
- else if (type && !strncmp (type, "mv.", 3))
+ else if (type && !xmlStrncmp (type, (xmlChar *) "mv.", 3))
prop_get_string_array (result, name, E2K_PROP_TYPE_STRING_ARRAY, node);
- else if (type && !strcmp (type, "bin.base64"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "bin.base64"))
prop_get_binary (result, name, node);
- else if (type && !strcmp (type, "int"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "int"))
prop_get_string (result, name, E2K_PROP_TYPE_INT, node);
- else if (type && !strcmp (type, "boolean"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "boolean"))
prop_get_string (result, name, E2K_PROP_TYPE_BOOL, node);
- else if (type && !strcmp (type, "float"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "float"))
prop_get_string (result, name, E2K_PROP_TYPE_FLOAT, node);
- else if (type && !strcmp (type, "dateTime.tz"))
+ else if (type && !xmlStrcmp (type, (xmlChar *) "dateTime.tz"))
prop_get_string (result, name, E2K_PROP_TYPE_DATE, node);
else if (!node->xmlChildrenNode ||
!node->xmlChildrenNode->xmlChildrenNode)
@@ -171,7 +175,8 @@ propstat_parse (xmlNode *node, E2kResult *result)
node = node->xmlChildrenNode;
if (!E2K_IS_NODE (node, "DAV:", "status"))
return;
- result->status = e2k_http_parse_status (node->xmlChildrenNode->content);
+ result->status = e2k_http_parse_status (
+ (gchar *) node->xmlChildrenNode->content);
if (result->status != E2K_HTTP_OK)
return;
@@ -326,10 +331,10 @@ e2k_results_array_add_from_multistatus (GArray *results_array,
continue;
if (E2K_IS_NODE (rnode, "DAV:", "href"))
- result.href = xmlNodeGetContent (rnode);
+ result.href = (gchar *) xmlNodeGetContent (rnode);
else if (E2K_IS_NODE (rnode, "DAV:", "status")) {
result.status = e2k_http_parse_status (
- rnode->xmlChildrenNode->content);
+ (gchar *) rnode->xmlChildrenNode->content);
} else if (E2K_IS_NODE (rnode, "DAV:", "propstat"))
propstat_parse (rnode, &result);
else
diff --git a/servers/exchange/lib/e2k-rule-xml.c b/servers/exchange/lib/e2k-rule-xml.c
index 1e1d537..83c823f 100644
--- a/servers/exchange/lib/e2k-rule-xml.c
+++ b/servers/exchange/lib/e2k-rule-xml.c
@@ -179,70 +179,84 @@ restriction_is_delegation (E2kRestriction *rn)
}
static xmlNode *
-new_value (xmlNode *part, const gchar *name, const gchar *type, const gchar *value)
+new_value (xmlNode *part,
+ const xmlChar *name,
+ const xmlChar *type,
+ const xmlChar *value)
{
xmlNode *node;
- node = xmlNewChild (part, NULL, "value", NULL);
- xmlSetProp (node, "name", name);
- xmlSetProp (node, "type", type);
+ node = xmlNewChild (part, NULL, (xmlChar *) "value", NULL);
+ xmlSetProp (node, (xmlChar *) "name", name);
+ xmlSetProp (node, (xmlChar *) "type", type);
if (value)
- xmlSetProp (node, "value", value);
+ xmlSetProp (node, (xmlChar *) "value", value);
return node;
}
static xmlNode *
-new_value_int (xmlNode *part, const gchar *name, const gchar *type,
- const gchar *value_name, long value)
+new_value_int (xmlNode *part,
+ const xmlChar *name,
+ const xmlChar *type,
+ const xmlChar *value_name,
+ glong value)
{
xmlNode *node;
gchar *str;
- node = xmlNewChild (part, NULL, "value", NULL);
- xmlSetProp (node, "name", name);
- xmlSetProp (node, "type", type);
+ node = xmlNewChild (part, NULL, (xmlChar *) "value", NULL);
+ xmlSetProp (node, (xmlChar *) "name", name);
+ xmlSetProp (node, (xmlChar *) "type", type);
str = g_strdup_printf ("%ld", value);
- xmlSetProp (node, value_name, str);
+ xmlSetProp (node, (xmlChar *) value_name, (xmlChar *) str);
g_free (str);
return node;
}
static xmlNode *
-new_part (const gchar *part_name)
+new_part (const xmlChar *part_name)
{
xmlNode *part;
- part = xmlNewNode (NULL, "part");
- xmlSetProp (part, "name", part_name);
+ part = xmlNewNode (NULL, (xmlChar *) "part");
+ xmlSetProp (part, (xmlChar *) "name", part_name);
return part;
}
static xmlNode *
-match (const gchar *part_name, const gchar *value_name, const gchar *value_value,
- const gchar *string_name, const gchar *string_value)
+match (const xmlChar *part_name,
+ const xmlChar *value_name,
+ const xmlChar *value_value,
+ const xmlChar *string_name,
+ const xmlChar *string_value)
{
xmlNode *part, *value;
part = new_part (part_name);
- value = new_value (part, value_name, "option", value_value);
- value = new_value (part, string_name, "string", NULL);
- xmlNewTextChild (value, NULL, "string", string_value);
+ value = new_value (
+ part, value_name, (xmlChar *) "option", value_value);
+ value = new_value (part, string_name, (xmlChar *) "string", NULL);
+ xmlNewTextChild (value, NULL, (xmlChar *) "string", string_value);
return part;
}
static xmlNode *
-message_is (const gchar *name, const gchar *type_name,
- const gchar *kind, gboolean negated)
+message_is (const xmlChar *name,
+ const xmlChar *type_name,
+ const xmlChar *kind,
+ gboolean negated)
{
xmlNode *part;
part = new_part (name);
- new_value (part, type_name, "option", negated ? "is not" : "is");
- new_value (part, "kind", "option", kind);
+ new_value (
+ part, type_name, (xmlChar *) "option",
+ negated ? (xmlChar *) "is not" : (xmlChar *) "is");
+ new_value (part, (xmlChar *) "kind", (xmlChar *) "option", kind);
return part;
}
@@ -296,11 +310,19 @@ address_is (E2kRestriction *comment_rn, gboolean recipients, gboolean negated)
full_addr = g_strdup_printf ("<%s>", addr);
if (recipients) {
- part = match ("recipient", "recipient-type", relation,
- "recipient", full_addr);
+ part = match (
+ (xmlChar *) "recipient",
+ (xmlChar *) "recipient-type",
+ (xmlChar *) relation,
+ (xmlChar *) "recipient",
+ (xmlChar *) full_addr);
} else {
- part = match ("sender", "sender-type", relation,
- "sender", full_addr);
+ part = match (
+ (xmlChar *) "sender",
+ (xmlChar *) "sender-type",
+ (xmlChar *) relation,
+ (xmlChar *) "sender",
+ (xmlChar *) full_addr);
}
g_free (full_addr);
@@ -322,15 +344,17 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
case E2K_RESTRICTION_OR:
/* Check for special rules */
if (restriction_is_only_to_me (rn)) {
- part = message_is ("message-to-me",
- "message-to-me-type",
- "only", negated);
+ part = message_is (
+ (xmlChar *) "message-to-me",
+ (xmlChar *) "message-to-me-type",
+ (xmlChar *) "only", negated);
break;
} else if (restriction_is_delegation (rn)) {
- part = message_is ("special-message",
- "special-message-type",
- "delegated-meeting-request",
- negated);
+ part = message_is (
+ (xmlChar *) "special-message",
+ (xmlChar *) "special-message-type",
+ (xmlChar *) "delegated-meeting-request",
+ negated);
break;
}
@@ -382,8 +406,12 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!match_type)
return FALSE;
- part = match ("body", "body-type", match_type,
- "word", pv->value);
+ part = match (
+ (xmlChar *) "body",
+ (xmlChar *) "body-type",
+ (xmlChar *) match_type,
+ (xmlChar *) "word",
+ (xmlChar *) pv->value);
break;
case E2K_PROPTAG_PR_SUBJECT:
@@ -392,8 +420,12 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!match_type)
return FALSE;
- part = match ("subject", "subject-type", match_type,
- "subject", pv->value);
+ part = match (
+ (xmlChar *) "subject",
+ (xmlChar *) "subject-type",
+ (xmlChar *) match_type,
+ (xmlChar *) "subject",
+ (xmlChar *) pv->value);
break;
case E2K_PROPTAG_PR_TRANSPORT_MESSAGE_HEADERS:
@@ -402,21 +434,27 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!match_type)
return FALSE;
- part = match ("full-headers", "full-headers-type",
- match_type, "word", pv->value);
+ part = match (
+ (xmlChar *) "full-headers",
+ (xmlChar *) "full-headers-type",
+ (xmlChar *) match_type,
+ (xmlChar *) "word",
+ (xmlChar *) pv->value);
break;
case E2K_PROPTAG_PR_MESSAGE_CLASS:
if ((fuzzy_level == E2K_FL_FULLSTRING) &&
!strcmp (pv->value, "IPM.Note.Rules.OofTemplate.Microsoft")) {
- part = message_is ("special-message",
- "special-message-type",
- "oof", negated);
+ part = message_is (
+ (xmlChar *) "special-message",
+ (xmlChar *) "special-message-type",
+ (xmlChar *) "oof", negated);
} else if ((fuzzy_level == E2K_FL_PREFIX) &&
!strcmp (pv->value, "IPM.Schedule.Meeting")) {
- part = message_is ("special-message",
- "special-message-type",
- "meeting-request", negated);
+ part = message_is (
+ (xmlChar *) "special-message",
+ (xmlChar *) "special-message-type",
+ (xmlChar *) "meeting-request", negated);
} else
return FALSE;
@@ -445,9 +483,10 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
(relop == E2K_RELOP_NE && pv->value))
negated = !negated;
- part = message_is ("message-to-me",
- "message-to-me-type",
- "to", negated);
+ part = message_is (
+ (xmlChar *) "message-to-me",
+ (xmlChar *) "message-to-me-type",
+ (xmlChar *) "to", negated);
break;
case E2K_PROPTAG_PR_MESSAGE_CC_ME:
@@ -455,9 +494,10 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
(relop == E2K_RELOP_NE && pv->value))
negated = !negated;
- part = message_is ("message-to-me",
- "message-to-me-type",
- "cc", negated);
+ part = message_is (
+ (xmlChar *) "message-to-me",
+ (xmlChar *) "message-to-me-type",
+ (xmlChar *) "cc", negated);
break;
case E2K_PROPTAG_PR_MESSAGE_DELIVERY_TIME:
@@ -470,20 +510,33 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
return FALSE;
if (pv->prop.proptag == E2K_PROPTAG_PR_MESSAGE_DELIVERY_TIME)
- part = new_part ("received-date");
+ part = new_part ((xmlChar *) "received-date");
else
- part = new_part ("sent-date");
-
- value = new_value (part, "date-spec-type", "option", relation);
- value = new_value (part, "versus", "datespec", NULL);
-
- node = xmlNewChild (value, NULL, "datespec", NULL);
- xmlSetProp (node, "type", "1");
+ part = new_part ((xmlChar *) "sent-date");
+
+ value = new_value (
+ part,
+ (xmlChar *) "date-spec-type",
+ (xmlChar *) "option",
+ (xmlChar *) relation);
+ value = new_value (
+ part,
+ (xmlChar *) "versus",
+ (xmlChar *) "datespec", NULL);
+
+ node = xmlNewChild (
+ value, NULL, (xmlChar *) "datespec", NULL);
+ xmlSetProp (
+ node,
+ (xmlChar *) "type",
+ (xmlChar *) "1");
timestamp = g_strdup_printf ("%lu", (unsigned long)e2k_parse_timestamp (pv->value));
- xmlSetProp (node, "value", timestamp);
+ xmlSetProp (
+ node,
+ (xmlChar *) "value",
+ (xmlChar *) timestamp);
g_free (timestamp);
-
break;
}
@@ -492,12 +545,18 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!relation)
return FALSE;
- part = new_part ("size");
-
- new_value (part, "size-type", "option", relation);
- new_value_int (part, "versus", "integer", "integer",
- GPOINTER_TO_INT (pv->value) / 1024);
-
+ part = new_part ((xmlChar *) "size");
+ new_value (
+ part,
+ (xmlChar *) "size-type",
+ (xmlChar *) "option",
+ (xmlChar *) relation);
+ new_value_int (
+ part,
+ (xmlChar *) "versus",
+ (xmlChar *) "integer",
+ (xmlChar *) "integer",
+ GPOINTER_TO_INT (pv->value) / 1024);
break;
case E2K_PROPTAG_PR_IMPORTANCE:
@@ -505,10 +564,18 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!relation)
return FALSE;
- part = new_part ("importance");
- new_value (part, "importance-type", "option", relation);
- new_value_int (part, "importance", "option", "value",
- GPOINTER_TO_INT (pv->value));
+ part = new_part ((xmlChar *) "importance");
+ new_value (
+ part,
+ (xmlChar *) "importance-type",
+ (xmlChar *) "option",
+ (xmlChar *) relation);
+ new_value_int (
+ part,
+ (xmlChar *) "importance",
+ (xmlChar *) "option",
+ (xmlChar *) "value",
+ GPOINTER_TO_INT (pv->value));
break;
case E2K_PROPTAG_PR_SENSITIVITY:
@@ -516,11 +583,22 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
if (!relation)
return FALSE;
- part = new_part ("sensitivity");
- xmlSetProp (part, "name", "sensitivity");
- new_value (part, "sensitivity-type", "option", relation);
- new_value_int (part, "sensitivity", "option", "value",
- GPOINTER_TO_INT (pv->value));
+ part = new_part ((xmlChar *) "sensitivity");
+ xmlSetProp (
+ part,
+ (xmlChar *) "name",
+ (xmlChar *) "sensitivity");
+ new_value (
+ part,
+ (xmlChar *) "sensitivity-type",
+ (xmlChar *) "option",
+ (xmlChar *) relation);
+ new_value_int (
+ part,
+ (xmlChar *) "sensitivity",
+ (xmlChar *) "option",
+ (xmlChar *) "value",
+ GPOINTER_TO_INT (pv->value));
break;
default:
@@ -540,13 +618,23 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
rn->res.bitmask.mask != MAPI_MSGFLAG_HASATTACH)
return FALSE;
- part = new_part ("attachments");
+ part = new_part ((xmlChar *) "attachments");
if (rn->res.bitmask.bitop == E2K_BMR_NEZ) {
- new_value (part, "match-type", "option",
- negated ? "not exist" : "exist");
+ new_value (
+ part,
+ (xmlChar *) "match-type",
+ (xmlChar *) "option",
+ negated ?
+ (xmlChar *) "not exist" :
+ (xmlChar *) "exist");
} else {
- new_value (part, "match-type", "option",
- negated ? "exist" : "not exist");
+ new_value (
+ part,
+ (xmlChar *) "match-type",
+ (xmlChar *) "option",
+ negated ?
+ (xmlChar *) "exist" :
+ (xmlChar *) "not exist");
}
break;
@@ -600,41 +688,71 @@ action_to_xml (E2kAction *act, xmlNode *actionset)
switch (act->type) {
case E2K_ACTION_MOVE:
case E2K_ACTION_COPY:
- part = new_part (act->type == E2K_ACTION_MOVE ? "move-to-folder" : "copy-to-folder");
- value = new_value (part, "folder", "folder-source-key", NULL);
+ part = new_part (
+ act->type == E2K_ACTION_MOVE ?
+ (xmlChar *) "move-to-folder" :
+ (xmlChar *) "copy-to-folder");
+ value = new_value (
+ part,
+ (xmlChar *) "folder",
+ (xmlChar *) "folder-source-key", NULL);
entryid = stringify_entryid (
act->act.xfer.folder_source_key->data + 1,
act->act.xfer.folder_source_key->len - 1);
- xmlNewTextChild (value, NULL, "entryid", entryid);
+ xmlNewTextChild (
+ value, NULL,
+ (xmlChar *) "entryid",
+ (xmlChar *) entryid);
g_free (entryid);
break;
case E2K_ACTION_REPLY:
case E2K_ACTION_OOF_REPLY:
- part = new_part (act->type == E2K_ACTION_REPLY ? "reply" : "oof-reply");
- value = new_value (part, "template", "message-entryid", NULL);
+ part = new_part (
+ act->type == E2K_ACTION_REPLY ?
+ (xmlChar *) "reply" :
+ (xmlChar *) "oof-reply");
+ value = new_value (
+ part,
+ (xmlChar *) "template",
+ (xmlChar *) "message-entryid", NULL);
entryid = stringify_entryid (
act->act.reply.entryid->data,
act->act.reply.entryid->len);
- xmlNewTextChild (value, NULL, "entryid", entryid);
+ xmlNewTextChild (
+ value, NULL,
+ (xmlChar *) "entryid",
+ (xmlChar *) entryid);
g_free (entryid);
break;
case E2K_ACTION_DEFER:
- part = new_part ("defer");
+ part = new_part ((xmlChar *) "defer");
break;
case E2K_ACTION_BOUNCE:
- part = new_part ("bounce");
+ part = new_part ((xmlChar *) "bounce");
switch (act->act.bounce_code) {
case E2K_ACTION_BOUNCE_CODE_TOO_LARGE:
- new_value (part, "bounce_code", "option", "size");
+ new_value (
+ part,
+ (xmlChar *) "bounce_code",
+ (xmlChar *) "option",
+ (xmlChar *) "size");
break;
case E2K_ACTION_BOUNCE_CODE_FORM_MISMATCH:
- new_value (part, "bounce_code", "option", "form-mismatch");
+ new_value (
+ part,
+ (xmlChar *) "bounce_code",
+ (xmlChar *) "option",
+ (xmlChar *) "form-mismatch");
break;
case E2K_ACTION_BOUNCE_CODE_ACCESS_DENIED:
- new_value (part, "bounce_code", "option", "permission");
+ new_value (
+ part,
+ (xmlChar *) "bounce_code",
+ (xmlChar *) "option",
+ (xmlChar *) "permission");
break;
}
break;
@@ -668,9 +786,18 @@ action_to_xml (E2kAction *act, xmlNode *actionset)
else
full_addr = g_strdup_printf ("<%s>", email);
- part = new_part (act->type == E2K_ACTION_FORWARD ? "forward" : "delegate");
- value = new_value (part, "recipient", "recipient", NULL);
- xmlNewTextChild (value, NULL, "recipient", full_addr);
+ part = new_part (
+ act->type == E2K_ACTION_FORWARD ?
+ (xmlChar *) "forward" :
+ (xmlChar *) "delegate");
+ value = new_value (
+ part,
+ (xmlChar *) "recipient",
+ (xmlChar *) "recipient", NULL);
+ xmlNewTextChild (
+ value, NULL,
+ (xmlChar *) "recipient",
+ (xmlChar *) full_addr);
g_free (full_addr);
xmlAddChild (actionset, part);
@@ -682,17 +809,21 @@ action_to_xml (E2kAction *act, xmlNode *actionset)
if (act->act.proptag.prop.proptag != E2K_PROPTAG_PR_IMPORTANCE)
return FALSE;
- part = new_part ("set-importance");
- new_value_int (part, "importance", "option", "value",
- GPOINTER_TO_INT (act->act.proptag.value));
+ part = new_part ((xmlChar *) "set-importance");
+ new_value_int (
+ part,
+ (xmlChar *) "importance",
+ (xmlChar *) "option",
+ (xmlChar *) "value",
+ GPOINTER_TO_INT (act->act.proptag.value));
break;
case E2K_ACTION_DELETE:
- part = new_part ("delete");
+ part = new_part ((xmlChar *) "delete");
break;
case E2K_ACTION_MARK_AS_READ:
- part = new_part ("mark-read");
+ part = new_part ((xmlChar *) "mark-read");
break;
default:
@@ -710,26 +841,41 @@ rule_to_xml (E2kRule *rule, xmlNode *ruleset)
E2kRestriction *rn;
gint i;
- top = xmlNewChild (ruleset, NULL, "rule", NULL);
+ top = xmlNewChild (ruleset, NULL, (xmlChar *) "rule", NULL);
- xmlSetProp (top, "source",
- (rule->state & E2K_RULE_STATE_ONLY_WHEN_OOF) ?
- "oof" : "incoming");
- xmlSetProp (top, "enabled", (rule->state & E2K_RULE_STATE_ENABLED) ? "1" : "0");
+ xmlSetProp (
+ top,
+ (xmlChar *) "source",
+ (rule->state & E2K_RULE_STATE_ONLY_WHEN_OOF) ?
+ (xmlChar *) "oof" : (xmlChar *) "incoming");
+ xmlSetProp (
+ top,
+ (xmlChar *) "enabled",
+ (rule->state & E2K_RULE_STATE_ENABLED) ?
+ (xmlChar *) "1" : (xmlChar *) "0");
if (rule->name)
- xmlNewTextChild (top, NULL, "title", rule->name);
+ xmlNewTextChild (
+ top, NULL,
+ (xmlChar *) "title",
+ (xmlChar *) rule->name);
- set = xmlNewChild (top, NULL, "partset", NULL);
+ set = xmlNewChild (top, NULL, (xmlChar *) "partset", NULL);
rn = rule->condition;
if (rn) {
E2kRestrictionType wrap_type;
if (rn->type == E2K_RESTRICTION_OR) {
- xmlSetProp (top, "grouping", "any");
+ xmlSetProp (
+ top,
+ (xmlChar *) "grouping",
+ (xmlChar *) "any");
wrap_type = E2K_RESTRICTION_OR;
} else {
- xmlSetProp (top, "grouping", "all");
+ xmlSetProp (
+ top,
+ (xmlChar *) "grouping",
+ (xmlChar *) "all");
wrap_type = E2K_RESTRICTION_AND;
}
@@ -740,9 +886,9 @@ rule_to_xml (E2kRule *rule, xmlNode *ruleset)
return FALSE;
}
} else
- xmlSetProp (top, "grouping", "all");
+ xmlSetProp (top, (xmlChar *) "grouping", (xmlChar *) "all");
- set = xmlNewChild (top, NULL, "actionset", NULL);
+ set = xmlNewChild (top, NULL, (xmlChar *) "actionset", NULL);
for (i = 0; i < rule->actions->len; i++) {
if (!action_to_xml (rule->actions->pdata[i], set)) {
g_warning ("could not express action as xml");
@@ -753,7 +899,7 @@ rule_to_xml (E2kRule *rule, xmlNode *ruleset)
}
if (rule->state & E2K_RULE_STATE_EXIT_LEVEL)
- xmlAddChild (set, new_part ("stop"));
+ xmlAddChild (set, new_part ((xmlChar *) "stop"));
return TRUE;
}
@@ -775,10 +921,10 @@ e2k_rules_to_xml (E2kRules *rules)
gint i;
doc = xmlNewDoc (NULL);
- top = xmlNewNode (NULL, "filteroptions");
+ top = xmlNewNode (NULL, (xmlChar *) "filteroptions");
xmlDocSetRootElement (doc, top);
- ruleset = xmlNewChild (top, NULL, "ruleset", NULL);
+ ruleset = xmlNewChild (top, NULL, (xmlChar *) "ruleset", NULL);
for (i = 0; i < rules->rules->len; i++)
rule_to_xml (rules->rules->pdata[i], ruleset);
diff --git a/servers/exchange/lib/e2k-rule.c b/servers/exchange/lib/e2k-rule.c
index 9d46ab6..62a1681 100644
--- a/servers/exchange/lib/e2k-rule.c
+++ b/servers/exchange/lib/e2k-rule.c
@@ -226,7 +226,7 @@ void
e2k_rule_append_string (GByteArray *ba, const gchar *str)
{
/* FIXME: verify encoding */
- g_byte_array_append (ba, str, strlen (str) + 1);
+ g_byte_array_append (ba, (guint8 *) str, strlen (str) + 1);
}
/**
@@ -247,7 +247,7 @@ e2k_rule_extract_string (guint8 **ptr, gint *len, gchar **str)
for (slen = 0; slen < *len; slen++) {
if ((*ptr)[slen] == '\0') {
- *str = g_strdup (*ptr);
+ *str = g_strdup ((gchar *) *ptr);
*ptr += slen + 1;
*len -= slen + 1;
return TRUE;
diff --git a/servers/exchange/lib/e2k-security-descriptor.c b/servers/exchange/lib/e2k-security-descriptor.c
index 65fbbef..15f828b 100644
--- a/servers/exchange/lib/e2k-security-descriptor.c
+++ b/servers/exchange/lib/e2k-security-descriptor.c
@@ -277,10 +277,10 @@ ace_compar (E2k_ACE *ace1, E2k_ACE *ace2, E2kSecurityDescriptor *sd)
static xmlNode *
-find_child (xmlNode *node, const gchar *name)
+find_child (xmlNode *node, const xmlChar *name)
{
for (node = node->xmlChildrenNode; node; node = node->next) {
- if (node->name && !strcmp (node->name, name))
+ if (node->name && !xmlStrcmp (node->name, name))
return node;
}
return NULL;
@@ -290,34 +290,34 @@ static void
extract_sids (E2kSecurityDescriptor *sd, xmlNodePtr node)
{
xmlNodePtr string_sid_node, type_node, display_name_node;
- gchar *string_sid, *content, *display_name;
+ xmlChar *string_sid, *content, *display_name;
const guint8 *bsid;
E2kSid *sid;
E2kSidType type;
for (; node; node = node->next) {
- if (strcmp (node->name, "sid") != 0) {
+ if (xmlStrcmp (node->name, (xmlChar *) "sid") != 0) {
if (node->xmlChildrenNode)
extract_sids (sd, node->xmlChildrenNode);
continue;
}
- string_sid_node = find_child (node, "string_sid");
- type_node = find_child (node, "type");
- display_name_node = find_child (node, "display_name");
+ string_sid_node = find_child (node, (xmlChar *) "string_sid");
+ type_node = find_child (node, (xmlChar *) "type");
+ display_name_node = find_child (node, (xmlChar *) "display_name");
if (!string_sid_node || !type_node)
continue;
string_sid = xmlNodeGetContent (string_sid_node);
content = xmlNodeGetContent (type_node);
- if (!content || !strcmp (content, "user"))
+ if (!content || !xmlStrcmp (content, (xmlChar *) "user"))
type = E2K_SID_TYPE_USER;
- else if (!strcmp (content, "group"))
+ else if (!xmlStrcmp (content, (xmlChar *) "group"))
type = E2K_SID_TYPE_GROUP;
- else if (!strcmp (content, "well_known_group"))
+ else if (!xmlStrcmp (content, (xmlChar *) "well_known_group"))
type = E2K_SID_TYPE_WELL_KNOWN_GROUP;
- else if (!strcmp (content, "alias"))
+ else if (!xmlStrcmp (content, (xmlChar *) "alias"))
type = E2K_SID_TYPE_ALIAS;
else
type = E2K_SID_TYPE_INVALID;
@@ -328,8 +328,8 @@ extract_sids (E2kSecurityDescriptor *sd, xmlNodePtr node)
else
display_name = NULL;
- sid = e2k_sid_new_from_string_sid (type, string_sid,
- display_name);
+ sid = e2k_sid_new_from_string_sid (type, (gchar *) string_sid,
+ (gchar *) display_name);
xmlFree (string_sid);
if (display_name)
xmlFree (display_name);
diff --git a/servers/exchange/lib/e2k-utils.c b/servers/exchange/lib/e2k-utils.c
index 8852e0a..7dae116 100644
--- a/servers/exchange/lib/e2k-utils.c
+++ b/servers/exchange/lib/e2k-utils.c
@@ -375,8 +375,8 @@ static gboolean
append_entryid_section (GByteArray *entryid, const gchar **permanenturl)
{
const gchar *p;
- gchar buf[44], byte;
- gint endlen;
+ guint8 buf[44], byte;
+ int endlen;
p = *permanenturl;
if (strspn (p, "0123456789abcdefABCDEF") != 32)
@@ -392,8 +392,8 @@ append_entryid_section (GByteArray *entryid, const gchar **permanenturl)
memset (buf + 32, '0', sizeof (buf) - 32 - endlen);
memcpy (buf + sizeof (buf) - endlen, p + 33, endlen);
- p = buf;
- while (p < buf + sizeof (buf)) {
+ p = (gchar *) buf;
+ while (p < (gchar *) buf + sizeof (buf)) {
byte = (HEXVAL (*p) << 4) + HEXVAL (*(p + 1));
g_byte_array_append (entryid, &byte, 1);
p += 2;
@@ -554,7 +554,7 @@ e2k_entryid_generate_oneoff (const gchar *display_name, const gchar *email, gboo
entryid = g_byte_array_new ();
e2k_rule_append_uint32 (entryid, 0);
- g_byte_array_append (entryid, MAPI_ONE_OFF_UID, sizeof (MAPI_ONE_OFF_UID));
+ g_byte_array_append (entryid, (guint8 *) MAPI_ONE_OFF_UID, sizeof (MAPI_ONE_OFF_UID));
e2k_rule_append_uint16 (entryid, 0);
e2k_rule_append_uint16 (entryid,
MAPI_ONE_OFF_NO_RICH_INFO |
@@ -597,7 +597,7 @@ e2k_entryid_generate_local (const gchar *exchange_dn)
entryid = g_byte_array_new ();
e2k_rule_append_uint32 (entryid, 0);
- g_byte_array_append (entryid, MAPI_LOCAL_UID, sizeof (MAPI_LOCAL_UID));
+ g_byte_array_append (entryid, (guint8 *) MAPI_LOCAL_UID, sizeof (MAPI_LOCAL_UID));
e2k_rule_append_uint16 (entryid, 1);
e2k_rule_append_uint16 (entryid, 0);
e2k_rule_append_string (entryid, exchange_dn);
@@ -630,7 +630,7 @@ e2k_entryid_generate_contact (GByteArray *contact_entryid, gint nth_address)
entryid = g_byte_array_new ();
e2k_rule_append_uint32 (entryid, 0);
- g_byte_array_append (entryid, MAPI_CONTACT_UID, sizeof (MAPI_CONTACT_UID));
+ g_byte_array_append (entryid, (guint8 *) MAPI_CONTACT_UID, sizeof (MAPI_CONTACT_UID));
e2k_rule_append_uint32 (entryid, 3);
e2k_rule_append_uint32 (entryid, 4);
e2k_rule_append_uint32 (entryid, nth_address);
@@ -656,10 +656,10 @@ e2k_search_key_generate (const gchar *addrtype, const gchar *address)
guint8 *p;
search_key = g_byte_array_new ();
- g_byte_array_append (search_key, addrtype, strlen (addrtype));
- g_byte_array_append (search_key, ":", 1);
- g_byte_array_append (search_key, address, strlen (address));
- g_byte_array_append (search_key, "", 1);
+ g_byte_array_append (search_key, (guint8 *) addrtype, strlen (addrtype));
+ g_byte_array_append (search_key, (guint8 *) ":", 1);
+ g_byte_array_append (search_key, (guint8 *) address, strlen (address));
+ g_byte_array_append (search_key, (guint8 *) "", 1);
for (p = search_key->data; *p; p++)
*p = g_ascii_toupper (*p);
diff --git a/servers/exchange/lib/e2k-xml-utils.c b/servers/exchange/lib/e2k-xml-utils.c
index 074f721..adfb86e 100644
--- a/servers/exchange/lib/e2k-xml-utils.c
+++ b/servers/exchange/lib/e2k-xml-utils.c
@@ -247,7 +247,7 @@ e2k_xml_find_in (xmlNode *node, xmlNode *top, const gchar *name)
node = node->next;
}
- if (node->name && !strcmp (node->name, name))
+ if (node->name && !strcmp ((gchar *) node->name, name))
return node;
}
diff --git a/servers/exchange/lib/e2k-xml-utils.h b/servers/exchange/lib/e2k-xml-utils.h
index 7c26bbc..854b439 100644
--- a/servers/exchange/lib/e2k-xml-utils.h
+++ b/servers/exchange/lib/e2k-xml-utils.h
@@ -14,7 +14,9 @@
xmlDoc *e2k_parse_xml (const gchar *buf, gint len);
xmlDoc *e2k_parse_html (const gchar *buf, gint len);
-#define E2K_IS_NODE(node, nspace, nname) (!strcmp (node->name, nname) && node->ns && !strcmp (node->ns->href, nspace))
+#define E2K_IS_NODE(node, nspace, nname) \
+ (!xmlStrcmp ((node)->name, (xmlChar *) (nname)) && \
+ (node)->ns && !xmlStrcmp ((node)->ns->href, (xmlChar *) (nspace)))
void e2k_g_string_append_xml_escaped (GString *string, const gchar *value);
diff --git a/servers/exchange/storage/e-folder-exchange.c b/servers/exchange/storage/e-folder-exchange.c
index 44ffdac..92fda14 100644
--- a/servers/exchange/storage/e-folder-exchange.c
+++ b/servers/exchange/storage/e-folder-exchange.c
@@ -495,19 +495,40 @@ e_folder_exchange_save_to_file (EFolder *folder, const gchar *filename)
else
return FALSE;
- doc = xmlNewDoc ("1.0");
- root = xmlNewDocNode (doc, NULL, "connector-folder", NULL);
- xmlNewProp (root, "version", "1");
+ doc = xmlNewDoc ((xmlChar *) "1.0");
+ root = xmlNewDocNode (doc, NULL, (xmlChar *) "connector-folder", NULL);
+ xmlNewProp (root, (xmlChar *) "version", (xmlChar *) "1");
xmlDocSetRootElement (doc, root);
- xmlNewChild (root, NULL, "displayname", name);
- xmlNewChild (root, NULL, "type", type);
- xmlNewChild (root, NULL, "outlook_class", outlook_class);
- xmlNewChild (root, NULL, "physical_uri", physical_uri);
- xmlNewChild (root, NULL, "internal_uri", internal_uri);
- xmlNewChild (root, NULL, "folder_size", folder_size);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "displayname",
+ (xmlChar *) name);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "type",
+ (xmlChar *) type);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "outlook_class",
+ (xmlChar *) outlook_class);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "physical_uri",
+ (xmlChar *) physical_uri);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "internal_uri",
+ (xmlChar *) internal_uri);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "folder_size",
+ (xmlChar *) folder_size);
if (permanent_uri)
- xmlNewChild (root, NULL, "permanent_uri", permanent_uri);
+ xmlNewChild (
+ root, NULL,
+ (xmlChar *) "permanent_uri",
+ (xmlChar *) permanent_uri);
status = e_xml_save_file (filename, doc);
@@ -536,11 +557,11 @@ e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const gchar *filename)
EFolder *folder = NULL;
xmlDoc *doc;
xmlNode *root, *node;
- gchar *version, *display_name = NULL;
- gchar *type = NULL, *outlook_class = NULL;
- gchar *physical_uri = NULL, *internal_uri = NULL;
- gchar *permanent_uri = NULL;
- gchar *folder_size = NULL;
+ xmlChar *version, *display_name = NULL;
+ xmlChar *type = NULL, *outlook_class = NULL;
+ xmlChar *physical_uri = NULL, *internal_uri = NULL;
+ xmlChar *permanent_uri = NULL;
+ xmlChar *folder_size = NULL;
doc = e_xml_parse_file (filename);
@@ -548,43 +569,43 @@ e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const gchar *filename)
return NULL;
root = xmlDocGetRootElement (doc);
- if (root == NULL || strcmp (root->name, "connector-folder") != 0) {
+ if (root == NULL || strcmp ((gchar *) root->name, "connector-folder") != 0) {
xmlFreeDoc (doc);
return NULL;
}
- version = xmlGetProp (root, "version");
+ version = xmlGetProp (root, (xmlChar *) "version");
if (!version) {
xmlFreeDoc (doc);
return NULL;
}
- if (strcmp (version, "1") != 0) {
+ if (strcmp ((gchar *) version, "1") != 0) {
xmlFreeDoc (doc);
xmlFree (version);
return NULL;
}
xmlFree (version);
- node = e_xml_get_child_by_name (root, "displayname");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "displayname");
if (!node)
goto done;
display_name = xmlNodeGetContent (node);
- node = e_xml_get_child_by_name (root, "type");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "type");
if (!node)
goto done;
type = xmlNodeGetContent (node);
- node = e_xml_get_child_by_name (root, "outlook_class");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "outlook_class");
if (!node)
goto done;
outlook_class = xmlNodeGetContent (node);
- node = e_xml_get_child_by_name (root, "physical_uri");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "physical_uri");
if (!node)
goto done;
physical_uri = xmlNodeGetContent (node);
- node = e_xml_get_child_by_name (root, "internal_uri");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "internal_uri");
if (!node)
goto done;
internal_uri = xmlNodeGetContent (node);
@@ -592,20 +613,24 @@ e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const gchar *filename)
if (!display_name || !type || !physical_uri || !internal_uri)
goto done;
- folder = e_folder_exchange_new (hier, display_name,
- type, outlook_class,
- physical_uri, internal_uri);
+ folder = e_folder_exchange_new (
+ hier,
+ (gchar *) display_name,
+ (gchar *) type,
+ (gchar *) outlook_class,
+ (gchar *) physical_uri,
+ (gchar *) internal_uri);
- node = e_xml_get_child_by_name (root, "permanent_uri");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "permanent_uri");
if (node) {
permanent_uri = xmlNodeGetContent (node);
- e_folder_exchange_set_permanent_uri (folder, permanent_uri);
+ e_folder_exchange_set_permanent_uri (folder, (gchar *) permanent_uri);
}
- node = e_xml_get_child_by_name (root, "folder_size");
+ node = e_xml_get_child_by_name (root, (xmlChar *) "folder_size");
if (node) {
folder_size = xmlNodeGetContent (node);
- e_folder_exchange_set_folder_size (folder, atoi (folder_size));
+ e_folder_exchange_set_folder_size (folder, atoi ((gchar *) folder_size));
}
done:
diff --git a/servers/exchange/storage/e-folder-type-registry.c b/servers/exchange/storage/e-folder-type-registry.c
index 0c19a78..8f3f03a 100644
--- a/servers/exchange/storage/e-folder-type-registry.c
+++ b/servers/exchange/storage/e-folder-type-registry.c
@@ -29,6 +29,8 @@
#define PARENT_TYPE G_TYPE_OBJECT
static GObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (EFolderTypeRegistry, e_folder_type_registry, G_TYPE_OBJECT)
+
typedef struct {
gchar *name;
gchar *icon_name;
@@ -405,4 +407,3 @@ e_folder_type_registry_get_accepted_dnd_types_for_type (EFolderTypeRegistry *fol
return folder_type->accepted_dnd_types;
}
-G_DEFINE_TYPE (EFolderTypeRegistry, e_folder_type_registry, G_TYPE_OBJECT)
diff --git a/servers/exchange/storage/e-folder.c b/servers/exchange/storage/e-folder.c
index 2a25803..1550cf6 100644
--- a/servers/exchange/storage/e-folder.c
+++ b/servers/exchange/storage/e-folder.c
@@ -33,6 +33,8 @@
#define PARENT_TYPE G_TYPE_OBJECT
static GObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (EFolder, e_folder, G_TYPE_OBJECT)
+
struct EFolderPrivate {
gchar *name;
gchar *type;
@@ -459,5 +461,3 @@ e_folder_accept_drop (EFolder *folder, GdkDragContext *context,
target_type,
selection_data);
}
-
-G_DEFINE_TYPE (EFolder, e_folder, G_TYPE_OBJECT)
diff --git a/servers/exchange/storage/e-storage.c b/servers/exchange/storage/e-storage.c
index be8f41e..8a201dc 100644
--- a/servers/exchange/storage/e-storage.c
+++ b/servers/exchange/storage/e-storage.c
@@ -36,6 +36,8 @@
#define PARENT_TYPE G_TYPE_OBJECT
static GObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (EStorage, e_storage, G_TYPE_OBJECT)
+
struct EStoragePrivate {
/* The set of folders we have in this storage. */
EFolderTree *folder_tree;
@@ -824,5 +826,3 @@ e_storage_removed_folder (EStorage *storage,
return TRUE;
}
-
-G_DEFINE_TYPE (EStorage, e_storage, G_TYPE_OBJECT)
diff --git a/servers/exchange/storage/exchange-esource.h b/servers/exchange/storage/exchange-esource.h
index 65edd9f..02c8a6c 100644
--- a/servers/exchange/storage/exchange-esource.h
+++ b/servers/exchange/storage/exchange-esource.h
@@ -22,9 +22,6 @@ extern "C" {
void add_folder_esource (ExchangeAccount *account, FolderType folder_type, const gchar *folder_name, const gchar *physical_uri);
void remove_folder_esource (ExchangeAccount *account, FolderType folder_type, const gchar *physical_uri);
-/* Remove this ugly hack by moving this to exchange-account.h */
-gchar * exchange_account_get_authtype (ExchangeAccount *account);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/servers/exchange/storage/exchange-folder-size.c b/servers/exchange/storage/exchange-folder-size.c
index aa02622..6f11c4e 100644
--- a/servers/exchange/storage/exchange-folder-size.c
+++ b/servers/exchange/storage/exchange-folder-size.c
@@ -35,6 +35,8 @@
#define PARENT_TYPE G_TYPE_OBJECT
static GObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (ExchangeFolderSize, exchange_folder_size, G_TYPE_OBJECT)
+
typedef struct {
gchar *folder_name;
gdouble folder_size;
@@ -118,8 +120,6 @@ exchange_folder_size_init (ExchangeFolderSize *fsize)
fsize->priv->row_refs = g_hash_table_new (g_str_hash, g_str_equal);
}
-G_DEFINE_TYPE (ExchangeFolderSize, exchange_folder_size, G_TYPE_OBJECT)
-
/**
* exchange_folder_size_new:
*
diff --git a/servers/exchange/storage/exchange-hierarchy-foreign.c b/servers/exchange/storage/exchange-hierarchy-foreign.c
index 35408ec..bd12f5e 100644
--- a/servers/exchange/storage/exchange-hierarchy-foreign.c
+++ b/servers/exchange/storage/exchange-hierarchy-foreign.c
@@ -534,14 +534,14 @@ exchange_hierarchy_foreign_new (ExchangeAccount *account,
source_uri);
props = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (props, "name", (gchar *)hierarchy_name);
- g_hash_table_insert (props, "physical_uri_prefix",
- (gchar *)physical_uri_prefix);
- g_hash_table_insert (props, "internal_uri_prefix",
- (gchar *)internal_uri_prefix);
- g_hash_table_insert (props, "owner_name", (gchar *)owner_name);
- g_hash_table_insert (props, "owner_email", (gchar *)owner_email);
- g_hash_table_insert (props, "source_uri", (gchar *)source_uri);
+ g_hash_table_insert (props, (gpointer) "name", (char *)hierarchy_name);
+ g_hash_table_insert (props, (gpointer) "physical_uri_prefix",
+ (char *)physical_uri_prefix);
+ g_hash_table_insert (props, (gpointer) "internal_uri_prefix",
+ (char *)internal_uri_prefix);
+ g_hash_table_insert (props, (gpointer) "owner_name", (char *)owner_name);
+ g_hash_table_insert (props, (gpointer) "owner_email", (char *)owner_email);
+ g_hash_table_insert (props, (gpointer) "source_uri", (char *)source_uri);
mf_path = e_folder_exchange_get_storage_file (hier->toplevel, "hierarchy.xml");
doc = e_xml_from_hash (props, E_XML_HASH_TYPE_PROPERTY,
diff --git a/servers/exchange/storage/exchange-hierarchy-webdav.c b/servers/exchange/storage/exchange-hierarchy-webdav.c
index 3e5ee13..61c3eb9 100644
--- a/servers/exchange/storage/exchange-hierarchy-webdav.c
+++ b/servers/exchange/storage/exchange-hierarchy-webdav.c
@@ -147,7 +147,7 @@ E2K_MAKE_TYPE (exchange_hierarchy_webdav, ExchangeHierarchyWebDAV, class_init, i
typedef struct {
- gchar *contentclass, *component;
+ const gchar *contentclass, *component;
gboolean offline_supported;
} ExchangeFolderType;
@@ -168,7 +168,7 @@ folder_type_map_init (void)
folder_type_map = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; folder_types[i].contentclass; i++) {
g_hash_table_insert (folder_type_map,
- folder_types[i].contentclass,
+ (gpointer) folder_types[i].contentclass,
&folder_types[i]);
}
}
diff --git a/servers/exchange/xntlm/xntlm.c b/servers/exchange/xntlm/xntlm.c
index fe7c2f1..7fc8a94 100644
--- a/servers/exchange/xntlm/xntlm.c
+++ b/servers/exchange/xntlm/xntlm.c
@@ -158,7 +158,7 @@ ntlm_set_string (GByteArray *ba, gint offset, const gchar *data, gint len)
ba->data[offset + 1] = ba->data[offset + 3] = (len >> 8) & 0xFF;
ba->data[offset + 4] = ba->len & 0xFF;
ba->data[offset + 5] = (ba->len >> 8) & 0xFF;
- g_byte_array_append (ba, data, len);
+ g_byte_array_append (ba, (guint8 *) data, len);
}
static void ntlm_lanmanager_hash (const gchar *password, gchar hash[21]);
@@ -207,10 +207,10 @@ xntlm_authenticate (const gchar *nonce, const gchar *domain,
message = g_byte_array_new ();
- ntlm_lanmanager_hash (password, hash);
- ntlm_calc_response (hash, nonce, lm_resp);
- ntlm_nt_hash (password, hash);
- ntlm_calc_response (hash, nonce, nt_resp);
+ ntlm_lanmanager_hash (password, (gchar *) hash);
+ ntlm_calc_response (hash, (guchar *) nonce, lm_resp);
+ ntlm_nt_hash (password, (gchar *) hash);
+ ntlm_calc_response (hash, (guchar *) nonce, nt_resp);
g_byte_array_set_size (message, NTLM_RESPONSE_BASE_SIZE);
memset (message->data, 0, NTLM_RESPONSE_BASE_SIZE);
@@ -224,9 +224,9 @@ xntlm_authenticate (const gchar *nonce, const gchar *domain,
ntlm_set_string (message, NTLM_RESPONSE_WORKSTATION_OFFSET,
workstation, strlen (workstation));
ntlm_set_string (message, NTLM_RESPONSE_LM_RESP_OFFSET,
- lm_resp, sizeof (lm_resp));
+ (gchar *) lm_resp, sizeof (lm_resp));
ntlm_set_string (message, NTLM_RESPONSE_NT_RESP_OFFSET,
- nt_resp, sizeof (nt_resp));
+ (gchar *) nt_resp, sizeof (nt_resp));
return message;
}
@@ -281,10 +281,10 @@ ntlm_lanmanager_hash (const gchar *password, gchar hash[21])
memcpy (hash, LM_PASSWORD_MAGIC, sizeof (LM_PASSWORD_MAGIC));
setup_schedule (lm_password, ks);
- xntlm_des (ks, hash);
+ xntlm_des (ks, (guchar *) hash);
setup_schedule (lm_password + 7, ks);
- xntlm_des (ks, hash + 8);
+ xntlm_des (ks, (guchar *) hash + 8);
}
static void
@@ -299,7 +299,7 @@ ntlm_nt_hash (const gchar *password, gchar hash[21])
*p++ = '\0';
}
- xntlm_md4sum (buf, p - buf, hash);
+ xntlm_md4sum (buf, p - buf, (guchar *) hash);
memset (hash + 16, 0, 5);
g_free (buf);
diff --git a/servers/google/libgdata-google/gdata-google-service.c b/servers/google/libgdata-google/gdata-google-service.c
index 74913a6..b90f17f 100644
--- a/servers/google/libgdata-google/gdata-google-service.c
+++ b/servers/google/libgdata-google/gdata-google-service.c
@@ -685,11 +685,11 @@ gdata_google_service_authenticate (GDataGoogleService *service, GError **error)
auth = (GDataGoogleServiceAuth *)priv->auth;
request_form = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (request_form, "Email", auth->username);
- g_hash_table_insert (request_form, "Passwd", auth->password);
- g_hash_table_insert (request_form, "service", priv->name);
- g_hash_table_insert (request_form, "source", priv->agent);
- g_hash_table_insert (request_form, "accountType", "HOSTED_OR_GOOGLE");
+ g_hash_table_insert (request_form, (gpointer) "Email", auth->username);
+ g_hash_table_insert (request_form, (gpointer) "Passwd", auth->password);
+ g_hash_table_insert (request_form, (gpointer) "service", priv->name);
+ g_hash_table_insert (request_form, (gpointer) "source", priv->agent);
+ g_hash_table_insert (request_form, (gpointer) "accountType", (gpointer) "HOSTED_OR_GOOGLE");
request_body = soup_form_encode_hash (request_form);
g_hash_table_destroy (request_form);
diff --git a/servers/groupwise/e-gw-connection.c b/servers/groupwise/e-gw-connection.c
index c525058..3ec7fce 100644
--- a/servers/groupwise/e-gw-connection.c
+++ b/servers/groupwise/e-gw-connection.c
@@ -1848,15 +1848,19 @@ e_gw_connection_get_date_from_string (const gchar *dtstring)
/* It might be a date value */
GDate date;
struct tm tt;
+ guint16 year;
+ guint month;
+ guint8 day;
g_date_clear (&date, 1);
#define digit_at(x,y) (x[y] - '0')
- guint16 year = digit_at (dtstring, 0) * 1000
- + digit_at (dtstring, 1) * 100
- + digit_at (dtstring, 2) * 10
- + digit_at (dtstring, 3);
- guint month = digit_at (dtstring, 4) * 10 + digit_at (dtstring, 5);
- guint8 day = digit_at (dtstring, 6) * 10 + digit_at (dtstring, 7);
+ year = digit_at (dtstring, 0) * 1000
+ + digit_at (dtstring, 1) * 100
+ + digit_at (dtstring, 2) * 10
+ + digit_at (dtstring, 3);
+ month = digit_at (dtstring, 4) * 10 + digit_at (dtstring, 5);
+ day = digit_at (dtstring, 6) * 10 + digit_at (dtstring, 7);
+
g_date_set_year (&date, year);
g_date_set_month (&date, month);
g_date_set_day (&date, day);
@@ -3452,7 +3456,7 @@ e_gw_connection_get_junk_settings (EGwConnection *cnc, gint *use_junk, gint *use
}
static void
-msg_add_settings (SoupSoapMessage *msg, gchar *field, gint value)
+msg_add_settings (SoupSoapMessage *msg, const gchar *field, int value)
{
soup_soap_message_start_element (msg, "setting", NULL, NULL);
e_gw_message_write_string_parameter (msg, "field", NULL, field);
diff --git a/servers/groupwise/e-gw-filter.c b/servers/groupwise/e-gw-filter.c
index 2b673c0..6365875 100644
--- a/servers/groupwise/e-gw-filter.c
+++ b/servers/groupwise/e-gw-filter.c
@@ -82,7 +82,7 @@ static void
append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
{
- gchar *operation_name;
+ const gchar *operation_name;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
soup_soap_message_start_element (msg, "element", NULL, NULL);
diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c
index 83faeb6..002cc96 100644
--- a/servers/groupwise/e-gw-item.c
+++ b/servers/groupwise/e-gw-item.c
@@ -851,7 +851,7 @@ e_gw_item_set_field_value (EGwItem *item, const gchar *field_name, gchar * field
g_return_if_fail (E_IS_GW_ITEM(item));
if (item->priv->simple_fields != NULL)
- g_hash_table_insert (item->priv->simple_fields, field_name, g_strdup (field_value));
+ g_hash_table_insert (item->priv->simple_fields, (gpointer) field_name, g_strdup (field_value));
}
guint32
@@ -915,7 +915,7 @@ void
e_gw_item_set_address (EGwItem *item, const gchar *address_type, PostalAddress *address)
{
if (address_type && address)
- g_hash_table_insert (item->priv->addresses, address_type, address);
+ g_hash_table_insert (item->priv->addresses, (gpointer) address_type, address);
}
@@ -973,7 +973,7 @@ void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, const g
}
if (hash_table)
- g_hash_table_insert (hash_table, field_name, field_value);
+ g_hash_table_insert (hash_table, (gpointer) field_name, field_value);
}
@@ -994,28 +994,28 @@ set_common_addressbook_item_fields_from_soap_parameter (EGwItem *item, SoupSoapP
subparam = soup_soap_parameter_get_first_child_by_name(param, "id");
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
- g_hash_table_insert (simple_fields, "id", value);
+ g_hash_table_insert (simple_fields, (gpointer) "id", value);
item->priv->id = g_strdup (value);
}
value = NULL;
subparam = soup_soap_parameter_get_first_child_by_name (param, "modified");
if (subparam) {
value = soup_soap_parameter_get_string_value (subparam);
- g_hash_table_insert (simple_fields, "modified_time", value);
+ g_hash_table_insert (simple_fields, (gpointer) "modified_time", value);
}
value = NULL;
subparam = soup_soap_parameter_get_first_child_by_name (param, "comment");
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if (value)
- g_hash_table_insert (simple_fields , "comment", value);
+ g_hash_table_insert (simple_fields , (gpointer) "comment", value);
}
value = NULL;
subparam = soup_soap_parameter_get_first_child_by_name(param, "name");
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if (value)
- g_hash_table_insert (simple_fields, "name", value);
+ g_hash_table_insert (simple_fields, (gpointer) "name", value);
}
value = NULL;
subparam = soup_soap_parameter_get_first_child_by_name (param, "categories");
@@ -1196,7 +1196,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
subparam = soup_soap_parameter_get_first_child_by_name(param, "phoneList");
if(subparam) {
- g_hash_table_insert (simple_fields, "default_phone", soup_soap_parameter_get_property(subparam, "default"));
+ g_hash_table_insert (simple_fields, (gpointer) "default_phone", soup_soap_parameter_get_property(subparam, "default"));
for ( temp = soup_soap_parameter_get_first_child (subparam); temp != NULL; temp = soup_soap_parameter_get_next_child (temp))
{
const gchar *key = NULL;
@@ -1237,14 +1237,14 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
if(temp) {
value = soup_soap_parameter_get_string_value (temp);
if (value)
- g_hash_table_insert (simple_fields, "birthday", value);
+ g_hash_table_insert (simple_fields, (gpointer) "birthday", value);
}
temp = soup_soap_parameter_get_first_child_by_name (subparam, "website");
if(temp) {
value = soup_soap_parameter_get_string_value (temp);
if (value)
- g_hash_table_insert (simple_fields, "website", value);
+ g_hash_table_insert (simple_fields, (gpointer) "website", value);
}
}
@@ -1254,22 +1254,22 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
if(temp) {
value = soup_soap_parameter_get_string_value (temp);
if(value)
- g_hash_table_insert (simple_fields, "organization", value);
+ g_hash_table_insert (simple_fields, (gpointer) "organization", value);
value = soup_soap_parameter_get_property(temp, "uid");
if (value)
- g_hash_table_insert (simple_fields, "organization_id", value);
+ g_hash_table_insert (simple_fields, (gpointer) "organization_id", value);
}
temp = soup_soap_parameter_get_first_child_by_name (subparam, "department");
if(temp) {
value = soup_soap_parameter_get_string_value (temp);
if(value)
- g_hash_table_insert (simple_fields, "department", value);
+ g_hash_table_insert (simple_fields, (gpointer) "department", value);
}
temp = soup_soap_parameter_get_first_child_by_name (subparam, "title");
if(temp) {
value = soup_soap_parameter_get_string_value (temp);
if(value)
- g_hash_table_insert (simple_fields, "title", value);
+ g_hash_table_insert (simple_fields, (gpointer) "title", value);
}
}
@@ -1374,7 +1374,7 @@ set_resource_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if(value)
- g_hash_table_insert (simple_fields, "default_phone", value);
+ g_hash_table_insert (simple_fields, (gpointer) "default_phone", value);
}
subparam = soup_soap_parameter_get_first_child_by_name (param, "email");
if(subparam) {
@@ -1410,21 +1410,21 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if(value)
- g_hash_table_insert (simple_fields, "default_phone", value);
+ g_hash_table_insert (simple_fields, (gpointer) "default_phone", value);
}
subparam = soup_soap_parameter_get_first_child_by_name (param, "fax");
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if(value)
- g_hash_table_insert (simple_fields, "phone_Fax", value);
+ g_hash_table_insert (simple_fields, (gpointer) "phone_Fax", value);
}
subparam = soup_soap_parameter_get_first_child_by_name (param, "address");
if (subparam) {
address = g_new0 (PostalAddress, 1);
set_postal_address_from_soap_parameter (address, subparam);
- g_hash_table_insert (item->priv->addresses, "Office", address);
+ g_hash_table_insert (item->priv->addresses, (gpointer) "Office", address);
}
@@ -1432,14 +1432,14 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
if(subparam) {
value = soup_soap_parameter_get_string_value (subparam);
if(value)
- g_hash_table_insert (simple_fields, "website", value);
+ g_hash_table_insert (simple_fields, (gpointer) "website", value);
}
}
static void
-append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *address, gchar *address_type)
+append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *address, const gchar *address_type)
{
soup_soap_message_start_element (msg, "address", NULL, NULL);
soup_soap_message_add_attribute (msg, "type", address_type, NULL, NULL);
@@ -1972,7 +1972,7 @@ e_gw_item_new_from_soap_parameter (const gchar *email, const gchar *container, S
if (msg && length && atoi (length) > 0) {
len = atoi (length);
- item->priv->message = g_base64_decode (msg, &len);
+ item->priv->message = (gchar *) g_base64_decode (msg, &len);
if (!(item->priv->message)) {
item->priv->msg_body_id = soup_soap_parameter_get_property (part, "id");
}
@@ -2872,7 +2872,7 @@ e_gw_item_get_link_info (EGwItem *item)
}
static void
-add_return_notification (SoupSoapMessage *msg, gchar *option, EGwItemReturnNotify value)
+add_return_notification (SoupSoapMessage *msg, const gchar *option, EGwItemReturnNotify value)
{
soup_soap_message_start_element (msg, option, NULL, NULL);
@@ -2935,8 +2935,8 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
soup_soap_message_start_element (msg, "recipients", NULL, NULL);
/* add each recipient */
for (rl = recipient_list; rl != NULL; rl = rl->next) {
- gchar *dist_type;
- gchar *status = NULL;
+ const gchar *dist_type;
+ const gchar *status = NULL;
EGwItemRecipient *recipient = (EGwItemRecipient *) rl->data;
@@ -3099,7 +3099,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
if (priv->message) {
gchar *str;
- str = g_base64_encode (priv->message, strlen (priv->message));
+ str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
dtstring = g_strdup_printf ("%d", (int)strlen (str));
soup_soap_message_add_attribute (msg, "length", dtstring, NULL, NULL);
g_free (dtstring);
@@ -3287,7 +3287,7 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
gchar *str;
gchar *str_len;
- str = g_base64_encode (priv->message, strlen (priv->message));
+ str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
/*str = g_strdup (priv->message);*/
str_len = g_strdup_printf ("%d", str ? (int)strlen (str) : 0);
soup_soap_message_start_element (msg, "part", NULL, NULL);
@@ -3529,7 +3529,7 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, gint
if (priv->message) {
gchar *str, *message;
- str = g_base64_encode (priv->message, strlen (priv->message));
+ str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
message = g_strdup_printf ("%d", (int)strlen (str));
soup_soap_message_add_attribute (msg, "length", message, NULL, NULL);
g_free (message);
diff --git a/servers/groupwise/e-gw-sendoptions.c b/servers/groupwise/e-gw-sendoptions.c
index b37a5fc..15be5cb 100644
--- a/servers/groupwise/e-gw-sendoptions.c
+++ b/servers/groupwise/e-gw-sendoptions.c
@@ -437,7 +437,7 @@ e_gw_sendoptions_store_settings (SoupSoapParameter *param, EGwSendOptions *opts)
}
static void
-e_gw_sendoptions_write_settings (SoupSoapMessage *msg, gchar *field_name, gchar *value, gchar *value_name, gboolean value_direct)
+e_gw_sendoptions_write_settings (SoupSoapMessage *msg, const gchar *field_name, const gchar *value, const gchar *value_name, gboolean value_direct)
{
soup_soap_message_start_element (msg, "setting", NULL, NULL);
@@ -458,7 +458,7 @@ e_gw_sendoptions_write_settings (SoupSoapMessage *msg, gchar *field_name, gchar
}
static void
-set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts, gchar *comp)
+set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts, const gchar *comp)
{
gchar *value, *comp_name = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]