Don't refer to "auto_scroll_live" if HAVE_LIBPCAP isn't defined - and
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 8 Mar 2004 23:45:25 +0000 (23:45 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 8 Mar 2004 23:45:25 +0000 (23:45 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10350 f5534014-38df-0310-8fa8-9805f1628bb7

file.c
file.h
gtk/menu.c

diff --git a/file.c b/file.c
index 7d813936e3af3439129822b1a42ce406b9f02b95..22a2ff778349addd219b347a0d7868d238aee2e1 100644 (file)
--- a/file.c
+++ b/file.c
@@ -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;
diff --git a/file.h b/file.h
index ff3c23be7ebe965bc39166571a491fe868e17b9c..677aa25946650ce2e142c78e65692fc6d27d04d6 100644 (file)
--- a/file.h
+++ b/file.h
@@ -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 *);
index 079911fb751cb78dd4751c3dee74fbd8b7339240..884bb0e3ce0ded1bc1f98e66899e311cbdcd20c4 100644 (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();