aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'modules/addressbook')
-rw-r--r--modules/addressbook/addressbook-config.c276
-rw-r--r--modules/addressbook/e-book-shell-content.h3
-rw-r--r--modules/addressbook/e-book-shell-sidebar.h3
-rw-r--r--modules/addressbook/openldap-extract.h530
4 files changed, 407 insertions, 405 deletions
diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c
index 7d398f855d..b275590cf5 100644
--- a/modules/addressbook/addressbook-config.c
+++ b/modules/addressbook/addressbook-config.c
@@ -372,7 +372,7 @@ search_base_selection_model_changed (GtkTreeSelection *selection, GtkWidget *dia
{
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
- gtk_tree_selection_get_selected(selection, NULL, NULL));
+ gtk_tree_selection_get_selected (selection, NULL, NULL));
}
static void
@@ -416,8 +416,8 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog)
gchar *dn;
gtk_tree_model_get (model, &iter, 0, &dn, -1);
- gtk_entry_set_text((GtkEntry *)sdialog->rootdn, dn);
- g_free(dn);
+ gtk_entry_set_text ((GtkEntry *)sdialog->rootdn, dn);
+ g_free (dn);
}
}
@@ -429,28 +429,28 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog)
GtkWidget*
addressbook_config_create_new_source (GtkWidget *parent)
{
- return addressbook_config_edit_source(parent, NULL);
+ return addressbook_config_edit_source (parent, NULL);
}
/* ********************************************************************** */
static void
-eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog)
+eabc_type_changed (GtkComboBox *dropdown, AddressbookSourceDialog *sdialog)
{
- gint id = gtk_combo_box_get_active(dropdown);
+ gint id = gtk_combo_box_get_active (dropdown);
GtkTreeModel *model;
GtkTreeIter iter;
- model = gtk_combo_box_get_model(dropdown);
- if (id == -1 || !gtk_tree_model_iter_nth_child(model, &iter, NULL, id))
+ model = gtk_combo_box_get_model (dropdown);
+ if (id == -1 || !gtk_tree_model_iter_nth_child (model, &iter, NULL, id))
return;
/* TODO: when we change the group type, we lose all of the pre-filled dialog info */
- gtk_tree_model_get(model, &iter, 1, &sdialog->source_group, -1);
+ gtk_tree_model_get (model, &iter, 1, &sdialog->source_group, -1);
/* HACK: doesn't work if you don't do this */
- e_source_set_absolute_uri(sdialog->source, NULL);
- e_source_set_group(sdialog->source, sdialog->source_group);
+ e_source_set_absolute_uri (sdialog->source, NULL);
+ e_source_set_group (sdialog->source, sdialog->source_group);
/* BIG HACK: We load the defaults for each type here.
I guess plugins will have to use the do it in their factory callbacks */
@@ -459,7 +459,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog)
ESource *source;
gchar *tmp;
- l = e_source_group_peek_sources(sdialog->source_group);
+ l = e_source_group_peek_sources (sdialog->source_group);
if (l && l->data ) {
source = l->data;
e_source_set_property(sdialog->source, "auth", e_source_get_property(source, "auth"));
@@ -488,11 +488,11 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog)
e_source_set_relative_uri (sdialog->source, e_source_peek_uid (sdialog->source));
}
- e_config_target_changed((EConfig *)sdialog->config, E_CONFIG_TARGET_CHANGED_REBUILD);
+ e_config_target_changed ((EConfig *)sdialog->config, E_CONFIG_TARGET_CHANGED_REBUILD);
}
static GtkWidget *
-eabc_general_type(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_general_type (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
GtkComboBox *dropdown;
@@ -506,49 +506,49 @@ eabc_general_type(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *
if (old)
return old;
- w = gtk_hbox_new(FALSE, 6);
+ w = gtk_hbox_new (FALSE, 6);
label = gtk_label_new_with_mnemonic(_("_Type:"));
- gtk_box_pack_start((GtkBox *)w, label, FALSE, FALSE, 0);
+ gtk_box_pack_start ((GtkBox *)w, label, FALSE, FALSE, 0);
- dropdown = (GtkComboBox *)gtk_combo_box_new();
- cell = gtk_cell_renderer_text_new();
- store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+ dropdown = (GtkComboBox *)gtk_combo_box_new ();
+ cell = gtk_cell_renderer_text_new ();
+ store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
i = 0;
- for (l=sdialog->menu_source_groups;l;l=g_slist_next(l)) {
+ for (l=sdialog->menu_source_groups;l;l=g_slist_next (l)) {
ESourceGroup *group = l->data;
- gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter, 0, e_source_group_peek_name(group), 1, group, -1);
- if (e_source_peek_group(sdialog->source) == group)
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter, 0, e_source_group_peek_name (group), 1, group, -1);
+ if (e_source_peek_group (sdialog->source) == group)
row = i;
i++;
}
- gtk_cell_layout_pack_start((GtkCellLayout *)dropdown, cell, TRUE);
+ gtk_cell_layout_pack_start ((GtkCellLayout *)dropdown, cell, TRUE);
gtk_cell_layout_set_attributes((GtkCellLayout *)dropdown, cell, "text", 0, NULL);
- gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store);
- gtk_combo_box_set_active(dropdown, -1);
- gtk_combo_box_set_active(dropdown, row);
+ gtk_combo_box_set_model (dropdown, (GtkTreeModel *)store);
+ gtk_combo_box_set_active (dropdown, -1);
+ gtk_combo_box_set_active (dropdown, row);
g_signal_connect(dropdown, "changed", G_CALLBACK(eabc_type_changed), sdialog);
- gtk_widget_show((GtkWidget *)dropdown);
- gtk_box_pack_start((GtkBox *)w, (GtkWidget *)dropdown, TRUE, TRUE, 0);
- gtk_label_set_mnemonic_widget((GtkLabel *)label, (GtkWidget *)dropdown);
+ gtk_widget_show ((GtkWidget *)dropdown);
+ gtk_box_pack_start ((GtkBox *)w, (GtkWidget *)dropdown, TRUE, TRUE, 0);
+ gtk_label_set_mnemonic_widget ((GtkLabel *)label, (GtkWidget *)dropdown);
- gtk_box_pack_start((GtkBox *)parent, (GtkWidget *)w, FALSE, FALSE, 0);
+ gtk_box_pack_start ((GtkBox *)parent, (GtkWidget *)w, FALSE, FALSE, 0);
- gtk_widget_show_all(w);
+ gtk_widget_show_all (w);
return (GtkWidget *)w;
}
static void
-name_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+name_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
e_source_set_name (sdialog->source, gtk_entry_get_text (GTK_ENTRY (sdialog->display_name)));
}
static GtkWidget *
-eabc_general_name(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_general_name (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
const gchar *uri;
@@ -561,22 +561,22 @@ eabc_general_name(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "ldap-config.ui");
- w = e_builder_get_widget(builder, item->label);
- gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0);
+ w = e_builder_get_widget (builder, item->label);
+ gtk_box_pack_start ((GtkBox *)parent, w, FALSE, FALSE, 0);
sdialog->display_name = e_builder_get_widget (builder, "account-editor-display-name-entry");
g_signal_connect(sdialog->display_name, "changed", G_CALLBACK(name_changed_cb), sdialog);
- gtk_entry_set_text((GtkEntry *)sdialog->display_name, e_source_peek_name(sdialog->source));
+ gtk_entry_set_text ((GtkEntry *)sdialog->display_name, e_source_peek_name (sdialog->source));
/* Hardcoded: groupwise can't edit the name (or anything else) */
if (sdialog->original_source) {
uri = e_source_group_peek_base_uri (sdialog->source_group);
if (uri && strncmp(uri, "groupwise:", 10) == 0) {
- gtk_widget_set_sensitive (GTK_WIDGET(sdialog->display_name), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (sdialog->display_name), FALSE);
}
}
- g_object_unref(builder);
+ g_object_unref (builder);
return w;
}
@@ -623,7 +623,7 @@ offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog)
}
static GtkWidget *
-eabc_general_offline(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_general_offline (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
GtkWidget *offline_setting;
@@ -665,7 +665,7 @@ form_ldap_search_filter (GtkWidget *w)
}
static void
-url_changed(AddressbookSourceDialog *sdialog)
+url_changed (AddressbookSourceDialog *sdialog)
{
gchar *str, *search_filter;
@@ -682,15 +682,15 @@ url_changed(AddressbookSourceDialog *sdialog)
}
static void
-host_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+host_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
- url_changed(sdialog);
+ url_changed (sdialog);
}
static void
-port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+port_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
- const gchar *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;
@@ -700,11 +700,11 @@ port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
gtk_widget_set_sensitive (sdialog->ssl_combobox, TRUE);
}
- url_changed(sdialog);
+ url_changed (sdialog);
}
static void
-ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+ssl_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
sdialog->ssl = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
e_source_set_property (sdialog->source, "ssl", ldap_unparse_ssl (sdialog->ssl));
@@ -713,7 +713,7 @@ ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
}
static GtkWidget *
-eabc_general_host(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_general_host (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
const gchar *tmp;
@@ -722,19 +722,19 @@ eabc_general_host(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *
LDAPURLDesc *lud;
GtkBuilder *builder;
- if (!source_group_is_remote(sdialog->source_group))
+ if (!source_group_is_remote (sdialog->source_group))
return NULL;
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "ldap-config.ui");
- w = e_builder_get_widget(builder, item->label);
- gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0);
+ w = e_builder_get_widget (builder, item->label);
+ gtk_box_pack_start ((GtkBox *)parent, w, FALSE, FALSE, 0);
- uri = e_source_get_uri(sdialog->source);
- if (ldap_url_parse(uri, &lud) != LDAP_SUCCESS)
+ uri = e_source_get_uri (sdialog->source);
+ if (ldap_url_parse (uri, &lud) != LDAP_SUCCESS)
lud = NULL;
- g_free(uri);
+ g_free (uri);
sdialog->host = e_builder_get_widget (builder, "server-name-entry");
gtk_entry_set_text((GtkEntry *)sdialog->host, lud && lud->lud_host ? lud->lud_host : "");
@@ -760,15 +760,15 @@ eabc_general_host(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *
gtk_widget_set_sensitive (sdialog->ssl_combobox, strcmp (port, LDAPS_PORT_STRING) != 0);
g_signal_connect (sdialog->ssl_combobox, "changed", G_CALLBACK (ssl_combobox_changed_cb), sdialog);
- g_object_unref(builder);
+ g_object_unref (builder);
return w;
}
static void
-auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+auth_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
- const gchar *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) {
@@ -789,37 +789,37 @@ auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
}
static void
-auth_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+auth_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
sdialog->auth = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
e_source_set_property (sdialog->source, "auth", ldap_unparse_auth (sdialog->auth));
/* make sure the right property is set for the auth - ugh, funny api */
- auth_entry_changed_cb(sdialog->auth_principal, sdialog);
+ auth_entry_changed_cb (sdialog->auth_principal, sdialog);
}
static GtkWidget *
-eabc_general_auth(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_general_auth (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
GtkWidget *w;
const gchar *tmp;
GtkBuilder *builder;
- if (!source_group_is_remote(sdialog->source_group))
+ if (!source_group_is_remote (sdialog->source_group))
return NULL;
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "ldap-config.ui");
- w = e_builder_get_widget(builder, item->label);
- gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0);
+ w = e_builder_get_widget (builder, item->label);
+ gtk_box_pack_start ((GtkBox *)parent, w, FALSE, FALSE, 0);
sdialog->auth_combobox = e_builder_get_widget (builder, "auth-combobox");
gtk_widget_set_has_tooltip (sdialog->auth_combobox, TRUE);
gtk_widget_set_tooltip_text (sdialog->auth_combobox, _("This is the method Evolution will use to authenticate you. Note that setting this to \"Email Address\" requires anonymous access to your LDAP server."));
tmp = e_source_get_property(sdialog->source, "auth");
- sdialog->auth = tmp ? ldap_parse_auth(tmp) : ADDRESSBOOK_LDAP_AUTH_NONE;
+ sdialog->auth = tmp ? ldap_parse_auth (tmp) : ADDRESSBOOK_LDAP_AUTH_NONE;
gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->auth_combobox), sdialog->auth);
g_signal_connect (sdialog->auth_combobox, "changed", G_CALLBACK(auth_combobox_changed_cb), sdialog);
@@ -839,15 +839,15 @@ eabc_general_auth(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *
gtk_entry_set_text((GtkEntry *)sdialog->auth_principal, tmp?tmp:"");
g_signal_connect (sdialog->auth_principal, "changed", G_CALLBACK (auth_entry_changed_cb), sdialog);
- g_object_unref(builder);
+ g_object_unref (builder);
return w;
}
static void
-rootdn_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+rootdn_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
- url_changed(sdialog);
+ url_changed (sdialog);
}
static void
@@ -857,14 +857,14 @@ search_filter_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
}
static void
-scope_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+scope_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
sdialog->scope = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
- url_changed(sdialog);
+ url_changed (sdialog);
}
static GtkWidget *
-eabc_details_search(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_details_search (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
GtkWidget *w;
@@ -872,19 +872,19 @@ eabc_details_search(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget
gchar *uri;
GtkBuilder *builder;
- if (!source_group_is_remote(sdialog->source_group))
+ if (!source_group_is_remote (sdialog->source_group))
return NULL;
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "ldap-config.ui");
- w = e_builder_get_widget(builder, item->label);
- gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0);
+ w = e_builder_get_widget (builder, item->label);
+ gtk_box_pack_start ((GtkBox *)parent, w, FALSE, FALSE, 0);
- uri = e_source_get_uri(sdialog->source);
- if (ldap_url_parse(uri, &lud) != LDAP_SUCCESS)
+ uri = e_source_get_uri (sdialog->source);
+ if (ldap_url_parse (uri, &lud) != LDAP_SUCCESS)
lud = NULL;
- g_free(uri);
+ g_free (uri);
sdialog->rootdn = e_builder_get_widget (builder, "rootdn-entry");
gtk_entry_set_text((GtkEntry *)sdialog->rootdn, lud && lud->lud_dn ? lud->lud_dn : "");
@@ -915,18 +915,18 @@ eabc_details_search(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget
g_signal_connect (sdialog->search_filter, "changed", G_CALLBACK (search_filter_changed_cb), sdialog);
g_signal_connect (e_builder_get_widget(builder, "rootdn-button"), "clicked",
- G_CALLBACK(query_for_supported_bases), sdialog);
+ G_CALLBACK (query_for_supported_bases), sdialog);
if (lud)
ldap_free_urldesc (lud);
- g_object_unref(builder);
+ g_object_unref (builder);
return w;
}
static void
-timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+timeout_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
GtkAdjustment *adjustment;
GtkRange *range;
@@ -936,11 +936,11 @@ timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
adjustment = gtk_range_get_adjustment (range);
timeout = g_strdup_printf("%f", gtk_adjustment_get_value (adjustment));
e_source_set_property(sdialog->source, "timeout", timeout);
- g_free(timeout);
+ g_free (timeout);
}
static void
-limit_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
+limit_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog)
{
gchar limit[16];
@@ -958,7 +958,7 @@ canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source)
}
static GtkWidget *
-eabc_details_limit(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
+eabc_details_limit (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
GtkAdjustment *adjustment;
@@ -967,34 +967,34 @@ eabc_details_limit(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget
const gchar *tmp;
GtkBuilder *builder;
- if (!source_group_is_remote(sdialog->source_group))
+ if (!source_group_is_remote (sdialog->source_group))
return NULL;
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "ldap-config.ui");
- w = e_builder_get_widget(builder, item->label);
- gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0);
+ w = e_builder_get_widget (builder, item->label);
+ gtk_box_pack_start ((GtkBox *)parent, w, FALSE, FALSE, 0);
sdialog->timeout_scale = e_builder_get_widget (builder, "timeout-scale");
range = GTK_RANGE (sdialog->timeout_scale);
adjustment = gtk_range_get_adjustment (range);
tmp = e_source_get_property(sdialog->source, "timeout");
- gtk_adjustment_set_value (adjustment, tmp?g_strtod(tmp, NULL):3.0);
+ gtk_adjustment_set_value (adjustment, tmp?g_strtod (tmp, NULL):3.0);
g_signal_connect (
adjustment, "value_changed",
G_CALLBACK (timeout_changed_cb), sdialog);
sdialog->limit_spinbutton = e_builder_get_widget (builder, "download-limit-spinbutton");
tmp = e_source_get_property(sdialog->source, "limit");
- gtk_spin_button_set_value((GtkSpinButton *)sdialog->limit_spinbutton, tmp?g_strtod(tmp, NULL):100.0);
+ gtk_spin_button_set_value ((GtkSpinButton *)sdialog->limit_spinbutton, tmp?g_strtod (tmp, NULL):100.0);
g_signal_connect (sdialog->limit_spinbutton, "value_changed", G_CALLBACK (limit_changed_cb), sdialog);
sdialog->canbrowsecheck = e_builder_get_widget (builder, "canbrowsecheck");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sdialog->canbrowsecheck), e_source_get_property (sdialog->source, "can-browse") && strcmp (e_source_get_property (sdialog->source, "can-browse"), "1") == 0);
g_signal_connect (sdialog->canbrowsecheck, "toggled", G_CALLBACK (canbrowse_toggled_cb), sdialog->source);
- g_object_unref(builder);
+ g_object_unref (builder);
return w;
}
@@ -1029,7 +1029,7 @@ static EConfigItem eabc_new_items[] = {
};
static void
-eabc_commit(EConfig *ec, GSList *items, gpointer data)
+eabc_commit (EConfig *ec, GSList *items, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
xmlNodePtr xml;
@@ -1041,48 +1041,48 @@ eabc_commit(EConfig *ec, GSList *items, gpointer data)
/* these api's kinda suck */
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);
+ e_source_dump_to_xml_node (sdialog->source, xml);
+ e_source_update_from_xml_node (sdialog->original_source, xml->children, NULL);
+ xmlFreeNode (xml);
#if d(!)0
- txt = e_source_to_standalone_xml(sdialog->original_source);
+ txt = e_source_to_standalone_xml (sdialog->original_source);
printf("source is now:\n%s\n", txt);
- g_free(txt);
+ g_free (txt);
#endif
} else {
d(printf("committing new source\n"));
- e_source_group_add_source(sdialog->source_group, sdialog->source, -1);
- e_source_list_sync(sdialog->source_list, NULL);
+ e_source_group_add_source (sdialog->source_group, sdialog->source, -1);
+ e_source_list_sync (sdialog->source_list, NULL);
}
#if d(!)0
- txt = e_source_to_standalone_xml(sdialog->source);
+ txt = e_source_to_standalone_xml (sdialog->source);
printf("running source is now:\n%s\n", txt);
- g_free(txt);
+ g_free (txt);
#endif
}
static void
-eabc_free(EConfig *ec, GSList *items, gpointer data)
+eabc_free (EConfig *ec, GSList *items, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
- g_slist_free(items);
+ g_slist_free (items);
- g_object_unref(sdialog->source);
+ g_object_unref (sdialog->source);
if (sdialog->original_source)
- g_object_unref(sdialog->original_source);
+ g_object_unref (sdialog->original_source);
if (sdialog->source_list)
- g_object_unref(sdialog->source_list);
- g_slist_free(sdialog->menu_source_groups);
+ g_object_unref (sdialog->source_list);
+ g_slist_free (sdialog->menu_source_groups);
- g_object_unref(sdialog->builder);
+ g_object_unref (sdialog->builder);
- g_free(sdialog);
+ g_free (sdialog);
}
static gboolean
-eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data)
+eabc_check_complete (EConfig *ec, const gchar *pageid, gpointer data)
{
AddressbookSourceDialog *sdialog = data;
gint valid = TRUE;
@@ -1091,29 +1091,29 @@ eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data)
d(printf("check complete, pageid = '%s'\n", pageid?pageid:"<all>"));
/* have name, and unique */
- tmp = e_source_peek_name(sdialog->source);
+ tmp = e_source_peek_name (sdialog->source);
valid = tmp && tmp[0] != 0
- && ((source = e_source_group_peek_source_by_name(sdialog->source_group, tmp)) == NULL
+ && ((source = e_source_group_peek_source_by_name (sdialog->source_group, tmp)) == NULL
|| source == sdialog->original_source);
#ifdef HAVE_LDAP
- if (valid && source_group_is_remote(sdialog->source_group)) {
- gchar *uri = e_source_get_uri(sdialog->source);
+ if (valid && source_group_is_remote (sdialog->source_group)) {
+ gchar *uri = e_source_get_uri (sdialog->source);
LDAPURLDesc *lud;
/* check host and port set */
- if (ldap_url_parse(uri, &lud) == LDAP_SUCCESS) {
+ if (ldap_url_parse (uri, &lud) == LDAP_SUCCESS) {
valid = lud->lud_host != NULL
&& lud->lud_host[0] != 0
&& lud->lud_port != 0;
ldap_free_urldesc (lud);
} else
valid = FALSE;
- g_free(uri);
+ g_free (uri);
/* check auth name provided if auth set */
if (valid && (tmp = e_source_get_property(sdialog->source, "auth"))) {
- switch (ldap_parse_auth(tmp)) {
+ switch (ldap_parse_auth (tmp)) {
case ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL:
tmp = e_source_get_property(sdialog->source, "email_addr");
break;
@@ -1130,7 +1130,7 @@ eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data)
/* check timeout isn't too short (why don't we just force it?) */
if (valid) {
tmp = e_source_get_property(sdialog->source, "timeout");
- valid = tmp && g_strtod(tmp, NULL) > 0.0;
+ valid = tmp && g_strtod (tmp, NULL) > 0.0;
}
}
#endif
@@ -1140,13 +1140,13 @@ eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data)
/* debug only: */
#if d(!)0
static void
-source_changed(ESource *source, AddressbookSourceDialog *sdialog)
+source_changed (ESource *source, AddressbookSourceDialog *sdialog)
{
gchar *xml;
- xml = e_source_to_standalone_xml(source);
+ xml = e_source_to_standalone_xml (source);
printf("source changed:\n%s\n", xml);
- g_free(xml);
+ g_free (xml);
}
#endif
@@ -1165,19 +1165,19 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source)
if (source) {
sdialog->original_source = source;
- g_object_ref(source);
+ g_object_ref (source);
sdialog->source_group = e_source_peek_group (source);
- xml = e_source_to_standalone_xml(source);
- sdialog->source = e_source_new_from_standalone_xml(xml);
- g_free(xml);
+ xml = e_source_to_standalone_xml (source);
+ sdialog->source = e_source_new_from_standalone_xml (xml);
+ g_free (xml);
} else {
GConfClient *gconf;
GSList *l;
sdialog->source = e_source_new("", "");
- gconf = gconf_client_get_default();
+ gconf = gconf_client_get_default ();
sdialog->source_list = e_source_list_new_for_gconf(gconf, "/apps/evolution/addressbook/sources");
- l = e_source_list_peek_groups(sdialog->source_list);
+ l = e_source_list_peek_groups (sdialog->source_list);
if (!l) {
g_warning ("Address Book source groups are missing! Check your GConf setup.");
g_object_unref (gconf);
@@ -1185,25 +1185,25 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source)
return NULL;
}
- sdialog->menu_source_groups = g_slist_copy(l);
+ sdialog->menu_source_groups = g_slist_copy (l);
#ifndef HAVE_LDAP
- for (;l;l = g_slist_next(l))
+ for (;l;l = g_slist_next (l))
if (!strncmp("ldap:", e_source_group_peek_base_uri(l->data), 5))
sdialog->menu_source_groups = g_slist_remove (sdialog->menu_source_groups, l->data);
#endif
sdialog->source_group = (ESourceGroup *)sdialog->menu_source_groups->data;
for (i=0;eabc_new_items[i].path;i++)
- items = g_slist_prepend(items, &eabc_new_items[i]);
- g_object_unref(gconf);
+ items = g_slist_prepend (items, &eabc_new_items[i]);
+ g_object_unref (gconf);
}
/* HACK: doesn't work if you don't do this */
- e_source_set_group(sdialog->source, sdialog->source_group);
+ e_source_set_group (sdialog->source, sdialog->source_group);
#if d(!)0
- xml = e_source_to_standalone_xml(sdialog->source);
+ xml = e_source_to_standalone_xml (sdialog->source);
printf("but working standalone xml: %s\n", xml);
- g_free(xml);
+ g_free (xml);
g_signal_connect(sdialog->source, "changed", source_changed, sdialog);
#endif
@@ -1211,15 +1211,15 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source)
for (i=0;eabc_items[i].path;i++) {
if (eabc_items[i].label)
- eabc_items[i].label = gettext(eabc_items[i].label);
- items = g_slist_prepend(items, &eabc_items[i]);
+ eabc_items[i].label = gettext (eabc_items[i].label);
+ items = g_slist_prepend (items, &eabc_items[i]);
}
- e_config_add_items((EConfig *)ec, items, eabc_commit, NULL, eabc_free, sdialog);
- e_config_add_page_check((EConfig *)ec, NULL, eabc_check_complete, sdialog);
+ e_config_add_items ((EConfig *)ec, items, eabc_commit, NULL, eabc_free, sdialog);
+ e_config_add_page_check ((EConfig *)ec, NULL, eabc_check_complete, sdialog);
- target = eab_config_target_new_source(ec, sdialog->source);
- e_config_set_target((EConfig *)ec, (EConfigTarget *)target);
+ target = eab_config_target_new_source (ec, sdialog->source);
+ e_config_set_target ((EConfig *)ec, (EConfigTarget *)target);
if (source)
sdialog->window = e_config_create_window((EConfig *)ec, NULL, _("Address Book Properties"));
@@ -1228,7 +1228,7 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source)
/* forces initial validation */
if (!sdialog->original_source)
- e_config_target_changed((EConfig *)ec, E_CONFIG_TARGET_CHANGED_STATE);
+ e_config_target_changed ((EConfig *)ec, E_CONFIG_TARGET_CHANGED_STATE);
return sdialog->window;
}
diff --git a/modules/addressbook/e-book-shell-content.h b/modules/addressbook/e-book-shell-content.h
index 595e366736..0876ec968c 100644
--- a/modules/addressbook/e-book-shell-content.h
+++ b/modules/addressbook/e-book-shell-content.h
@@ -79,7 +79,8 @@ struct _EBookShellContentClass {
GType e_book_shell_content_get_type (void);
void e_book_shell_content_register_type
(GTypeModule *type_module);
-GtkWidget * e_book_shell_content_new(EShellView *shell_view);
+GtkWidget * e_book_shell_content_new
+ (EShellView *shell_view);
void e_book_shell_content_insert_view
(EBookShellContent *book_shell_content,
EAddressbookView *addressbook_view);
diff --git a/modules/addressbook/e-book-shell-sidebar.h b/modules/addressbook/e-book-shell-sidebar.h
index a3eb76c77f..560609f53d 100644
--- a/modules/addressbook/e-book-shell-sidebar.h
+++ b/modules/addressbook/e-book-shell-sidebar.h
@@ -70,7 +70,8 @@ struct _EBookShellSidebarClass {
GType e_book_shell_sidebar_get_type (void);
void e_book_shell_sidebar_register_type
(GTypeModule *type_module);
-GtkWidget * e_book_shell_sidebar_new(EShellView *shell_view);
+GtkWidget * e_book_shell_sidebar_new
+ (EShellView *shell_view);
ESourceSelector *
e_book_shell_sidebar_get_selector
(EBookShellSidebar *book_shell_sidebar);
diff --git a/modules/addressbook/openldap-extract.h b/modules/addressbook/openldap-extract.h
index 67d5741ce9..7da5800d16 100644
--- a/modules/addressbook/openldap-extract.h
+++ b/modules/addressbook/openldap-extract.h
@@ -110,12 +110,12 @@ typedef struct ldap_objectclass {
} LDAPObjectClass;
static void
-vfree(gpointer *vec)
+vfree (gpointer *vec)
{
gint i;
for (i = 0; vec[i] != NULL; i++)
- free(vec[i]);
+ free (vec[i]);
}
/* from schema.c */
@@ -159,7 +159,7 @@ struct token {
};
static gint
-get_token( const gchar ** sp, gchar ** token_val )
+get_token ( const gchar ** sp, gchar ** token_val )
{
gint kind;
const gchar * p;
@@ -192,11 +192,11 @@ get_token( const gchar ** sp, gchar ** token_val )
(*sp)++;
if (**sp == '\'') {
q = *sp;
- res = LDAP_MALLOC(q-p+1);
+ res = LDAP_MALLOC (q-p+1);
if (!res) {
kind = TK_OUTOFMEM;
} else {
- strncpy(res,p,q-p);
+ strncpy (res,p,q-p);
res[q-p] = '\0';
*token_val = res;
}
@@ -208,7 +208,7 @@ get_token( const gchar ** sp, gchar ** token_val )
default:
kind = TK_BAREWORD;
p = *sp;
- while ( !LDAP_SPACE(**sp) &&
+ while ( !LDAP_SPACE (**sp) &&
**sp != '(' &&
**sp != ')' &&
**sp != '$' &&
@@ -216,11 +216,11 @@ get_token( const gchar ** sp, gchar ** token_val )
**sp != '\0' )
(*sp)++;
q = *sp;
- res = LDAP_MALLOC(q-p+1);
+ res = LDAP_MALLOC (q-p+1);
if (!res) {
kind = TK_OUTOFMEM;
} else {
- strncpy(res,p,q-p);
+ strncpy (res,p,q-p);
res[q-p] = '\0';
*token_val = res;
}
@@ -234,15 +234,15 @@ get_token( const gchar ** sp, gchar ** token_val )
/* Gobble optional whitespace */
static void
-parse_whsp(const gchar **sp)
+parse_whsp (const gchar **sp)
{
- while (LDAP_SPACE(**sp))
+ while (LDAP_SPACE (**sp))
(*sp)++;
}
/* Parse a sequence of dot-separated decimal strings */
static gchar *
-ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags)
+ldap_int_parse_numericoid (const gchar **sp, gint *code, const gint flags)
{
gchar * res = NULL;
const gchar * start = *sp;
@@ -257,7 +257,7 @@ ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags)
}
/* Each iteration of this loop gets one decimal string */
while (**sp) {
- if (!LDAP_DIGIT(**sp)) {
+ if (!LDAP_DIGIT (**sp)) {
/*
* Initial gchar is not a digit or gchar after dot is
* not a digit
@@ -266,7 +266,7 @@ ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags)
return NULL;
}
(*sp)++;
- while (LDAP_DIGIT(**sp))
+ while (LDAP_DIGIT (**sp))
(*sp)++;
if (**sp != '.')
break;
@@ -286,20 +286,20 @@ ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags)
if (flags & LDAP_SCHEMA_SKIP) {
res = (gchar *)start;
} else {
- res = LDAP_MALLOC(len+1);
+ res = LDAP_MALLOC (len+1);
if (!res) {
*code = LDAP_SCHERR_OUTOFMEM;
- return(NULL);
+ return (NULL);
}
- strncpy(res,start,len);
+ strncpy (res,start,len);
res[len] = '\0';
}
- return(res);
+ return (res);
}
/* Parse a qdescr or a list of them enclosed in () */
static gchar **
-parse_qdescrs(const gchar **sp, gint *code)
+parse_qdescrs (const gchar **sp, gint *code)
{
gchar ** res;
gchar ** res1;
@@ -308,58 +308,58 @@ parse_qdescrs(const gchar **sp, gint *code)
gint size;
gint pos;
- parse_whsp(sp);
- kind = get_token(sp,&sval);
+ 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(gchar *));
+ res = LDAP_CALLOC (3,sizeof (gchar *));
if (!res) {
*code = LDAP_SCHERR_OUTOFMEM;
return NULL;
}
pos = 0;
while (1) {
- parse_whsp(sp);
- kind = get_token(sp,&sval);
+ parse_whsp (sp);
+ kind = get_token (sp,&sval);
if (kind == TK_RIGHTPAREN)
break;
if (kind == TK_QDESCR) {
if (pos == size-2) {
size++;
- res1 = LDAP_REALLOC(res,size*sizeof(gchar *));
+ res1 = LDAP_REALLOC (res,size*sizeof (gchar *));
if (!res1) {
- LDAP_VFREE(res);
- LDAP_FREE(sval);
+ LDAP_VFREE (res);
+ LDAP_FREE (sval);
*code = LDAP_SCHERR_OUTOFMEM;
- return(NULL);
+ return (NULL);
}
res = res1;
}
res[pos++] = sval;
res[pos] = NULL;
- parse_whsp(sp);
+ parse_whsp (sp);
} else {
- LDAP_VFREE(res);
- LDAP_FREE(sval);
+ LDAP_VFREE (res);
+ LDAP_FREE (sval);
*code = LDAP_SCHERR_UNEXPTOKEN;
- return(NULL);
+ return (NULL);
}
}
- parse_whsp(sp);
- return(res);
+ parse_whsp (sp);
+ return (res);
} else if (kind == TK_QDESCR) {
- res = LDAP_CALLOC(2,sizeof(gchar *));
+ res = LDAP_CALLOC (2,sizeof (gchar *));
if (!res) {
*code = LDAP_SCHERR_OUTOFMEM;
return NULL;
}
res[0] = sval;
res[1] = NULL;
- parse_whsp(sp);
+ parse_whsp (sp);
return res;
} else {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
*code = LDAP_SCHERR_BADNAME;
return NULL;
}
@@ -367,7 +367,7 @@ parse_qdescrs(const gchar **sp, gint *code)
/* Parse a woid or a $-separated list of them enclosed in () */
static gchar **
-parse_oids(const gchar **sp, gint *code, const gint allow_quoted)
+parse_oids (const gchar **sp, gint *code, const gint allow_quoted)
{
gchar ** res;
gchar ** res1;
@@ -382,48 +382,48 @@ parse_oids(const gchar **sp, gint *code, const gint allow_quoted)
* we are very liberal in what we accept as an OID. Maybe
* refine later.
*/
- parse_whsp(sp);
- kind = get_token(sp,&sval);
+ 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(gchar *));
+ res = LDAP_CALLOC (3,sizeof (gchar *));
if (!res) {
*code = LDAP_SCHERR_OUTOFMEM;
return NULL;
}
pos = 0;
- parse_whsp(sp);
- kind = get_token(sp,&sval);
+ parse_whsp (sp);
+ kind = get_token (sp,&sval);
if ( kind == TK_BAREWORD ||
( allow_quoted && kind == TK_QDSTRING ) ) {
res[pos++] = sval;
res[pos] = NULL;
} else {
*code = LDAP_SCHERR_UNEXPTOKEN;
- LDAP_FREE(sval);
- LDAP_VFREE(res);
+ LDAP_FREE (sval);
+ LDAP_VFREE (res);
return NULL;
}
- parse_whsp(sp);
+ parse_whsp (sp);
while (1) {
- kind = get_token(sp,&sval);
+ kind = get_token (sp,&sval);
if (kind == TK_RIGHTPAREN)
break;
if (kind == TK_DOLLAR) {
- parse_whsp(sp);
- kind = get_token(sp,&sval);
+ parse_whsp (sp);
+ kind = get_token (sp,&sval);
if ( kind == TK_BAREWORD ||
( allow_quoted &&
kind == TK_QDSTRING ) ) {
if (pos == size-2) {
size++;
- res1 = LDAP_REALLOC(res,size*sizeof(gchar *));
+ res1 = LDAP_REALLOC (res,size*sizeof (gchar *));
if (!res1) {
- LDAP_FREE(sval);
- LDAP_VFREE(res);
+ LDAP_FREE (sval);
+ LDAP_VFREE (res);
*code = LDAP_SCHERR_OUTOFMEM;
- return(NULL);
+ return (NULL);
}
res = res1;
}
@@ -431,53 +431,53 @@ parse_oids(const gchar **sp, gint *code, const gint allow_quoted)
res[pos] = NULL;
} else {
*code = LDAP_SCHERR_UNEXPTOKEN;
- LDAP_FREE(sval);
- LDAP_VFREE(res);
+ LDAP_FREE (sval);
+ LDAP_VFREE (res);
return NULL;
}
- parse_whsp(sp);
+ parse_whsp (sp);
} else {
*code = LDAP_SCHERR_UNEXPTOKEN;
- LDAP_FREE(sval);
- LDAP_VFREE(res);
+ LDAP_FREE (sval);
+ LDAP_VFREE (res);
return NULL;
}
}
- parse_whsp(sp);
- return(res);
+ parse_whsp (sp);
+ return (res);
} else if ( kind == TK_BAREWORD ||
( allow_quoted && kind == TK_QDSTRING ) ) {
- res = LDAP_CALLOC(2,sizeof(gchar *));
+ res = LDAP_CALLOC (2,sizeof (gchar *));
if (!res) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
*code = LDAP_SCHERR_OUTOFMEM;
return NULL;
}
res[0] = sval;
res[1] = NULL;
- parse_whsp(sp);
+ parse_whsp (sp);
return res;
} else {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
*code = LDAP_SCHERR_BADNAME;
return NULL;
}
}
static void
-ldap_objectclass_free(LDAPObjectClass * oc)
+ldap_objectclass_free (LDAPObjectClass * oc)
{
- LDAP_FREE(oc->oc_oid);
- if (oc->oc_names) LDAP_VFREE(oc->oc_names);
- if (oc->oc_desc) LDAP_FREE(oc->oc_desc);
- if (oc->oc_sup_oids) LDAP_VFREE(oc->oc_sup_oids);
- if (oc->oc_at_oids_must) LDAP_VFREE(oc->oc_at_oids_must);
- if (oc->oc_at_oids_may) LDAP_VFREE(oc->oc_at_oids_may);
- LDAP_FREE(oc);
+ LDAP_FREE (oc->oc_oid);
+ if (oc->oc_names) LDAP_VFREE (oc->oc_names);
+ if (oc->oc_desc) LDAP_FREE (oc->oc_desc);
+ if (oc->oc_sup_oids) LDAP_VFREE (oc->oc_sup_oids);
+ if (oc->oc_at_oids_must) LDAP_VFREE (oc->oc_at_oids_must);
+ if (oc->oc_at_oids_may) LDAP_VFREE (oc->oc_at_oids_may);
+ LDAP_FREE (oc);
}
static LDAPObjectClass *
-ldap_str2objectclass( LDAP_CONST gchar * s,
+ldap_str2objectclass ( LDAP_CONST gchar * s,
gint * code,
LDAP_CONST gchar ** errp,
LDAP_CONST unsigned flags )
@@ -503,7 +503,7 @@ ldap_str2objectclass( LDAP_CONST gchar * s,
}
*errp = s;
- oc = LDAP_CALLOC(1,sizeof(LDAPObjectClass));
+ oc = LDAP_CALLOC (1,sizeof (LDAPObjectClass));
if (!oc) {
*code = LDAP_SCHERR_OUTOFMEM;
@@ -511,11 +511,11 @@ ldap_str2objectclass( LDAP_CONST gchar * s,
}
oc->oc_kind = LDAP_SCHEMA_STRUCTURAL;
- kind = get_token(&ss,&sval);
+ kind = get_token (&ss,&sval);
if (kind != TK_LEFTPAREN) {
*code = LDAP_SCHERR_NOLEFTPAREN;
- LDAP_FREE(sval);
- ldap_objectclass_free(oc);
+ LDAP_FREE (sval);
+ ldap_objectclass_free (oc);
return NULL;
}
@@ -526,14 +526,14 @@ ldap_str2objectclass( LDAP_CONST gchar * s,
* in the wrong format or even no OID at all. We do our best to
* extract info from those servers.
*/
- parse_whsp(&ss);
+ parse_whsp (&ss);
savepos = ss;
- oc->oc_oid = ldap_int_parse_numericoid(&ss,code,0);
+ oc->oc_oid = ldap_int_parse_numericoid (&ss,code,0);
if (!oc->oc_oid) {
if ((flags & LDAP_SCHEMA_ALLOW_ALL) && (ss == savepos)) {
/* Backtracking */
ss = savepos;
- kind = get_token(&ss,&sval);
+ kind = get_token (&ss,&sval);
if (kind == TK_BAREWORD) {
if ( !strcasecmp(sval, "NAME") ||
!strcasecmp(sval, "DESC") ||
@@ -551,196 +551,196 @@ ldap_str2objectclass( LDAP_CONST gchar * s,
LDAP_SCHEMA_ALLOW_OID_MACRO ) {
/* Non-numerical OID, ignore */
gint len = ss-savepos;
- oc->oc_oid = LDAP_MALLOC(len+1);
- strncpy(oc->oc_oid, savepos, len);
+ oc->oc_oid = LDAP_MALLOC (len+1);
+ strncpy (oc->oc_oid, savepos, len);
oc->oc_oid[len] = 0;
}
}
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
} else {
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
}
- parse_whsp(&ss);
+ parse_whsp (&ss);
/*
* Beyond this point we will be liberal an accept the items
* in any order.
*/
while (1) {
- kind = get_token(&ss,&sval);
+ kind = get_token (&ss,&sval);
switch (kind) {
case TK_EOS:
*code = LDAP_SCHERR_NORIGHTPAREN;
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
case TK_RIGHTPAREN:
return oc;
case TK_BAREWORD:
if (!strcasecmp(sval,"NAME")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_name) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_name = 1;
- oc->oc_names = parse_qdescrs(&ss,code);
+ oc->oc_names = parse_qdescrs (&ss,code);
if (!oc->oc_names) {
if (*code != LDAP_SCHERR_OUTOFMEM)
*code = LDAP_SCHERR_BADNAME;
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
} else if (!strcasecmp(sval,"DESC")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_desc) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_desc = 1;
- parse_whsp(&ss);
- kind = get_token(&ss,&sval);
+ parse_whsp (&ss);
+ kind = get_token (&ss,&sval);
if (kind != TK_QDSTRING) {
*code = LDAP_SCHERR_UNEXPTOKEN;
*errp = ss;
- LDAP_FREE(sval);
- ldap_objectclass_free(oc);
+ LDAP_FREE (sval);
+ ldap_objectclass_free (oc);
return NULL;
}
oc->oc_desc = sval;
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"OBSOLETE")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_obsolete) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_obsolete = 1;
oc->oc_obsolete = LDAP_SCHEMA_YES;
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"SUP")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_sup) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_sup = 1;
- oc->oc_sup_oids = parse_oids(&ss,
+ oc->oc_sup_oids = parse_oids (&ss,
code,
flags);
if (!oc->oc_sup_oids) {
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
} else if (!strcasecmp(sval,"ABSTRACT")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_kind) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_kind = 1;
oc->oc_kind = LDAP_SCHEMA_ABSTRACT;
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"STRUCTURAL")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_kind) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_kind = 1;
oc->oc_kind = LDAP_SCHEMA_STRUCTURAL;
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"AUXILIARY")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_kind) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_kind = 1;
oc->oc_kind = LDAP_SCHEMA_AUXILIARY;
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"MUST")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_must) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_must = 1;
- oc->oc_at_oids_must = parse_oids(&ss,code,0);
+ oc->oc_at_oids_must = parse_oids (&ss,code,0);
if (!oc->oc_at_oids_must) {
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (!strcasecmp(sval,"MAY")) {
- LDAP_FREE(sval);
+ LDAP_FREE (sval);
if (seen_may) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
- ldap_objectclass_free(oc);
- return(NULL);
+ ldap_objectclass_free (oc);
+ return (NULL);
}
seen_may = 1;
- oc->oc_at_oids_may = parse_oids(&ss,code,0);
+ oc->oc_at_oids_may = parse_oids (&ss,code,0);
if (!oc->oc_at_oids_may) {
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
- parse_whsp(&ss);
+ parse_whsp (&ss);
} else if (sval[0] == 'X' && sval[1] == '-') {
/* Should be parse_qdstrings */
- ext_vals = parse_qdescrs(&ss, code);
+ ext_vals = parse_qdescrs (&ss, code);
if (!ext_vals) {
*errp = ss;
- ldap_objectclass_free(oc);
+ ldap_objectclass_free (oc);
return NULL;
}
#if 0
- if ( add_extension(&oc->oc_extensions,
+ if ( add_extension (&oc->oc_extensions,
sval, ext_vals) ) {
*code = LDAP_SCHERR_OUTOFMEM;
*errp = ss;
- LDAP_FREE(sval);
- ldap_objectclass_free(oc);
+ LDAP_FREE (sval);
+ ldap_objectclass_free (oc);
return NULL;
}
#endif
} else {
*code = LDAP_SCHERR_UNEXPTOKEN;
*errp = ss;
- LDAP_FREE(sval);
- ldap_objectclass_free(oc);
+ LDAP_FREE (sval);
+ ldap_objectclass_free (oc);
return NULL;
}
break;
default:
*code = LDAP_SCHERR_UNEXPTOKEN;
*errp = ss;
- LDAP_FREE(sval);
- ldap_objectclass_free(oc);
+ LDAP_FREE (sval);
+ ldap_objectclass_free (oc);
return NULL;
}
}
@@ -752,10 +752,10 @@ ldap_str2objectclass( LDAP_CONST gchar * s,
#define LDAP_UTF8_INCR(p) ((p)=LDAP_UTF8_NEXT((p)))
#define ldap_x_utf8_to_ucs4(str) g_utf8_get_char(str)
-static gchar *ldap_utf8_strchr( const gchar *str, const gchar *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 )) {
+ for (; *str != '\0'; LDAP_UTF8_INCR (str) ) {
+ if (ldap_x_utf8_to_ucs4 ( str ) == ldap_x_utf8_to_ucs4 ( chr )) {
return (gchar *) str;
}
}
@@ -763,14 +763,14 @@ static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr )
return NULL;
}
-static gsize ldap_utf8_strcspn( const gchar *str, const gchar *set )
+static gsize ldap_utf8_strcspn ( const gchar *str, const gchar *set )
{
const gchar *cstr;
const gchar *cset;
- for (cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr)) {
- for (cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset)) {
- if (ldap_x_utf8_to_ucs4( cstr ) == ldap_x_utf8_to_ucs4( cset )) {
+ for (cstr = str; *cstr != '\0'; LDAP_UTF8_INCR (cstr)) {
+ for (cset = set; *cset != '\0'; LDAP_UTF8_INCR (cset)) {
+ if (ldap_x_utf8_to_ucs4 ( cstr ) == ldap_x_utf8_to_ucs4 ( cset )) {
return cstr - str;
}
}
@@ -779,18 +779,18 @@ static gsize ldap_utf8_strcspn( const gchar *str, const gchar *set )
return cstr - str;
}
-static gsize ldap_utf8_strspn( const gchar *str, const gchar *set )
+static gsize ldap_utf8_strspn ( const gchar *str, const gchar *set )
{
const gchar *cstr;
const gchar *cset;
- for (cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr)) {
- for (cset = set; ; LDAP_UTF8_INCR(cset)) {
+ for (cstr = str; *cstr != '\0'; LDAP_UTF8_INCR (cstr)) {
+ for (cset = set; ; LDAP_UTF8_INCR (cset)) {
if (*cset == '\0') {
return cstr - str;
}
- if (ldap_x_utf8_to_ucs4( cstr ) == ldap_x_utf8_to_ucs4( cset )) {
+ if (ldap_x_utf8_to_ucs4 ( cstr ) == ldap_x_utf8_to_ucs4 ( cset )) {
break;
}
}
@@ -799,7 +799,7 @@ static gsize ldap_utf8_strspn( const gchar *str, const gchar *set )
return cstr - str;
}
-static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last)
+static gchar *ldap_utf8_strtok (gchar *str, const gchar *sep, gchar **last)
{
gchar *begin;
gchar *end;
@@ -808,17 +808,17 @@ static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last)
begin = str ? str : *last;
- begin += ldap_utf8_strspn( begin, sep );
+ begin += ldap_utf8_strspn ( begin, sep );
if (*begin == '\0') {
*last = NULL;
return NULL;
}
- end = &begin[ ldap_utf8_strcspn( begin, sep ) ];
+ end = &begin[ ldap_utf8_strcspn ( begin, sep ) ];
if (*end != '\0') {
- gchar *next = LDAP_UTF8_NEXT( end );
+ gchar *next = LDAP_UTF8_NEXT ( end );
*end = '\0';
end = next;
}
@@ -868,7 +868,7 @@ typedef struct ldap_url_desc {
/* from url.c */
static const gchar *
-skip_url_prefix(
+skip_url_prefix (
const gchar *url,
gint *enclosedp,
const gchar **scheme )
@@ -880,7 +880,7 @@ skip_url_prefix(
const gchar *p;
if (url == NULL) {
- return( NULL );
+ return ( NULL );
}
p = url;
@@ -894,48 +894,48 @@ skip_url_prefix(
}
/* skip leading "URL:" (if any) */
- if (strncasecmp( p, LDAP_URL_URLCOLON, LDAP_URL_URLCOLON_LEN ) == 0) {
+ if (strncasecmp ( p, LDAP_URL_URLCOLON, LDAP_URL_URLCOLON_LEN ) == 0) {
p += LDAP_URL_URLCOLON_LEN;
}
/* check for "ldap://" prefix */
- if (strncasecmp( p, LDAP_URL_PREFIX, LDAP_URL_PREFIX_LEN ) == 0) {
+ if (strncasecmp ( p, LDAP_URL_PREFIX, LDAP_URL_PREFIX_LEN ) == 0) {
/* skip over "ldap://" prefix and return success */
p += LDAP_URL_PREFIX_LEN;
*scheme = "ldap";
- return( p );
+ return ( p );
}
/* check for "ldaps://" prefix */
- if (strncasecmp( p, LDAPS_URL_PREFIX, LDAPS_URL_PREFIX_LEN ) == 0) {
+ if (strncasecmp ( p, LDAPS_URL_PREFIX, LDAPS_URL_PREFIX_LEN ) == 0) {
/* skip over "ldaps://" prefix and return success */
p += LDAPS_URL_PREFIX_LEN;
*scheme = "ldaps";
- return( p );
+ return ( p );
}
/* check for "ldapi://" prefix */
- if (strncasecmp( p, LDAPI_URL_PREFIX, LDAPI_URL_PREFIX_LEN ) == 0) {
+ if (strncasecmp ( p, LDAPI_URL_PREFIX, LDAPI_URL_PREFIX_LEN ) == 0) {
/* skip over "ldapi://" prefix and return success */
p += LDAPI_URL_PREFIX_LEN;
*scheme = "ldapi";
- return( p );
+ return ( p );
}
#ifdef LDAP_CONNECTIONLESS
/* check for "cldap://" prefix */
- if (strncasecmp( p, LDAPC_URL_PREFIX, LDAPC_URL_PREFIX_LEN ) == 0) {
+ if (strncasecmp ( p, LDAPC_URL_PREFIX, LDAPC_URL_PREFIX_LEN ) == 0) {
/* skip over "cldap://" prefix and return success */
p += LDAPC_URL_PREFIX_LEN;
*scheme = "cldap";
- return( p );
+ return ( p );
}
#endif
- return( NULL );
+ return ( NULL );
}
-static gint str2scope( const gchar *p )
+static gint str2scope ( const gchar *p )
{
if (strcasecmp( p, "one" ) == 0) {
return LDAP_SCOPE_ONELEVEL;
@@ -953,53 +953,53 @@ static gint str2scope( const gchar *p )
return LDAP_SCOPE_SUBTREE;
}
- return( -1 );
+ return ( -1 );
}
static void
-ldap_free_urldesc( LDAPURLDesc *ludp )
+ldap_free_urldesc ( LDAPURLDesc *ludp )
{
if (ludp == NULL) {
return;
}
if (ludp->lud_scheme != NULL) {
- LDAP_FREE( ludp->lud_scheme );
+ LDAP_FREE ( ludp->lud_scheme );
}
if (ludp->lud_host != NULL) {
- LDAP_FREE( ludp->lud_host );
+ LDAP_FREE ( ludp->lud_host );
}
if (ludp->lud_dn != NULL) {
- LDAP_FREE( ludp->lud_dn );
+ LDAP_FREE ( ludp->lud_dn );
}
if (ludp->lud_filter != NULL) {
- LDAP_FREE( ludp->lud_filter);
+ LDAP_FREE ( ludp->lud_filter);
}
if (ludp->lud_attrs != NULL) {
- LDAP_VFREE( ludp->lud_attrs );
+ LDAP_VFREE ( ludp->lud_attrs );
}
if (ludp->lud_exts != NULL) {
- LDAP_VFREE( ludp->lud_exts );
+ LDAP_VFREE ( ludp->lud_exts );
}
- LDAP_FREE( ludp );
+ LDAP_FREE ( ludp );
}
static gint
-ldap_int_unhex( gint c )
+ldap_int_unhex ( gint c )
{
- return( c >= '0' && c <= '9' ? c - '0'
+ return ( c >= '0' && c <= '9' ? c - '0'
: c >= 'A' && c <= 'F' ? c - 'A' + 10
: c - 'a' + 10 );
}
static void
-ldap_pvt_hex_unescape( gchar *s )
+ldap_pvt_hex_unescape ( gchar *s )
{
/*
* Remove URL hex escapes from s... done in place. The basic concept for
@@ -1026,7 +1026,7 @@ ldap_pvt_hex_unescape( gchar *s )
}
static gchar **
-ldap_str2charray( const gchar *str_in, const gchar *brkstr )
+ldap_str2charray ( const gchar *str_in, const gchar *brkstr )
{
gchar **res;
gchar *str, *s;
@@ -1034,39 +1034,39 @@ ldap_str2charray( const gchar *str_in, const gchar *brkstr )
gint i;
/* protect the input string from strtok */
- str = LDAP_STRDUP( str_in );
+ str = LDAP_STRDUP ( str_in );
if (str == NULL) {
return NULL;
}
i = 1;
for (s = str; *s; s++) {
- if (ldap_utf8_strchr( brkstr, s ) != NULL) {
+ if (ldap_utf8_strchr ( brkstr, s ) != NULL) {
i++;
}
}
- res = (gchar **) LDAP_MALLOC( (i + 1) * sizeof(gchar *) );
+ res = (gchar **) LDAP_MALLOC ( (i + 1) * sizeof (gchar *) );
if (res == NULL) {
- LDAP_FREE( str );
+ LDAP_FREE ( str );
return NULL;
}
i = 0;
- for (s = ldap_utf8_strtok( str, brkstr, &lasts);
+ for (s = ldap_utf8_strtok ( str, brkstr, &lasts);
s != NULL;
- s = ldap_utf8_strtok( NULL, brkstr, &lasts ) )
+ s = ldap_utf8_strtok ( NULL, brkstr, &lasts ) )
{
- res[i] = LDAP_STRDUP( s );
+ res[i] = LDAP_STRDUP ( s );
if (res[i] == NULL) {
for (--i; i >= 0; i--) {
- LDAP_FREE( res[i] );
+ LDAP_FREE ( res[i] );
}
- LDAP_FREE( res );
- LDAP_FREE( str );
+ LDAP_FREE ( res );
+ LDAP_FREE ( str );
return NULL;
}
@@ -1075,12 +1075,12 @@ ldap_str2charray( const gchar *str_in, const gchar *brkstr )
res[i] = NULL;
- LDAP_FREE( str );
- return( res );
+ LDAP_FREE ( str );
+ return ( res );
}
static gint
-ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
+ldap_url_parse_ext ( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
{
/*
* Pick apart the pieces of an LDAP URL.
@@ -1099,25 +1099,25 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
*ludpp = NULL; /* pessimistic */
- url_tmp = skip_url_prefix( url_in, &enclosed, &scheme );
+ url_tmp = skip_url_prefix ( url_in, &enclosed, &scheme );
if (url_tmp == NULL) {
return LDAP_URL_ERR_BADSCHEME;
}
- assert( scheme );
+ assert ( scheme );
/* make working copy of the remainder of the URL */
- url = LDAP_STRDUP( url_tmp );
+ url = LDAP_STRDUP ( url_tmp );
if (url == NULL) {
return LDAP_URL_ERR_MEM;
}
if (enclosed) {
- p = &url[strlen(url)-1];
+ p = &url[strlen (url)-1];
if (*p != '>') {
- LDAP_FREE( url );
+ LDAP_FREE ( url );
return LDAP_URL_ERR_BADENCLOSURE;
}
@@ -1125,10 +1125,10 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
}
/* allocate return struct */
- ludp = (LDAPURLDesc *)LDAP_CALLOC( 1, sizeof( LDAPURLDesc ));
+ ludp = (LDAPURLDesc *)LDAP_CALLOC ( 1, sizeof ( LDAPURLDesc ));
if (ludp == NULL) {
- LDAP_FREE( url );
+ LDAP_FREE ( url );
return LDAP_URL_ERR_MEM;
}
@@ -1142,16 +1142,16 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
ludp->lud_filter = NULL;
ludp->lud_exts = NULL;
- ludp->lud_scheme = LDAP_STRDUP( scheme );
+ ludp->lud_scheme = LDAP_STRDUP ( scheme );
if (ludp->lud_scheme == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_MEM;
}
/* scan forward for '/' that marks end of hostport and begin. of dn */
- p = strchr( url, '/' );
+ p = strchr ( url, '/' );
if (p != NULL) {
/* terminate hostport; point to start of dn */
@@ -1160,46 +1160,46 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
/* IPv6 syntax with [ip address]:port */
if (*url == '[') {
- r = strchr( url, ']' );
+ r = strchr ( url, ']' );
if (r == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADURL;
}
*r++ = '\0';
- q = strchr( r, ':' );
+ q = strchr ( r, ':' );
} else {
- q = strchr( url, ':' );
+ q = strchr ( url, ':' );
}
if (q != NULL) {
gchar *next;
*q++ = '\0';
- ldap_pvt_hex_unescape( q );
+ ldap_pvt_hex_unescape ( q );
if (*q == '\0') {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADURL;
}
- ludp->lud_port = strtol( q, &next, 10 );
+ ludp->lud_port = strtol ( q, &next, 10 );
if (next == NULL || next[0] != '\0') {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADURL;
}
}
- ldap_pvt_hex_unescape( url );
+ ldap_pvt_hex_unescape ( url );
/* If [ip address]:port syntax, url is [ip and we skip the [ */
- ludp->lud_host = LDAP_STRDUP( url + ( *url == '[' ) );
+ ludp->lud_host = LDAP_STRDUP ( url + ( *url == '[' ) );
if (ludp->lud_host == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_MEM;
}
@@ -1212,35 +1212,35 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
* but we need to account for it. Fortunately it can't be confused with
* anything real.
*/
- if ( (p == NULL) && (q != NULL) && ((q = strchr( q, '?')) != NULL)) {
+ if ( (p == NULL) && (q != NULL) && ((q = strchr ( q, '?')) != NULL)) {
q++;
/* ? immediately followed by question */
if ( *q == '?') {
q++;
if (*q != '\0') {
/* parse dn part */
- ldap_pvt_hex_unescape( q );
- ludp->lud_dn = LDAP_STRDUP( q );
+ ldap_pvt_hex_unescape ( q );
+ ludp->lud_dn = LDAP_STRDUP ( q );
} else {
ludp->lud_dn = LDAP_STRDUP( "" );
}
if (ludp->lud_dn == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_MEM;
}
}
}
if (p == NULL) {
- LDAP_FREE( url );
+ LDAP_FREE ( url );
*ludpp = ludp;
return LDAP_URL_SUCCESS;
}
/* scan forward for '?' that may marks end of dn */
- q = strchr( p, '?' );
+ q = strchr ( p, '?' );
if (q != NULL) {
/* terminate dn part */
@@ -1249,28 +1249,28 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
if (*p != '\0') {
/* parse dn part */
- ldap_pvt_hex_unescape( p );
- ludp->lud_dn = LDAP_STRDUP( p );
+ ldap_pvt_hex_unescape ( p );
+ ludp->lud_dn = LDAP_STRDUP ( p );
} else {
ludp->lud_dn = LDAP_STRDUP( "" );
}
if (ludp->lud_dn == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_MEM;
}
if (q == NULL) {
/* no more */
- LDAP_FREE( url );
+ LDAP_FREE ( url );
*ludpp = ludp;
return LDAP_URL_SUCCESS;
}
/* scan forward for '?' that may marks end of attributes */
p = q;
- q = strchr( p, '?' );
+ q = strchr ( p, '?' );
if (q != NULL) {
/* terminate attributes part */
@@ -1279,26 +1279,26 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
if (*p != '\0') {
/* parse attributes */
- ldap_pvt_hex_unescape( p );
+ ldap_pvt_hex_unescape ( p );
ludp->lud_attrs = ldap_str2charray( p, "," );
if (ludp->lud_attrs == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADATTRS;
}
}
if (q == NULL) {
/* no more */
- LDAP_FREE( url );
+ LDAP_FREE ( url );
*ludpp = ludp;
return LDAP_URL_SUCCESS;
}
/* scan forward for '?' that may marks end of scope */
p = q;
- q = strchr( p, '?' );
+ q = strchr ( p, '?' );
if (q != NULL) {
/* terminate the scope part */
@@ -1307,26 +1307,26 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
if (*p != '\0') {
/* parse the scope */
- ldap_pvt_hex_unescape( p );
- ludp->lud_scope = str2scope( p );
+ ldap_pvt_hex_unescape ( p );
+ ludp->lud_scope = str2scope ( p );
if (ludp->lud_scope == -1) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADSCOPE;
}
}
if (q == NULL) {
/* no more */
- LDAP_FREE( url );
+ LDAP_FREE ( url );
*ludpp = ludp;
return LDAP_URL_SUCCESS;
}
/* scan forward for '?' that may marks end of filter */
p = q;
- q = strchr( p, '?' );
+ q = strchr ( p, '?' );
if (q != NULL) {
/* terminate the filter part */
@@ -1335,40 +1335,40 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
if (*p != '\0') {
/* parse the filter */
- ldap_pvt_hex_unescape( p );
+ ldap_pvt_hex_unescape ( p );
if (!*p) {
/* missing filter */
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADFILTER;
}
- LDAP_FREE( ludp->lud_filter );
- ludp->lud_filter = LDAP_STRDUP( p );
+ LDAP_FREE ( ludp->lud_filter );
+ ludp->lud_filter = LDAP_STRDUP ( p );
if (ludp->lud_filter == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_MEM;
}
}
if (q == NULL) {
/* no more */
- LDAP_FREE( url );
+ LDAP_FREE ( url );
*ludpp = ludp;
return LDAP_URL_SUCCESS;
}
/* scan forward for '?' that may marks end of extensions */
p = q;
- q = strchr( p, '?' );
+ q = strchr ( p, '?' );
if (q != NULL) {
/* extra '?' */
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADURL;
}
@@ -1376,13 +1376,13 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
ludp->lud_exts = ldap_str2charray( p, "," );
if (ludp->lud_exts == NULL) {
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADEXTS;
}
for (i=0; ludp->lud_exts[i] != NULL; i++) {
- ldap_pvt_hex_unescape( ludp->lud_exts[i] );
+ ldap_pvt_hex_unescape ( ludp->lud_exts[i] );
if (*ludp->lud_exts[i] == '!') {
/* count the number of critical extensions */
@@ -1392,21 +1392,21 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
if (i == 0) {
/* must have 1 or more */
- LDAP_FREE( url );
- ldap_free_urldesc( ludp );
+ LDAP_FREE ( url );
+ ldap_free_urldesc ( ludp );
return LDAP_URL_ERR_BADEXTS;
}
/* no more */
*ludpp = ludp;
- LDAP_FREE( url );
+ LDAP_FREE ( url );
return LDAP_URL_SUCCESS;
}
static gint
-ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
+ldap_url_parse ( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
{
- gint rc = ldap_url_parse_ext( url_in, ludpp );
+ gint rc = ldap_url_parse_ext ( url_in, ludpp );
if (rc != LDAP_URL_SUCCESS) {
return rc;
@@ -1417,7 +1417,7 @@ ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
}
if ((*ludpp)->lud_host != NULL && *(*ludpp)->lud_host == '\0') {
- LDAP_FREE( (*ludpp)->lud_host );
+ LDAP_FREE ( (*ludpp)->lud_host );
(*ludpp)->lud_host = NULL;
}