From 2798f7c9c4a691a91b19c9ed50dbcf1c151325af Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 20 Feb 2017 18:46:08 -0800 Subject: Have all the remote host list routines' names begin with recent_. Some did, some didn't - make it consistent. Clean up some header comments while we're at it. Change-Id: I978c84167cce3c8f1c0280898aa4d0b60958325b Reviewed-on: https://code.wireshark.org/review/20218 Reviewed-by: Guy Harris --- ui/gtk/capture_dlg.c | 4 ++-- ui/qt/remote_capture_dialog.cpp | 4 ++-- ui/recent.c | 4 ++-- ui/recent.h | 25 +++++++++++++------------ 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index efc0bccbd8..3ce9d83028 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -1164,7 +1164,7 @@ iftype_combo_box_new(void) if (recent_get_remote_host_list_size() > 0) { /* Add remote hosts */ - remote_host_list_foreach (iftype_combo_box_add_remote_host, iftype_cbx); + recent_remote_host_list_foreach (iftype_combo_box_add_remote_host, iftype_cbx); iftype_combo_box_add_remote_separators (iftype_cbx); } @@ -1537,7 +1537,7 @@ select_if_type_cb(GtkComboBox *iftype_cbx, gpointer data _U_) gint num_remote = recent_get_remote_host_list_size(); if (new_iftype != -1 && new_iftype == num_remote+1) { - free_remote_host_list(); + recent_free_remote_host_list(); num_remote += 2; while (num_remote--) { /* Remove separator lines and "Clear" item */ gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT(iftype_cbx), num_remote); diff --git a/ui/qt/remote_capture_dialog.cpp b/ui/qt/remote_capture_dialog.cpp index 7ec8a2f190..820c542879 100644 --- a/ui/qt/remote_capture_dialog.cpp +++ b/ui/qt/remote_capture_dialog.cpp @@ -58,7 +58,7 @@ RemoteCaptureDialog::~RemoteCaptureDialog() void RemoteCaptureDialog::hostChanged(QString host) { if (!host.compare(tr("Clear list"))) { - free_remote_host_list(); + recent_free_remote_host_list(); ui->hostCombo->clear(); } else { struct remote_host *rh = recent_get_remote_host(host.toUtf8().constData()); @@ -87,7 +87,7 @@ void RemoteCaptureDialog::fillComboBox() ui->hostCombo->addItem(QString("")); remote_host_list_size = recent_get_remote_host_list_size(); if (remote_host_list_size > 0) { - remote_host_list_foreach(fillBox, ui->hostCombo); + recent_remote_host_list_foreach(fillBox, ui->hostCombo); ui->hostCombo->insertSeparator(remote_host_list_size+1); ui->hostCombo->addItem(QString(tr("Clear list"))); } diff --git a/ui/recent.c b/ui/recent.c index 3408cd8405..aaad91b0ad 100644 --- a/ui/recent.c +++ b/ui/recent.c @@ -413,7 +413,7 @@ free_remote_host (gpointer key _U_, gpointer value, gpointer user _U_) } void -remote_host_list_foreach(GHFunc func, gpointer user_data) +recent_remote_host_list_foreach(GHFunc func, gpointer user_data) { if (remote_host_list != NULL) g_hash_table_foreach(remote_host_list, func, user_data); @@ -438,7 +438,7 @@ capture_remote_combo_recent_write_all(FILE *rf) } -void free_remote_host_list(void) +void recent_free_remote_host_list(void) { g_hash_table_foreach_remove(remote_host_list, free_remote_host, NULL); } diff --git a/ui/recent.h b/ui/recent.h index e027c6ba57..bce8214b85 100644 --- a/ui/recent.h +++ b/ui/recent.h @@ -211,39 +211,40 @@ extern GList *recent_get_cfilter_list(const gchar *ifname); extern void recent_add_cfilter(const gchar *ifname, const gchar *s); /** - * Get the value of a remote host from the remote_host_list. + * Get the value of an entry for a remote host from the remote host list. * - * @param host Host's address + * @param host host name for the remote host. + * + * @return pointer to the entry for the remote host. */ extern struct remote_host *recent_get_remote_host(const gchar *host); /** - * Get the number of entries of the remote_host_list. + * Get the number of entries of the remote host list. * - * @return size of the hash table + * @return number of entries in the list. */ extern int recent_get_remote_host_list_size(void); /** - * Iterate over all items in the remote_host_list, calling a + * Iterate over all items in the remote host list, calling a * function for each member * - * @param func Function to be called - * @param user_data Argument to pass as user data to the function + * @param func function to be called + * @param user_data argument to pass as user data to the function */ -extern void remote_host_list_foreach(GHFunc func, gpointer user_data); +extern void recent_remote_host_list_foreach(GHFunc func, gpointer user_data); /** - * Free all entries of the remote_host_list. - * + * Free all entries of the remote host list. */ -extern void free_remote_host_list(void); +extern void recent_free_remote_host_list(void); /** * Add an entry to the remote_host_list. * * @param host Key of the entry - * @param rh Vakue of the entry + * @param rh Value of the entry */ extern void recent_add_remote_host(gchar *host, struct remote_host *rh); -- cgit v1.2.1