diff options
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 106 | ||||
-rw-r--r-- | addressbook/gui/component/autocompletion-config.c | 2 | ||||
-rw-r--r-- | addressbook/gui/component/e-book-shell-migrate.c | 126 | ||||
-rw-r--r-- | addressbook/gui/component/eab-composer-util.c | 6 | ||||
-rw-r--r-- | addressbook/gui/component/openldap-extract.h | 190 |
5 files changed, 215 insertions, 215 deletions
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index c786a40a13..e753351755 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -70,8 +70,8 @@ #define GLADE_FILE_NAME "ldap-config.glade" -GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2, - int num1, int num2); +GtkWidget* supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, + gint num1, gint num2); /* default objectclasses */ #define TOP "top" @@ -147,7 +147,7 @@ ldap_unparse_auth (AddressbookLDAPAuthType auth_type) } static AddressbookLDAPAuthType -ldap_parse_auth (const char *auth) +ldap_parse_auth (const gchar *auth) { if (!auth) return ADDRESSBOOK_LDAP_AUTH_NONE; @@ -191,7 +191,7 @@ ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type) } static AddressbookLDAPSSLType -ldap_parse_ssl (const char *ssl) +ldap_parse_ssl (const gchar *ssl) { if (!ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */ @@ -204,7 +204,7 @@ ldap_parse_ssl (const char *ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; } -static const char * +static const gchar * ldap_get_ssl_tooltip (AddressbookLDAPSSLType ssl_type) { switch (ssl_type) { @@ -266,8 +266,8 @@ addressbook_ldap_init (GtkWidget *window, ESource *source) LDAP *ldap; gchar *host; gint port; - int ldap_error; - int protocol_version = LDAP_VERSION3; + gint ldap_error; + gint protocol_version = LDAP_VERSION3; if (!source_to_uri_parts (source, &host, NULL, NULL, NULL, &port)) return NULL; @@ -305,7 +305,7 @@ static int addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, const gchar **attrs, LDAPMessage **resp) { - int ldap_error; + gint ldap_error; struct timeval timeout; timeout.tv_sec = (gint) gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment); @@ -323,7 +323,7 @@ addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, /* searching page */ GtkWidget* -supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2) +supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, gint num1, gint num2) { GtkWidget *table, *scrolled; GtkTreeSelection *selection; @@ -354,10 +354,10 @@ do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkListStore *model, E { LDAP *ldap; const gchar *attrs[2]; - int ldap_error; - char **values; + gint ldap_error; + gchar **values; LDAPMessage *resp; - int i; + gint i; ldap = addressbook_ldap_init (sdialog->window, source); if (!ldap) @@ -414,7 +414,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) GtkWidget *supported_bases_table; GladeXML *gui; GtkTreeIter iter; - char *gladefile; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, @@ -445,7 +445,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK && gtk_tree_selection_get_selected (selection, &model, &iter)) { - char *dn; + gchar *dn; gtk_tree_model_get (model, &iter, 0, &dn, -1); gtk_entry_set_text((GtkEntry *)sdialog->rootdn, dn); @@ -469,7 +469,7 @@ addressbook_config_create_new_source (GtkWidget *parent) static void eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) { - int id = gtk_combo_box_get_active(dropdown); + gint id = gtk_combo_box_get_active(dropdown); GtkTreeModel *model; GtkTreeIter iter; @@ -489,7 +489,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "groupwise:", 10)) { GSList *l; ESource *source; - char *tmp; + gchar *tmp; l = e_source_group_peek_sources(sdialog->source_group); if (l && l->data ) { @@ -505,7 +505,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) g_free (tmp); #ifdef HAVE_LDAP } else if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "ldap:", 5)) { - char *tmp; + gchar *tmp; tmp = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s", "", LDAP_PORT_STRING, @@ -524,7 +524,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkComboBox *dropdown; @@ -533,7 +533,7 @@ eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str GtkTreeIter iter; GSList *l; GtkWidget *w, *label; - int i, row = 0; + gint i, row = 0; if (old) return old; @@ -590,13 +590,13 @@ offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *uri; + const gchar *uri; GtkWidget *w; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (old) return old; @@ -629,11 +629,11 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static GtkWidget * -eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *offline_setting; - const char *offline_sync; + const gchar *offline_sync; gboolean is_local_book; is_local_book = g_str_has_prefix (e_source_group_peek_base_uri (sdialog->source_group), "file:"); @@ -696,7 +696,7 @@ host_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *port = gtk_entry_get_text((GtkEntry *)w); + const gchar *port = gtk_entry_get_text((GtkEntry *)w); if (!strcmp (port, LDAPS_PORT_STRING)) { sdialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS; @@ -720,15 +720,15 @@ ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static GtkWidget * -eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *tmp; + const gchar *tmp; GtkWidget *w; - char *uri, port[16]; + gchar *uri, port[16]; LDAPURLDesc *lud; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -778,7 +778,7 @@ eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static void auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *principal = gtk_entry_get_text((GtkEntry *)w); + const gchar *principal = gtk_entry_get_text((GtkEntry *)w); /* seems messy ... but the api is */ switch (sdialog->auth) { @@ -809,13 +809,13 @@ auth_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -878,14 +878,14 @@ scope_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; LDAPURLDesc *lud; - char *uri; + gchar *uri; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -946,7 +946,7 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s static void timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char *timeout; + gchar *timeout; timeout = g_strdup_printf("%f", gtk_adjustment_get_value(((GtkRange *)sdialog->timeout_scale)->adjustment)); e_source_set_property(sdialog->source, "timeout", timeout); @@ -956,7 +956,7 @@ timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void limit_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char limit[16]; + gchar limit[16]; sprintf(limit, "%d", gtk_spin_button_get_value_as_int((GtkSpinButton *)sdialog->limit_spinbutton)); e_source_set_property(sdialog->source, "limit", limit); @@ -972,13 +972,13 @@ canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source) } static GtkWidget * -eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -1040,18 +1040,18 @@ static EConfigItem eabc_new_items[] = { }; static void -eabc_commit(EConfig *ec, GSList *items, void *data) +eabc_commit(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; xmlNodePtr xml; #if d(!)0 - char *txt; + gchar *txt; #endif if (sdialog->original_source) { d(printf("committing addressbook changes\n")); /* these api's kinda suck */ - xml = xmlNewNode(NULL, (const unsigned char *)"dummy"); + xml = xmlNewNode(NULL, (const guchar *)"dummy"); e_source_dump_to_xml_node(sdialog->source, xml); e_source_update_from_xml_node(sdialog->original_source, xml->children, NULL); xmlFreeNode(xml); @@ -1074,7 +1074,7 @@ eabc_commit(EConfig *ec, GSList *items, void *data) } static void -eabc_free(EConfig *ec, GSList *items, void *data) +eabc_free(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; @@ -1093,11 +1093,11 @@ eabc_free(EConfig *ec, GSList *items, void *data) } static gboolean -eabc_check_complete(EConfig *ec, const char *pageid, void *data) +eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data) { AddressbookSourceDialog *sdialog = data; - int valid = TRUE; - const char *tmp; + gint valid = TRUE; + const gchar *tmp; ESource *source; d(printf("check complete, pageid = '%s'\n", pageid?pageid:"<all>")); @@ -1109,7 +1109,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) #ifdef HAVE_LDAP if (valid && source_group_is_remote(sdialog->source_group)) { - char *uri = e_source_get_uri(sdialog->source); + gchar *uri = e_source_get_uri(sdialog->source); LDAPURLDesc *lud; /* check host and port set */ @@ -1153,7 +1153,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) static void source_changed(ESource *source, AddressbookSourceDialog *sdialog) { - char *xml; + gchar *xml; xml = e_source_to_standalone_xml(source); printf("source changed:\n%s\n", xml); @@ -1166,11 +1166,11 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) { AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); EABConfig *ec; - int i; + gint i; GSList *items = NULL; EABConfigTargetSource *target; - char *xml; - char *gladefile; + gchar *xml; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 548c0cbd7e..370c1a1e7e 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -82,7 +82,7 @@ initialize_selection (ESourceSelector *source_selector) for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); - const char *completion; + const gchar *completion; completion = e_source_get_property (source, "completion"); if (completion && !g_ascii_strcasecmp (completion, "true")) diff --git a/addressbook/gui/component/e-book-shell-migrate.c b/addressbook/gui/component/e-book-shell-migrate.c index 2c9aa6afb0..4ac70309e7 100644 --- a/addressbook/gui/component/e-book-shell-migrate.c +++ b/addressbook/gui/component/e-book-shell-migrate.c @@ -108,7 +108,7 @@ dialog_close (MigrationContext *context) } static void -dialog_set_label (MigrationContext *context, const char *str) +dialog_set_label (MigrationContext *context, const gchar *str) { gtk_label_set_text (GTK_LABEL (context->label), str); @@ -121,9 +121,9 @@ dialog_set_label (MigrationContext *context, const char *str) } static void -dialog_set_folder_name (MigrationContext *context, const char *folder_name) +dialog_set_folder_name (MigrationContext *context, const gchar *folder_name) { - char *text; + gchar *text; text = g_strdup_printf (_("Migrating '%s':"), folder_name); gtk_label_set_text (GTK_LABEL (context->folder_label), text); @@ -142,7 +142,7 @@ dialog_set_folder_name (MigrationContext *context, const char *folder_name) static void dialog_set_progress (MigrationContext *context, double percent) { - char text[5]; + gchar text[5]; snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); @@ -158,7 +158,7 @@ dialog_set_progress (MigrationContext *context, double percent) } static gboolean -check_for_conflict (ESourceGroup *group, char *name) +check_for_conflict (ESourceGroup *group, gchar *name) { GSList *sources; GSList *s; @@ -175,16 +175,16 @@ check_for_conflict (ESourceGroup *group, char *name) return FALSE; } -static char * -get_source_name (ESourceGroup *group, const char *path) +static gchar * +get_source_name (ESourceGroup *group, const gchar *path) { #ifndef G_OS_WIN32 - char **p = g_strsplit (path, "/", 0); + gchar **p = g_strsplit (path, "/", 0); #else - char **p = g_strsplit_set (path, "\\/", 0); + gchar **p = g_strsplit_set (path, "\\/", 0); #endif - int i, j, starting_index; - int num_elements; + gint i, j, starting_index; + gint num_elements; gboolean conflict; GString *s = g_string_new (""); @@ -229,8 +229,8 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) { EBookQuery *query = e_book_query_any_field_contains (""); GList *l, *contacts; - int num_added = 0; - int num_contacts; + gint num_added = 0; + gint num_contacts; /* both books are loaded, start the actual migration */ e_book_get_contacts (old_book, query, &contacts, NULL); @@ -343,7 +343,7 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) "OTHER"); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { /* k, this is the nasty part. we glomb all the value strings back together again (if there is more than one), then work our magic */ @@ -383,9 +383,9 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) } static void -migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESource *new_source) +migrate_contact_folder_to_source (MigrationContext *context, gchar *old_path, ESource *new_source) { - char *old_uri = g_filename_to_uri (old_path, NULL, NULL); + gchar *old_uri = g_filename_to_uri (old_path, NULL, NULL); GError *e = NULL; EBook *old_book = NULL, *new_book = NULL; @@ -425,7 +425,7 @@ migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESo } static void -migrate_contact_folder (MigrationContext *context, char *old_path, ESourceGroup *dest_group, char *source_name) +migrate_contact_folder (MigrationContext *context, gchar *old_path, ESourceGroup *dest_group, gchar *source_name) { ESource *new_source; @@ -451,7 +451,7 @@ create_groups (MigrationContext *context, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; *on_this_computer = NULL; *on_ldap_servers = NULL; @@ -528,9 +528,9 @@ create_groups (MigrationContext *context, static gboolean migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer, ESource *personal_source) { - char *old_path = NULL; + gchar *old_path = NULL; GSList *dirs, *l; - char *local_contact_folder = NULL; + gchar *local_contact_folder = NULL; old_path = g_strdup_printf ("%s/evolution/local", g_get_home_dir ()); @@ -542,15 +542,15 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer NULL); for (l = dirs; l; l = l->next) { - char *source_name; + gchar *source_name; /* we handle the system folder differently */ - if (personal_source && !strcmp ((char*)l->data, local_contact_folder)) { + if (personal_source && !strcmp ((gchar *)l->data, local_contact_folder)) { g_hash_table_insert (context->folder_uid_map, g_strdup (l->data), g_strdup (e_source_peek_uid (personal_source))); migrate_contact_folder_to_source (context, local_contact_folder, personal_source); continue; } - source_name = get_source_name (on_this_computer, (char*)l->data); + source_name = get_source_name (on_this_computer, (gchar *)l->data); migrate_contact_folder (context, l->data, on_this_computer, source_name); g_free (source_name); } @@ -563,13 +563,13 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer return TRUE; } -static char * +static gchar * get_string_child (xmlNode *node, - const char *name) + const gchar *name) { xmlNode *p; xmlChar *xml_string; - char *retval; + gchar *retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -580,7 +580,7 @@ get_string_child (xmlNode *node, return g_strdup(""); xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = g_strdup ((char *) xml_string); + retval = g_strdup ((gchar *) xml_string); xmlFree (xml_string); return retval; @@ -588,12 +588,12 @@ get_string_child (xmlNode *node, static int get_integer_child (xmlNode *node, - const char *name, - int defval) + const gchar *name, + gint defval) { xmlNode *p; xmlChar *xml_string; - int retval; + gint retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -604,7 +604,7 @@ get_integer_child (xmlNode *node, return defval; xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = atoi ((char *)xml_string); + retval = atoi ((gchar *)xml_string); xmlFree (xml_string); return retval; @@ -613,7 +613,7 @@ get_integer_child (xmlNode *node, static gboolean migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) { - char *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", + gchar *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", g_get_home_dir ()); printf ("trying to migrate from %s\n", sources_xml); @@ -622,14 +622,14 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) xmlDoc *doc = xmlParseFile (sources_xml); xmlNode *root; xmlNode *child; - int num_contactservers; - int servernum; + gint num_contactservers; + gint servernum; if (!doc) return FALSE; root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "addressbooks") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "addressbooks") != 0) { xmlFreeDoc (doc); return FALSE; } @@ -637,7 +637,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) /* count the number of servers, so we can give progress */ num_contactservers = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { + if (!strcmp ((const gchar *)child->name, "contactserver")) { num_contactservers++; } } @@ -647,11 +647,11 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) servernum = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { - char *port, *host, *rootdn, *scope, *authmethod, *ssl; - char *emailaddr, *binddn, *limitstr; - int limit; - char *name, *description; + if (!strcmp ((const gchar *)child->name, "contactserver")) { + gchar *port, *host, *rootdn, *scope, *authmethod, *ssl; + gchar *emailaddr, *binddn, *limitstr; + gint limit; + gchar *name, *description; GString *uri = g_string_new (""); ESource *source; @@ -711,7 +711,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) } static ESource* -get_source_by_name (ESourceList *source_list, const char *name) +get_source_by_name (ESourceList *source_list, const gchar *name) { GSList *groups; GSList *g; @@ -731,7 +731,7 @@ get_source_by_name (ESourceList *source_list, const char *name) for (s = sources; s; s = s->next) { ESource *source = E_SOURCE (s->data); - const char *source_name = e_source_peek_name (source); + const gchar *source_name = e_source_peek_name (source); if (!strcmp (name, source_name)) return source; @@ -766,14 +766,14 @@ migrate_completion_folders (MigrationContext *context) dialog_set_folder_name (context, _("Autocompletion Settings")); root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "EvolutionFolderList") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "EvolutionFolderList") != 0) { xmlFreeDoc (doc); return FALSE; } for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "folder")) { - char *physical_uri = e_xml_get_string_prop_by_name (child, (const unsigned char *)"physical-uri"); + if (!strcmp ((const gchar *)child->name, "folder")) { + gchar *physical_uri = e_xml_get_string_prop_by_name (child, (const guchar *)"physical-uri"); ESource *source = NULL; /* if the physical uri is file://... @@ -788,8 +788,8 @@ migrate_completion_folders (MigrationContext *context) for the uri. */ if (!strncmp (physical_uri, "file://", 7)) { - char *filename = g_filename_from_uri (physical_uri, NULL, NULL); - char *uid = NULL; + gchar *filename = g_filename_from_uri (physical_uri, NULL, NULL); + gchar *uid = NULL; if (filename) uid = g_hash_table_lookup (context->folder_uid_map, @@ -799,7 +799,7 @@ migrate_completion_folders (MigrationContext *context) source = e_source_list_peek_source_by_uid (context->source_list, uid); } else { - char *name = e_xml_get_string_prop_by_name (child, (const unsigned char *)"display-name"); + gchar *name = e_xml_get_string_prop_by_name (child, (const guchar *)"display-name"); source = get_source_by_name (context->source_list, name); @@ -838,14 +838,14 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate contact lists for source %s", uri); g_free (uri); continue; @@ -869,8 +869,8 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup GList *v = e_vcard_attribute_get_values (a); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { - EDestination *dest = e_destination_import ((char*)v->data); + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { + EDestination *dest = e_destination_import ((gchar *)v->data); e_destination_export_to_vcard_attribute (dest, a); @@ -913,14 +913,14 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate company phone numbers for source %s", uri); g_free (uri); continue; @@ -937,7 +937,7 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup GError *e = NULL; GList *attrs, *attr; gboolean converted = FALSE; - int num_work_voice = 0; + gint num_work_voice = 0; attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr;) { @@ -1006,11 +1006,11 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup } static void -migrate_pilot_data (const char *old_path, const char *new_path) +migrate_pilot_data (const gchar *old_path, const gchar *new_path) { - const char *dent; - const char *ext; - char *filename; + const gchar *dent; + const gchar *ext; + gchar *filename; GDir *dir; if (!(dir = g_dir_open (old_path, 0, NULL))) @@ -1022,9 +1022,9 @@ migrate_pilot_data (const char *old_path, const char *new_path) (!strncmp (dent, "pilot-sync-evolution-addressbook-", 33) && ((ext = strrchr (dent, '.')) && !strcmp (ext, ".db")))) { /* src and dest file formats are identical for both map and changelog files */ - unsigned char inbuf[4096]; + guchar inbuf[4096]; size_t nread, nwritten; - int fd0, fd1; + gint fd0, fd1; ssize_t n; filename = g_build_filename (old_path, dent, NULL); @@ -1181,7 +1181,7 @@ e_book_shell_backend_migrate (EShellBackend *shell_backend, } if (minor < 5 || (minor == 5 && micro <= 10)) { - char *old_path, *new_path; + gchar *old_path, *new_path; dialog_set_label (context, _("Evolution's Palm Sync changelog and map files have changed.\n\n" "Please be patient while Evolution migrates your Pilot Sync data...")); diff --git a/addressbook/gui/component/eab-composer-util.c b/addressbook/gui/component/eab-composer-util.c index 46d28b0790..6d45f13a94 100644 --- a/addressbook/gui/component/eab-composer-util.c +++ b/addressbook/gui/component/eab-composer-util.c @@ -89,11 +89,11 @@ eab_send_as_to (GList *destinations) gtk_widget_show (GTK_WIDGET (composer)); } -static const char * +static const gchar * get_email (EContact *contact, EContactField field_id, gchar **to_free) { - char *name = NULL, *mail = NULL; - const char *value = e_contact_get_const (contact, field_id); + gchar *name = NULL, *mail = NULL; + const gchar *value = e_contact_get_const (contact, field_id); *to_free = NULL; diff --git a/addressbook/gui/component/openldap-extract.h b/addressbook/gui/component/openldap-extract.h index 010589da1e..083fc0d162 100644 --- a/addressbook/gui/component/openldap-extract.h +++ b/addressbook/gui/component/openldap-extract.h @@ -48,7 +48,7 @@ #define LDAP_CALLOC(n,s) calloc((n),(s)) #define LDAP_REALLOC(p,s) realloc((p),(s)) #define LDAP_FREE(p) free((p)) -#define LDAP_VFREE(p) vfree((void **)(p)) +#define LDAP_VFREE(p) vfree((gpointer *)(p)) #define LDAP_STRDUP(s) strdup((s)) #define LDAP_RANGE(n,x,y) (((x) <= (n)) && ((n) <= (y))) @@ -87,21 +87,21 @@ #define LDAP_SCHEMA_SKIP 0x80U /* Don't malloc any result */ typedef struct ldap_objectclass { - char *oc_oid; /* REQUIRED */ - char **oc_names; /* OPTIONAL */ - char *oc_desc; /* OPTIONAL */ - int oc_obsolete; /* 0=no, 1=yes */ - char **oc_sup_oids; /* OPTIONAL */ - int oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ - char **oc_at_oids_must; /* OPTIONAL */ - char **oc_at_oids_may; /* OPTIONAL */ + gchar *oc_oid; /* REQUIRED */ + gchar **oc_names; /* OPTIONAL */ + gchar *oc_desc; /* OPTIONAL */ + gint oc_obsolete; /* 0=no, 1=yes */ + gchar **oc_sup_oids; /* OPTIONAL */ + gint oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ + gchar **oc_at_oids_must; /* OPTIONAL */ + gchar **oc_at_oids_may; /* OPTIONAL */ } LDAPObjectClass; static void -vfree(void **vec) +vfree(gpointer *vec) { - int i; + gint i; for (i = 0; vec[i] != NULL; i++) free(vec[i]); @@ -143,17 +143,17 @@ vfree(void **vec) #define TK_QDESCR TK_QDSTRING struct token { - int type; - char *sval; + gint type; + gchar *sval; }; static int -get_token( const char ** sp, char ** token_val ) +get_token( const gchar ** sp, gchar ** token_val ) { - int kind; - const char * p; - const char * q; - char * res; + gint kind; + const gchar * p; + const gchar * q; + gchar * res; *token_val = NULL; switch (**sp) { @@ -223,20 +223,20 @@ get_token( const char ** sp, char ** token_val ) /* Gobble optional whitespace */ static void -parse_whsp(const char **sp) +parse_whsp(const gchar **sp) { while (LDAP_SPACE(**sp)) (*sp)++; } /* Parse a sequence of dot-separated decimal strings */ -static char * -ldap_int_parse_numericoid(const char **sp, int *code, const int flags) +static gchar * +ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags) { - char * res = NULL; - const char * start = *sp; - int len; - int quoted = 0; + gchar * res = NULL; + const gchar * start = *sp; + gint len; + gint quoted = 0; /* Netscape puts the SYNTAX value in quotes (incorrectly) */ if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && **sp == '\'' ) { @@ -248,7 +248,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) while (**sp) { if ( !LDAP_DIGIT(**sp) ) { /* - * Initial char is not a digit or char after dot is + * Initial gchar is not a digit or gchar after dot is * not a digit */ *code = LDAP_SCHERR_NODIGIT; @@ -262,7 +262,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) /* Otherwise, gobble the dot and loop again */ (*sp)++; } - /* Now *sp points at the char past the numericoid. Perfect. */ + /* Now *sp points at the gchar past the numericoid. Perfect. */ len = *sp - start; if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && quoted ) { if ( **sp == '\'' ) { @@ -273,7 +273,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } } if (flags & LDAP_SCHEMA_SKIP) { - res = (char *)start; + res = (gchar *)start; } else { res = LDAP_MALLOC(len+1); if (!res) { @@ -287,22 +287,22 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } /* Parse a qdescr or a list of them enclosed in () */ -static char ** -parse_qdescrs(const char **sp, int *code) +static gchar ** +parse_qdescrs(const gchar **sp, gint *code) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; parse_whsp(sp); kind = get_token(sp,&sval); if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -316,7 +316,7 @@ parse_qdescrs(const char **sp, int *code) if ( kind == TK_QDESCR ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_VFREE(res); LDAP_FREE(sval); @@ -338,7 +338,7 @@ parse_qdescrs(const char **sp, int *code) parse_whsp(sp); return(res); } else if ( kind == TK_QDESCR ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -355,15 +355,15 @@ parse_qdescrs(const char **sp, int *code) } /* Parse a woid or a $-separated list of them enclosed in () */ -static char ** -parse_oids(const char **sp, int *code, const int allow_quoted) +static gchar ** +parse_oids(const gchar **sp, gint *code, const gint allow_quoted) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; /* * Strictly speaking, doing this here accepts whsp before the @@ -376,7 +376,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -407,7 +407,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) kind == TK_QDSTRING ) ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_FREE(sval); LDAP_VFREE(res); @@ -436,7 +436,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) return(res); } else if ( kind == TK_BAREWORD || ( allow_quoted && kind == TK_QDSTRING ) ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { LDAP_FREE(sval); *code = LDAP_SCHERR_OUTOFMEM; @@ -466,24 +466,24 @@ ldap_objectclass_free(LDAPObjectClass * oc) } static LDAPObjectClass * -ldap_str2objectclass( LDAP_CONST char * s, - int * code, - LDAP_CONST char ** errp, +ldap_str2objectclass( LDAP_CONST gchar * s, + gint * code, + LDAP_CONST gchar ** errp, LDAP_CONST unsigned flags ) { - int kind; - const char * ss = s; - char * sval; - int seen_name = 0; - int seen_desc = 0; - int seen_obsolete = 0; - int seen_sup = 0; - int seen_kind = 0; - int seen_must = 0; - int seen_may = 0; + gint kind; + const gchar * ss = s; + gchar * sval; + gint seen_name = 0; + gint seen_desc = 0; + gint seen_obsolete = 0; + gint seen_sup = 0; + gint seen_kind = 0; + gint seen_must = 0; + gint seen_may = 0; LDAPObjectClass * oc; - char ** ext_vals; - const char * savepos; + gchar ** ext_vals; + const gchar * savepos; if ( !s ) { *code = LDAP_SCHERR_EMPTY; @@ -539,7 +539,7 @@ ldap_str2objectclass( LDAP_CONST char * s, } else if ( flags & LDAP_SCHEMA_ALLOW_OID_MACRO ) { /* Non-numerical OID, ignore */ - int len = ss-savepos; + gint len = ss-savepos; oc->oc_oid = LDAP_MALLOC(len+1); strncpy(oc->oc_oid, savepos, len); oc->oc_oid[len] = 0; @@ -741,21 +741,21 @@ ldap_str2objectclass( LDAP_CONST char * s, #define LDAP_UTF8_INCR(p) ((p)=LDAP_UTF8_NEXT((p))) #define ldap_x_utf8_to_ucs4(str) g_utf8_get_char(str) -static char *ldap_utf8_strchr( const char *str, const char *chr ) +static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr ) { for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) { if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) { - return (char *) str; + return (gchar *) str; } } return NULL; } -static size_t ldap_utf8_strcspn( const char *str, const char *set ) +static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset) ) { @@ -768,10 +768,10 @@ static size_t ldap_utf8_strcspn( const char *str, const char *set ) return cstr - str; } -static size_t ldap_utf8_strspn( const char *str, const char *set ) +static size_t ldap_utf8_strspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; ; LDAP_UTF8_INCR(cset) ) { @@ -788,10 +788,10 @@ static size_t ldap_utf8_strspn( const char *str, const char *set ) return cstr - str; } -static char *ldap_utf8_strtok(char *str, const char *sep, char **last) +static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last) { - char *begin; - char *end; + gchar *begin; + gchar *end; if( last == NULL ) return NULL; @@ -807,7 +807,7 @@ static char *ldap_utf8_strtok(char *str, const char *sep, char **last) end = &begin[ ldap_utf8_strcspn( begin, sep ) ]; if( *end != '\0' ) { - char *next = LDAP_UTF8_NEXT( end ); + gchar *next = LDAP_UTF8_NEXT( end ); *end = '\0'; end = next; } @@ -856,17 +856,17 @@ typedef struct ldap_url_desc { /* from url.c */ -static const char* +static const gchar * skip_url_prefix( - const char *url, - int *enclosedp, - const char **scheme ) + const gchar *url, + gint *enclosedp, + const gchar **scheme ) { /* * return non-zero if this looks like a LDAP URL; zero if not * if non-zero returned, *urlp will be moved past "ldap://" part of URL */ - const char *p; + const gchar *p; if ( url == NULL ) { return( NULL ); @@ -924,7 +924,7 @@ skip_url_prefix( return( NULL ); } -static int str2scope( const char *p ) +static gint str2scope( const gchar *p ) { if ( strcasecmp( p, "one" ) == 0 ) { return LDAP_SCOPE_ONELEVEL; @@ -980,7 +980,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp ) } static int -ldap_int_unhex( int c ) +ldap_int_unhex( gint c ) { return( c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 @@ -988,7 +988,7 @@ ldap_int_unhex( int c ) } static void -ldap_pvt_hex_unescape( char *s ) +ldap_pvt_hex_unescape( gchar *s ) { /* * Remove URL hex escapes from s... done in place. The basic concept for @@ -1014,8 +1014,8 @@ ldap_pvt_hex_unescape( char *s ) *p = '\0'; } -static char ** -ldap_str2charray( const char *str_in, const char *brkstr ) +static gchar ** +ldap_str2charray( const gchar *str_in, const gchar *brkstr ) { char **res; char *str, *s; @@ -1035,7 +1035,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } } - res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) ); + res = (gchar **) LDAP_MALLOC( (i + 1) * sizeof(gchar *) ); if( res == NULL ) { LDAP_FREE( str ); @@ -1069,7 +1069,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } static int -ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { /* * Pick apart the pieces of an LDAP URL. @@ -1078,9 +1078,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) LDAPURLDesc *ludp; char *p, *q, *r; int i, enclosed; - const char *scheme = NULL; - const char *url_tmp; - char *url; + const gchar *scheme = NULL; + const gchar *url_tmp; + gchar *url; if( url_in == NULL || ludpp == NULL ) { return LDAP_URL_ERR_PARAM; @@ -1393,9 +1393,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) } static int -ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { - int rc = ldap_url_parse_ext( url_in, ludpp ); + gint rc = ldap_url_parse_ext( url_in, ludpp ); if( rc != LDAP_URL_SUCCESS ) { return rc; |