forked from osmocom/wireshark
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 <guy@alum.mit.edu>
This commit is contained in:
parent
72e2c3acfa
commit
2798f7c9c4
|
@ -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);
|
||||
|
|
|
@ -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")));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
25
ui/recent.h
25
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue