Don't refer to "auto_scroll_live" if HAVE_LIBPCAP isn't defined - and

put the definition of it back under HAVE_LIBPCAP and don't add an extra
declaration in "file.h", as there's no longer code that needs to refer
to it if HAVE_LIBPCAP isn't defined.

svn path=/trunk/; revision=10350
This commit is contained in:
Guy Harris 2004-03-08 23:45:25 +00:00
parent 903e497f57
commit 9feb374670
3 changed files with 13 additions and 6 deletions

4
file.c
View File

@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
* $Id: file.c,v 1.369 2004/03/08 23:07:15 jmayer Exp $
* $Id: file.c,v 1.370 2004/03/08 23:45:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -84,7 +84,9 @@
#include "tap_dfilter_dlg.h"
#include "packet-data.h"
#ifdef HAVE_LIBPCAP
gboolean auto_scroll_live;
#endif
static guint32 firstsec, firstusec;
static guint32 prevsec, prevusec;

4
file.h
View File

@ -1,7 +1,7 @@
/* file.h
* Definitions for file structures and routines
*
* $Id: file.h,v 1.117 2004/03/08 23:07:15 jmayer Exp $
* $Id: file.h,v 1.118 2004/03/08 23:45:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -42,8 +42,6 @@ typedef enum {
READ_ABORTED /* read aborted by user */
} read_status_t;
extern gboolean auto_scroll_live;
int cf_open(char *, gboolean, capture_file *);
void cf_close(capture_file *);
read_status_t cf_read(capture_file *);

View File

@ -1,7 +1,7 @@
/* menu.c
* Menu routines
*
* $Id: menu.c,v 1.175 2004/02/25 17:44:50 ulfl Exp $
* $Id: menu.c,v 1.176 2004/03/08 23:45:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -109,7 +109,9 @@ static void timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_mac_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_network_cb(GtkWidget *w _U_, gpointer d _U_);
static void name_resolution_transport_cb(GtkWidget *w _U_, gpointer d _U_);
#ifdef HAVE_LIBPCAP
static void auto_scroll_live_cb(GtkWidget *w _U_, gpointer d _U_);
#endif
/* This is the GtkItemFactoryEntry structure used to generate new menus.
Item 1: The menu path. The letter after the underscore indicates an
@ -216,7 +218,9 @@ static GtkItemFactoryEntry menu_items[] =
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _MAC Layer", NULL, name_resolution_mac_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _Network Layer", NULL, name_resolution_network_cb, 0, "<CheckItem>", NULL),
ITEM_FACTORY_ENTRY("/View/Name Resolution/Enable for _Transport Layer", NULL, name_resolution_transport_cb, 0, "<CheckItem>", NULL),
#ifdef HAVE_LIBPCAP
ITEM_FACTORY_ENTRY("/View/Auto Scroll in _Live Capture", NULL, auto_scroll_live_cb, 0, "<CheckItem>", NULL),
#endif
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
ITEM_FACTORY_STOCK_ENTRY("/View/Zoom In", "<control>plus", view_zoom_in_cb,
0, GTK_STOCK_ZOOM_IN),
@ -1236,12 +1240,13 @@ name_resolution_transport_cb(GtkWidget *w _U_, gpointer d _U_)
}
}
#ifdef HAVE_LIBPCAP
static void
auto_scroll_live_cb(GtkWidget *w _U_, gpointer d _U_)
{
auto_scroll_live = GTK_CHECK_MENU_ITEM(w)->active;
}
#endif
/* the recent file read has finished, update the menu corresponding */
void
@ -1275,8 +1280,10 @@ menu_recent_read_finished(void) {
menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Name Resolution/Enable for Transport Layer");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), g_resolv_flags & RESOLV_TRANSPORT);
#ifdef HAVE_LIBPCAP
menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Auto Scroll in Live Capture");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
#endif
main_widgets_rearrange();